2017-09-04 03:44:15 +08:00
|
|
|
include(vcpkg_common_functions)
|
|
|
|
|
2019-05-10 04:52:36 +08:00
|
|
|
if (VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" OR NOT VCPKG_CMAKE_SYSTEM_NAME)
|
|
|
|
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
|
2019-08-19 23:55:29 +08:00
|
|
|
REF v0.13.0
|
|
|
|
SHA512 d19e5398763e37b79b0ef02368f6bd6215d2df234b5ff7a6d98e2306a0d47290600061c9f868c0c262570b4f0ee9eee6c309bcc93937b12f6c14f8d12339a7d5
|
2019-05-10 04:52:36 +08:00
|
|
|
HEAD_REF master
|
|
|
|
PATCHES
|
2019-07-23 16:46:36 +08:00
|
|
|
001-enable-msvc.patch
|
2017-09-04 03:44:15 +08:00
|
|
|
)
|
|
|
|
|
2019-08-19 23:55:29 +08:00
|
|
|
if (VCPKG_TARGET_IS_WINDOWS)
|
|
|
|
vcpkg_execute_required_process(
|
2019-07-23 16:46:36 +08:00
|
|
|
COMMAND Powershell -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
|
|
|
|
|
|
|
vcpkg_configure_cmake(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
2019-05-10 04:52:36 +08:00
|
|
|
PREFER_NINJA
|
2019-07-23 16:46:36 +08:00
|
|
|
OPTIONS -DBUILD_JSONNET=OFF -DBUILD_JSONNETFMT=OFF -DBUILD_TESTS=OFF
|
2017-09-04 03:44:15 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_install_cmake()
|
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/jsonnet)
|
|
|
|
|
|
|
|
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/jsonnet RENAME copyright)
|
2019-05-10 04:52:36 +08:00
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|