cmark: updated to 0.31.0

0.31.0

* Update to 0.31.2 spec.txt.

* Treat unicode Symbols like Punctuation, as per the 0.31 spec.

* Add a new function to `utf8.h`:
  `int cmark_utf8proc_is_punctuation_or_symbol(int32_t uc)`.
  The old `cmark_utf8proc_is_punctuation` has been kept for
  now, but it is no longer used.

* Add new exported function `cmark_parser_new_with_mem_into_root`
  (API change) (John Ericson).

* Avoid repeated `language-` in info string

* Fix quadratic behavior in `S_insert_emph` (Nick Wellnhofer).
  Fixes part of GHSA-66g8-4hjf-77xh.

* Fix quadratic behavior in `check_open_blocks` (Nick Wellnhofer).
  Fixes part of GHSA-66g8-4hjf-77xh.

* Track underscore bottom separately mod 3, like asterisk (Michael
  Howell). This was already implemented correctly for asterisks,
  but not for underscore.

* Use `fwrite` instead of `printf` to print results in main
  This avoids a massive slowdown in MSYS2.

* commonmark writer: less aggressive escaping for `!`

* Update libFuzzer build (Nick Wellnhofer):

  + Move fuzzing files into their own directory.
  + Use libFuzzer the modern way by compiling and linking with
    `-fsanitize=fuzzer(-no-link)` without requiring `LIB_FUZZER_PATH`.
  + Update the `libFuzzer` rule in Makefile and the README.md.

* CMake build changes (Saleem Abdulrasool).

  + Inline multiple variables in CMake, following CMake recommendations.
  + Simplify the version computation.
  + Remove the `CMARK_STATIC` and `CMARK_SHARED` options as one of the two
    must be enabled always as the cmark executable depends on the library.
    Instead of having a custom flag to discern between the
    library type, use the native CMake option `BUILD_SHARED_LIBS`,
    allowing the user to control which library to build. This matches
    CMake recommendations to only build a single copy of the library.
  + Introduce an author warning for the use of `CMARK_SHARED` and
    `CMARK_STATIC` to redirect the author of the dependent package to
    `BUILD_SHARED_LIBS`.
  + Permit incremental linking on Windows. Although incremental linking
    does introduce padding in the binary for incremental links, that
    should not matter for release mode builds in theory as `/OPT:REF`
    and `/OPT:ICF` will trigger full links, which is the default in
    release mode.
  + Hoist the CMake module inclusion to the top level.
  + Minor tweaks for speeding up the configure phase.
    Restructure the file layout to place the custom modules into the
    `cmake/modules` directory that is the common layout for CMake based
    projects.
  + Squelch C4232 warnings on MSVC builds.
  + Remove check for `__builtin_expect`. Use `__has_builtin` to check
    at compile time if the feature is supported.
    This macro is supported by both clang and GCC (as of 10).
    In the case that the compiler in use is not new enough, we still
    provide the fallback so that the code will compile but without the
    additional hints for the branch probability. `config.h` has been
    removed from the code base as it is no longer needed.
  + Remove `/TP` usage on MSVC and replace `CMARK_INLINE` with `inline`.
    These were workarounds for pre-VS2015 compilers, which are no longer
    supported.
  + Hoist the C visibility settings to top level
  + Clean up C4267 warnings on MSVC builds.
  + Remove some compiler compatibility checks that are no longer
    needed because VS 2013 is no longer supported
  + Adjust the policy to silence warnings on MSVC builds
    CMake 3.15+ remove `/W3` from the language flags under MSVC with
    CMP0092.  Set the policy to new to avoid the D9025 warning.
  + Reflow some text to match CMake documentation style
  + Use generator expression for path computation.
  + Use CMake to propagate `CMARK_STATIC_DEFINE`.
  + Clean up an obsoleted variable (NFC).
  + Hoist the policy settings. Policy settings may impact how
    `project` functions.  They should be set immediately after
    `cmake_minimum_required` (which implicitly sets policies).
    Use the `POLICY` check to see if a policy is defined rather
    than using a version check.
  + Replace `CMARK_TESTS` with CMake sanctioned `BUILD_TESTING`.
  + Correct typo and adjust command invocation. Use the proper
    generator expression for the python interpreter and adjust
    a typo in the component name.
  + Add an upgrade path for newer CMake.
    CMake 3.12 deprecated `FindPythonInterp`, and with CMake 3.27, were
    obsoleted with CMP0148.  Add a version check and switch to the new
    behaviour to allow building with newer releases.

* Fix regex syntax warnings in `pathological_tests.py` (Nick Wellnhofer).

* `test/cmark.py`: avoid star imports (Jakub Wilk).

* `spec_tests.py`: Add option to generate fuzz corpus (Nick Wellnhofer).
  Add an option `--fuzz-corpus` that writes the test cases to separate
  files including the options header, so they can be used as seed corpus
  for fuzz testing.

* Fix some cmark.3 man rendering issues so we can do a clean regen
  (John Ericson).

* Update Windows compilation instructions
This commit is contained in:
adam 2024-01-30 20:00:13 +00:00
parent 975261644f
commit 68ea39152d
5 changed files with 11 additions and 41 deletions

View File

