[cmark] update to 0.30.1 (#18938)

* [cmark] update to 0.30.0

* update version

* update portfile.cmake

* update version

* add patch

* update version

* fix-uwp-APPX0703

* update version

* [cmark] update to 0.30.1

* update version

* update portfile.cmake

* update version

* update version

* Add feature tools

* version stuff

* Add feature tools and remove the old unnecessary patch

* version

* delete outdate option

* update version

Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
Co-authored-by: JackBoosY <yuzaiyang@beyondsoft.com>
This commit is contained in:
JonLiu1993 2021-09-16 05:12:57 +08:00 committed by GitHub
parent d95314bccc
commit 790418c903
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 104 additions and 36 deletions

View File

@ -0,0 +1,54 @@
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 3a78d0b..7065c89 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -52,6 +52,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmark_version.h.in
include(GNUInstallDirs)
include (GenerateExportHeader)
+if (BUILD_TOOLS)
add_executable(${PROGRAM} ${PROGRAM_SOURCES})
cmark_add_compile_options(${PROGRAM})
set_target_properties(${PROGRAM} PROPERTIES
@@ -65,6 +66,7 @@ if (CMARK_STATIC)
elseif (CMARK_SHARED)
target_link_libraries(${PROGRAM} ${LIBRARY})
endif()
+endif()
# -fvisibility=hidden
set(CMAKE_C_VISIBILITY_PRESET hidden)
@@ -114,23 +116,30 @@ if (CMARK_STATIC)
list(APPEND CMARK_INSTALL ${STATICLIBRARY})
endif()
-if (MSVC)
+if (MSVC AND BUILD_TOOLS)
set_property(TARGET ${PROGRAM}
APPEND PROPERTY LINK_FLAGS /INCREMENTAL:NO)
-endif(MSVC)
+endif(MSVC AND BUILD_TOOLS)
if(NOT MSVC OR CMAKE_HOST_SYSTEM_NAME STREQUAL Windows)
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
include(InstallRequiredSystemLibraries)
endif()
-install(TARGETS ${PROGRAM} ${CMARK_INSTALL}
+install(TARGETS ${CMARK_INSTALL}
EXPORT cmark-targets
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
+if (BUILD_TOOLS)
+ install(TARGETS ${PROGRAM}
+ EXPORT cmark-targets
+ RUNTIME DESTINATION tools/cmark
+ )
+endif()
+
if(CMARK_SHARED OR CMARK_STATIC)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libcmark.pc.in
${CMAKE_CURRENT_BINARY_DIR}/libcmark.pc @ONLY)

View File

@ -1,42 +1,48 @@
vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO commonmark/cmark
REF 0.29.0
SHA512 06eb110cfd90c9e980c022b7588e28864d15a4da5d07d61ad4b27c6de47367492b9e58e9434e62b07517aa6dc484f17af13916808be3188f38c37d20cbf33112
REF 977b128291c0cf6c5053cdcf2ac72e627f09c105 #0.30.1
SHA512 ff8139fbb45549d6bea70e11c35ae1d8cf6108d0141688cc2b878afa6247147e0c15ac885e6ed8fa2263534dc79e88e398b30d3d3ae800f13dcdd878114adac8
HEAD_REF master
PATCHES
"${CMAKE_CURRENT_LIST_DIR}/rename-shared-lib.patch"
add-feature-tools.patch
)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" CMARK_STATIC)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" CMARK_SHARED)
vcpkg_configure_cmake(
if ("tools" IN_LIST FEATURES AND VCPKG_TARGET_IS_UWP)
message(FATAL_ERROR "${PORT} does no support to build tools on UWP")
endif()
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
tools BUILD_TOOLS
)
vcpkg_cmake_configure(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
${FEATURE_OPTIONS}
-DCMARK_TESTS=OFF
-DCMARK_SHARED=${CMARK_SHARED}
-DCMARK_STATIC=${CMARK_STATIC}
)
vcpkg_install_cmake()
vcpkg_cmake_install()
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake)
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/cmark)
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/cmark RENAME copyright)
vcpkg_fixup_pkgconfig()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share)
if(EXISTS ${CURRENT_PACKAGES_DIR}/bin/cmark.exe)
file(COPY ${CURRENT_PACKAGES_DIR}/bin/cmark.exe DESTINATION ${CURRENT_PACKAGES_DIR}/tools/cmark/)
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/cmark)
if ("tools" IN_LIST FEATURES)
vcpkg_copy_tools(TOOL_NAMES cmark SEARCH_DIR "${CURRENT_PACKAGES_DIR}/tools/cmark" AUTO_CLEAN)
endif()
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static" AND NOT EXISTS ${CURRENT_PACKAGES_DIR}/bin/cmark)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
else()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/cmark.exe ${CURRENT_PACKAGES_DIR}/debug/bin/cmark.exe)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share")
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
endif()
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

View File

@ -1,12 +0,0 @@
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index d5a1936..acff569 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -83,7 +83,6 @@ if (CMARK_SHARED)
add_library(${LIBRARY} SHARED ${LIBRARY_SOURCES})
# Include minor version and patch level in soname for now.
set_target_properties(${LIBRARY} PROPERTIES
- OUTPUT_NAME "cmark"
SOVERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}
VERSION ${PROJECT_VERSION})

View File

@ -1,6 +1,21 @@
{
"name": "cmark",
"version-string": "0.29.0",
"port-version": 1,
"description": "CommonMark parsing and rendering library"
"version-semver": "0.30.1",
"description": "CommonMark parsing and rendering library",
"homepage": "https://github.com/commonmark/cmark",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
],
"features": {
"tools": {
"description": "Build tools"
}
}
}

View File

@ -1385,8 +1385,8 @@
"port-version": 1
},
"cmark": {
"baseline": "0.29.0",
"port-version": 1
"baseline": "0.30.1",
"port-version": 0
},
"cmcstl2": {
"baseline": "2019-07-20",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "63d8e9056589a885ec4a36ba739903199206fff1",
"version-semver": "0.30.1",
"port-version": 0
},
{
"git-tree": "0cda97dbc7324b408739f53f493316af44dcaaf6",
"version-string": "0.29.0",