[ryml] Add new port (#10793)

* [ryml] Add new port

* Remove deprecated include

* Fix ver regarding maintainer guide

* Mark port as unsupport arm/arm64/osx

* Update CI baseline

* Replace deprecated func vcpkg_extract_source_archive,
add PREFER_NINJA to conf

* Fix wrong placed port states

* Resolve merge conflict
This commit is contained in:
vvandrounik 2020-04-23 23:43:38 +03:00 committed by GitHub
parent cc906546f4
commit a0126a86e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 113 additions and 0 deletions

6
ports/ryml/CONTROL Normal file
View File

@ -0,0 +1,6 @@
Source: ryml
Version: 2020-04-12
Homepage: https://github.com/biojppm/rapidyaml
Description: Rapid YAML library
Build-Depends: c4core[core]
Supports: !(arm|arm64|osx)

View File

@ -0,0 +1,34 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3e4eb23..115b8aa 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,5 @@
cmake_minimum_required(VERSION 3.9)
+
project(ryml)
include(./ext/c4core/cmake/c4Project.cmake)
@@ -19,8 +20,7 @@ option(RYML_BUILD_API "Enable API generation (python, etc)" OFF)
#-------------------------------------------------------
-c4_require_subproject(c4core INCORPORATE
- SUBDIRECTORY ${RYML_EXT_DIR}/c4core)
+find_package(c4core CONFIG REQUIRED)
c4_add_library(ryml
SOURCES
@@ -46,10 +46,10 @@ c4_add_library(ryml
ryml.natvis
SOURCE_ROOT ${RYML_SRC_DIR}
INC_DIRS
+ $<BUILD_INTERFACE:${C4CORE_INCLUDE_DIR}>
$<BUILD_INTERFACE:${RYML_SRC_DIR}>
$<INSTALL_INTERFACE:include>
- LIBS c4core
- INCORPORATE c4core
+ LIBS c4core::c4core
)
if(NOT RYML_DEFAULT_CALLBACKS)

70
ports/ryml/portfile.cmake Normal file
View File

@ -0,0 +1,70 @@
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_fail_port_install(
ON_ARCH "arm" "arm64"
ON_TARGET "OSX"
)
# Get rapidyaml src
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO biojppm/rapidyaml
REF ec23e87007ccc39c6132345c154b267de9381706
SHA512 7d349c0dd58da814dad02de88a5c54394ef8d77e7db3014fb5fb684d519e35604d45f5d16db5ed6ed8ccb52b1ed4a4dbc91e717a091b54b04dc18901800e12c1
HEAD_REF master
PATCHES cmake-fix.patch
)
set(COMMIT_HASH a0f0c17bfc9a9a91cc72891539b513c129c6d122)
# Get cmake scripts for rapidyaml
vcpkg_download_distfile(CMAKE_ARCHIVE
URLS "https://github.com/biojppm/cmake/archive/${COMMIT_HASH}.zip"
FILENAME "cmake-${COMMIT_HASH}.zip"
SHA512 4fbc711f3120501fa40733c3b66e34cd6a7e1b598b1378fbb59d1a87c88290a03d021f5176634089da41682fd918d7e27c6c146052dec54d7e956be15f12744f
)
vcpkg_extract_source_archive_ex(
OUT_SOURCE_PATH SOURCE_PATH_CMAKE
ARCHIVE ${CMAKE_ARCHIVE}
WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/src/deps"
)
file(REMOVE_RECURSE "${SOURCE_PATH}/ext/c4core/cmake")
file(RENAME ${SOURCE_PATH_CMAKE} "${SOURCE_PATH}/ext/c4core/cmake")
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
)
vcpkg_install_cmake()
vcpkg_copy_pdbs()
if(EXISTS ${CURRENT_PACKAGES_DIR}/cmake)
vcpkg_fixup_cmake_targets(CONFIG_PATH cmake)
elseif(EXISTS ${CURRENT_PACKAGES_DIR}/lib/cmake/ryml)
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/ryml)
endif()
# Move headers and natvis to own dir
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/include/ryml")
file(RENAME "${CURRENT_PACKAGES_DIR}/include/ryml.hpp" "${CURRENT_PACKAGES_DIR}/include/ryml/ryml.hpp")
file(RENAME "${CURRENT_PACKAGES_DIR}/include/ryml_std.hpp" "${CURRENT_PACKAGES_DIR}/include/ryml/ryml_std.hpp")
file(RENAME "${CURRENT_PACKAGES_DIR}/include/ryml.natvis" "${CURRENT_PACKAGES_DIR}/include/ryml/ryml.natvis")
# Fix paths in headers file
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/ryml/ryml.hpp" "./c4" "../c4")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/ryml/ryml_std.hpp" "./c4" "../c4")
# Fix paths in config file
file(READ "${CURRENT_PACKAGES_DIR}/share/ryml/rymlConfig.cmake" _contents)
string(REGEX REPLACE [[[ \t\r\n]*"\${PACKAGE_PREFIX_DIR}[\./\\]*"]] [["${PACKAGE_PREFIX_DIR}/../.."]] _contents "${_contents}")
file(WRITE "${CURRENT_PACKAGES_DIR}/share/ryml/rymlConfig.cmake" "${_contents}")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(INSTALL
"${SOURCE_PATH}/LICENSE.txt"
DESTINATION "${CURRENT_PACKAGES_DIR}/share/ryml" RENAME copyright)

View File

@ -1591,6 +1591,9 @@ rttr:arm-uwp=fail
rttr:x64-uwp=fail
rxspencer:x64-uwp=fail
rxspencer:arm-uwp=fail
ryml:arm-uwp=fail
ryml:arm64-windows=fail
ryml:x64-osx=fail
ryu:arm-uwp=fail
ryu:x64-uwp=fail
ryu:x64-windows-static=fail