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
|
2019-11-02 07:51:08 +08:00
|
|
|
REF 552d8ec6f6b973a6357b83eb9bacd707366d28f0 # v0.14.0
|
|
|
|
SHA512 a4a9c6285155addbc5b7ef1a0c02b99b4d941bfc8e6536eaf029bff77c9c303a5c36f654ca8ab6b9757d2710c100c3e4a05f310269d82b0385ae55ea6ead14ef
|
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
|
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
|
|
|
|
2019-11-02 07:51:08 +08:00
|
|
|
if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
|
|
|
|
set(BUILD_SHARED ON)
|
|
|
|
set(BUILD_STATIC OFF)
|
|
|
|
else()
|
|
|
|
set(BUILD_SHARED OFF)
|
|
|
|
set(BUILD_STATIC ON)
|
|
|
|
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-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
|
2017-09-04 03:44:15 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_install_cmake()
|
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/jsonnet)
|
|
|
|
|
2019-05-10 04:52:36 +08:00
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
2019-11-02 07:51:08 +08:00
|
|
|
|
|
|
|
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|