2019-11-02 07:51:08 +08:00
|
|
|
if (VCPKG_TARGET_IS_WINDOWS)
|
2019-05-10 04:52:36 +08:00
|
|
|
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
|
|
|
|
endif()
|
2019-05-03 13:57:43 +08:00
|
|
|
|
2017-09-04 03:44:15 +08:00
|
|
|
vcpkg_from_github(
|
2019-05-10 04:52:36 +08:00
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO google/jsonnet
|
2022-07-20 01:00:08 +08:00
|
|
|
REF v0.18.0
|
|
|
|
SHA512 08a64a4b132df1519292378cef93deb3c60d21636b2a71bce6c13e29cfd93cab465cad77e11f000fb984c5c75a4ca1c92504654fd2e5201343df767ea0e610d1
|
2019-05-10 04:52:36 +08:00
|
|
|
HEAD_REF master
|
|
|
|
PATCHES
|
2019-11-02 07:51:08 +08:00
|
|
|
001-enable-msvc.patch
|
|
|
|
002-fix-dependency-and-install.patch
|
2020-02-04 06:22:52 +08:00
|
|
|
0003-use-upstream-nlohmann-json.patch
|
2021-02-21 13:19:24 +08:00
|
|
|
0004-incorporate-md5.patch
|
2022-07-20 01:00:08 +08:00
|
|
|
0005-use-upstream-rapidyaml.patch
|
2017-09-04 03:44:15 +08:00
|
|
|
)
|
|
|
|
|
2022-07-20 01:00:08 +08:00
|
|
|
# see https://github.com/google/jsonnet/blob/v0.18.0/Makefile#L220
|
2020-02-04 06:22:52 +08:00
|
|
|
if(VCPKG_TARGET_IS_WINDOWS)
|
2020-10-28 11:48:14 +08:00
|
|
|
find_program(PWSH_PATH pwsh)
|
|
|
|
vcpkg_execute_required_process(
|
|
|
|
COMMAND "${PWSH_PATH}" -Command "((Get-Content -AsByteStream \"${SOURCE_PATH}/stdlib/std.jsonnet\") -join ',') + ',0' | Out-File -Encoding Ascii \"${SOURCE_PATH}/core/std.jsonnet.h\""
|
2019-03-30 13:49:05 +08:00
|
|
|
WORKING_DIRECTORY "${SOURCE_PATH}"
|
2019-03-14 02:21:25 +08:00
|
|
|
LOGNAME "std.jsonnet"
|
|
|
|
)
|
|
|
|
else()
|
|
|
|
vcpkg_execute_required_process(
|
2019-03-30 13:49:05 +08:00
|
|
|
COMMAND bash -c "((od -v -Anone -t u1 \"${SOURCE_PATH}/stdlib/std.jsonnet\" | tr ' ' '\\n' | grep -v '^$' | tr '\\n' ',' ) && echo '0') > \"${SOURCE_PATH}/core/std.jsonnet.h\""
|
|
|
|
WORKING_DIRECTORY "${SOURCE_PATH}"
|
2019-03-14 02:21:25 +08:00
|
|
|
LOGNAME "std.jsonnet"
|
|
|
|
)
|
|
|
|
endif()
|
2017-09-04 03:44:15 +08:00
|
|
|
|
2022-09-27 02:35:51 +08:00
|
|
|
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC)
|
|
|
|
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" BUILD_SHARED)
|
2019-11-02 07:51:08 +08:00
|
|
|
|
2021-10-12 11:25:26 +08:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2019-11-02 07:51:08 +08:00
|
|
|
OPTIONS
|
|
|
|
-DBUILD_SHARED_BINARIES=${BUILD_SHARED}
|
|
|
|
-DBUILD_STATIC_LIBS=${BUILD_STATIC}
|
|
|
|
-DBUILD_JSONNET=OFF
|
|
|
|
-DBUILD_JSONNETFMT=OFF
|
|
|
|
-DBUILD_TESTS=OFF
|
2020-02-04 06:22:52 +08:00
|
|
|
-DUSE_SYSTEM_JSON=ON
|
2022-07-20 01:00:08 +08:00
|
|
|
-DUSE_SYSTEM_RYML=ON
|
2017-09-04 03:44:15 +08:00
|
|
|
)
|
|
|
|
|
2021-10-12 11:25:26 +08:00
|
|
|
vcpkg_cmake_install()
|
2017-09-04 03:44:15 +08:00
|
|
|
vcpkg_copy_pdbs()
|
2021-10-12 11:25:26 +08:00
|
|
|
vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/jsonnet")
|
2017-09-04 03:44:15 +08:00
|
|
|
|
2021-10-12 11:25:26 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
2019-11-02 07:51:08 +08:00
|
|
|
|
2021-10-12 11:25:26 +08:00
|
|
|
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|