@ -1,7 +1,6 @@
# $NetBSD: Makefile,v 1.13 2023/08/14 05:25:21 wiz Exp $
# $NetBSD: Makefile,v 1.14 2024/01/30 20:00:13 adam Exp $
DISTNAME= cmark-0.30.3
PKGREVISION= 1
DISTNAME= cmark-0.31.0
CATEGORIES= textproc
MASTER_SITES= ${MASTER_SITE_GITHUB:=jgm/}
@ -10,12 +9,10 @@ HOMEPAGE= https://github.com/commonmark/cmark
COMMENT= CommonMark parsing and rendering library and program in C
LICENSE= 2-clause-bsd
USE_CMAKE= yes
USE_LANGUAGES= c c++
USE_TOOLS+= pkg-config
CONFIGURE_DIRS= build
CMAKE_ARG_PATH= ${WRKSRC}
PKGCONFIG_OVERRIDE+= src/libcmark.pc.in
CMAKE_CONFIGURE_ARGS+= -DBUILD_SHARED_LIBS=ON
PYTHON_FOR_BUILD_ONLY= yes
@ -26,8 +23,6 @@ TEST_ENV+= LD_LIBRARY_PATH=${WRKSRC}/build/src
TEST_ENV+= DYLD_LIBRARY_PATH=${WRKSRC}/build/src
TEST_TARGET= test
post-extract:
${MKDIR} ${WRKSRC}/build
.include "../../devel/cmake/build.mk"
.include "../../lang/python/tool.mk"
.include "../../mk/bsd.pkg.mk"

View File

@ -1,4 +1,4 @@
@comment $NetBSD: PLIST,v 1.3 2021/07/17 16:29:31 adam Exp $
@comment $NetBSD: PLIST,v 1.4 2024/01/30 20:00:13 adam Exp $
bin/cmark
include/cmark.h
include/cmark_export.h
@ -7,7 +7,6 @@ lib/cmake/cmark/cmark-config-version.cmake
lib/cmake/cmark/cmark-config.cmake
lib/cmake/cmark/cmark-targets-release.cmake
lib/cmake/cmark/cmark-targets.cmake
lib/libcmark.a
lib/libcmark.so
lib/libcmark.so.${PKGVERSION}
lib/pkgconfig/libcmark.pc

View File

@ -1,4 +1,4 @@
# $NetBSD: buildlink3.mk,v 1.2 2023/08/14 05:25:21 wiz Exp $
# $NetBSD: buildlink3.mk,v 1.3 2024/01/30 20:00:13 adam Exp $
BUILDLINK_TREE+= cmark
@ -6,7 +6,7 @@ BUILDLINK_TREE+= cmark
CMARK_BUILDLINK3_MK:=
BUILDLINK_API_DEPENDS.cmark+= cmark>=0.28.3
BUILDLINK_ABI_DEPENDS.cmark?= cmark>=0.30.3nb1
BUILDLINK_ABI_DEPENDS.cmark+= cmark>=0.30.3nb1
BUILDLINK_PKGSRCDIR.cmark?= ../../textproc/cmark
.endif # CMARK_BUILDLINK3_MK

View File

@ -1,6 +1,5 @@
$NetBSD: distinfo,v 1.12 2023/01/24 08:27:49 adam Exp $
$NetBSD: distinfo,v 1.13 2024/01/30 20:00:13 adam Exp $
BLAKE2s (cmark-0.30.3.tar.gz) = 305d9c9d472c13eb442fb149f3a50fa3e1f1c69829213376a04f24b1456d3fd6
SHA512 (cmark-0.30.3.tar.gz) = 27383bfef95ae1390c26aff0dd2cbca33704e7d20116bf29da4695d2c9a4146b86daba0da1e91bdb9eab95671702f885e832b3d31d51601731f1dc630df5237b
Size (cmark-0.30.3.tar.gz) = 246916 bytes
SHA1 (patch-src_CMakeLists.txt) = 6403931bb8c07738d4e8c0f1fc96db67c04addb4
BLAKE2s (cmark-0.31.0.tar.gz) = bd62fe42325b2f8580cc05c95d7b50e70b1677f41fb4ab77bb3e391febb18f43
SHA512 (cmark-0.31.0.tar.gz) = 768d456147cb8f5cf36e8122213ad053098201e118109a316518a6a5e721ac94f62af29abe1e69120c84bdc227a5c320803ea2cf320c6d9a719d62909b6533bd
Size (cmark-0.31.0.tar.gz) = 251922 bytes

View File

@ -1,23 +0,0 @@
$NetBSD: patch-src_CMakeLists.txt,v 1.2 2021/07/17 16:29:31 adam Exp $
Dynamically link the executable.
--- src/CMakeLists.txt.orig 2021-07-17 01:45:36.000000000 +0000
+++ src/CMakeLists.txt
@@ -57,13 +57,13 @@ cmark_add_compile_options(${PROGRAM})
set_target_properties(${PROGRAM} PROPERTIES
OUTPUT_NAME "cmark")
-if (CMARK_STATIC)
+if (CMARK_SHARED)
+ target_link_libraries(${PROGRAM} ${LIBRARY})
+elseif (CMARK_STATIC)
target_link_libraries(${PROGRAM} ${STATICLIBRARY})
# Disable the PUBLIC declarations when compiling the executable:
set_target_properties(${PROGRAM} PROPERTIES
COMPILE_FLAGS -DCMARK_STATIC_DEFINE)
-elseif (CMARK_SHARED)
- target_link_libraries(${PROGRAM} ${LIBRARY})
endif()
# -fvisibility=hidden