From b758b9c3599041a79b5cf797fcc6c1b36fde1f81 Mon Sep 17 00:00:00 2001 From: myd7349 Date: Sun, 3 Mar 2019 20:09:01 +0800 Subject: [simdjson] Add new port (fix #5418) --- ports/simdjson/CONTROL | 3 ++ ports/simdjson/fix-cmake.patch | 70 ++++++++++++++++++++++++++++++++++++++++++ ports/simdjson/portfile.cmake | 43 ++++++++++++++++++++++++++ 3 files changed, 116 insertions(+) create mode 100644 ports/simdjson/CONTROL create mode 100644 ports/simdjson/fix-cmake.patch create mode 100644 ports/simdjson/portfile.cmake (limited to 'ports/simdjson') diff --git a/ports/simdjson/CONTROL b/ports/simdjson/CONTROL new file mode 100644 index 000000000..4e7dcae80 --- /dev/null +++ b/ports/simdjson/CONTROL @@ -0,0 +1,3 @@ +Source: simdjson +Version: 2019-03-03 +Description: A extremely fast JSON library that can parse gigabytes of JSON per second diff --git a/ports/simdjson/fix-cmake.patch b/ports/simdjson/fix-cmake.patch new file mode 100644 index 000000000..ebd8291b4 --- /dev/null +++ b/ports/simdjson/fix-cmake.patch @@ -0,0 +1,70 @@ +diff --git a/benchmark/CMakeLists.txt b/benchmark/CMakeLists.txt +index cb12222..ed728d8 100644 +--- a/benchmark/CMakeLists.txt ++++ b/benchmark/CMakeLists.txt +@@ -1,7 +1,6 @@ +-target_include_directories(${SIMDJSON_LIB_NAME} +- PUBLIC +- ${PROJECT_SOURCE_DIR}/benchmark +- ${PROJECT_SOURCE_DIR}/benchmark/linux ++target_include_directories(${SIMDJSON_LIB_NAME} INTERFACE ++ $ ++ $ + ) + + add_cpp_benchmark(parse) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index dd96ee8..20feac3 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -3,6 +3,7 @@ if(${CMAKE_C_COMPILER_ID} MATCHES "Intel") # icc / icpc + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-intel") + endif() + ++include(GNUInstallDirs) + + # we default on a shared library. + if(SIMDJSON_BUILD_STATIC) +@@ -26,11 +27,24 @@ set(SIMDJSON_SRC + ) + + add_library(${SIMDJSON_LIB_NAME} ${SIMDJSON_LIB_TYPE} ${SIMDJSON_SRC}) +-target_include_directories(${SIMDJSON_LIB_NAME} +- PUBLIC ${PROJECT_SOURCE_DIR}/include ++ ++target_include_directories(${SIMDJSON_LIB_NAME} PUBLIC ++ $ ++ $ ++) ++ ++install(TARGETS ${SIMDJSON_LIB_NAME} ++ EXPORT ${SIMDJSON_LIB_NAME}-config ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ) + +-install(TARGETS ${SIMDJSON_LIB_NAME} DESTINATION lib) ++install(EXPORT ${SIMDJSON_LIB_NAME}-config ++ FILE unofficial-${SIMDJSON_LIB_NAME}-config.cmake ++ NAMESPACE unofficial::${SIMDJSON_LIB_NAME}:: ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/unofficial-${SIMDJSON_LIB_NAME} ++) + + if(NOT MSVC) + ## We output the library at the root of the current directory where cmake is invoked +diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt +index 86a89f9..c3dfa12 100644 +--- a/tests/CMakeLists.txt ++++ b/tests/CMakeLists.txt +@@ -1,7 +1,7 @@ + if(MSVC) +-target_include_directories(${SIMDJSON_LIB_NAME} +- PUBLIC ${PROJECT_SOURCE_DIR}/windows +-) ++ target_include_directories(${SIMDJSON_LIB_NAME} INTERFACE ++ $ ++ ) + endif() + + add_cpp_test(jsoncheck) diff --git a/ports/simdjson/portfile.cmake b/ports/simdjson/portfile.cmake new file mode 100644 index 000000000..edf2b24f0 --- /dev/null +++ b/ports/simdjson/portfile.cmake @@ -0,0 +1,43 @@ +include(vcpkg_common_functions) + +if(TARGET_TRIPLET MATCHES "^x86") + message(FATAL_ERROR "simdjson doesn't support x86 architecture.") +endif() + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO lemire/simdjson + REF 352dd5e7faf3000004c6ad5852c119ce3e679939 + SHA512 29c578952d7aa117fe5808ceb2cb686895185d5f53bee3fff6636ac6fe6e50e1cc802499710eda4f233e3c5ff57ebf187ff6658fd5048a59cee8cfd8fca64c1d + HEAD_REF master + PATCHES + fix-cmake.patch +) + +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" SIMDJSON_BUILD_STATIC) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DSIMDJSON_BUILD_STATIC=${SIMDJSON_BUILD_STATIC} +) + +vcpkg_install_cmake() + +vcpkg_copy_pdbs() + +vcpkg_fixup_cmake_targets( + CONFIG_PATH lib/cmake/unofficial-${PORT} + TARGET_PATH share/unofficial-${PORT} +) + +file(REMOVE_RECURSE + ${CURRENT_PACKAGES_DIR}/debug/include +) + +# Handle copyright +configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) + +# CMake integration test +#vcpkg_test_cmake(PACKAGE_NAME ${PORT}) -- cgit v1.2.3 From 4327f4d82cc1e402794b145eb0d95f921277a71c Mon Sep 17 00:00:00 2001 From: myd7349 Date: Tue, 5 Mar 2019 08:23:35 +0800 Subject: [simdjson] Update to 2019-03-05 --- ports/simdjson/CONTROL | 2 +- ports/simdjson/fix-cmake.patch | 70 ------------------------------------------ ports/simdjson/portfile.cmake | 11 ++----- 3 files changed, 4 insertions(+), 79 deletions(-) delete mode 100644 ports/simdjson/fix-cmake.patch (limited to 'ports/simdjson') diff --git a/ports/simdjson/CONTROL b/ports/simdjson/CONTROL index 4e7dcae80..1e41a5144 100644 --- a/ports/simdjson/CONTROL +++ b/ports/simdjson/CONTROL @@ -1,3 +1,3 @@ Source: simdjson -Version: 2019-03-03 +Version: 2019-03-05 Description: A extremely fast JSON library that can parse gigabytes of JSON per second diff --git a/ports/simdjson/fix-cmake.patch b/ports/simdjson/fix-cmake.patch deleted file mode 100644 index ebd8291b4..000000000 --- a/ports/simdjson/fix-cmake.patch +++ /dev/null @@ -1,70 +0,0 @@ -diff --git a/benchmark/CMakeLists.txt b/benchmark/CMakeLists.txt -index cb12222..ed728d8 100644 ---- a/benchmark/CMakeLists.txt -+++ b/benchmark/CMakeLists.txt -@@ -1,7 +1,6 @@ --target_include_directories(${SIMDJSON_LIB_NAME} -- PUBLIC -- ${PROJECT_SOURCE_DIR}/benchmark -- ${PROJECT_SOURCE_DIR}/benchmark/linux -+target_include_directories(${SIMDJSON_LIB_NAME} INTERFACE -+ $ -+ $ - ) - - add_cpp_benchmark(parse) -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index dd96ee8..20feac3 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -3,6 +3,7 @@ if(${CMAKE_C_COMPILER_ID} MATCHES "Intel") # icc / icpc - set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-intel") - endif() - -+include(GNUInstallDirs) - - # we default on a shared library. - if(SIMDJSON_BUILD_STATIC) -@@ -26,11 +27,24 @@ set(SIMDJSON_SRC - ) - - add_library(${SIMDJSON_LIB_NAME} ${SIMDJSON_LIB_TYPE} ${SIMDJSON_SRC}) --target_include_directories(${SIMDJSON_LIB_NAME} -- PUBLIC ${PROJECT_SOURCE_DIR}/include -+ -+target_include_directories(${SIMDJSON_LIB_NAME} PUBLIC -+ $ -+ $ -+) -+ -+install(TARGETS ${SIMDJSON_LIB_NAME} -+ EXPORT ${SIMDJSON_LIB_NAME}-config -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - ) - --install(TARGETS ${SIMDJSON_LIB_NAME} DESTINATION lib) -+install(EXPORT ${SIMDJSON_LIB_NAME}-config -+ FILE unofficial-${SIMDJSON_LIB_NAME}-config.cmake -+ NAMESPACE unofficial::${SIMDJSON_LIB_NAME}:: -+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/unofficial-${SIMDJSON_LIB_NAME} -+) - - if(NOT MSVC) - ## We output the library at the root of the current directory where cmake is invoked -diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt -index 86a89f9..c3dfa12 100644 ---- a/tests/CMakeLists.txt -+++ b/tests/CMakeLists.txt -@@ -1,7 +1,7 @@ - if(MSVC) --target_include_directories(${SIMDJSON_LIB_NAME} -- PUBLIC ${PROJECT_SOURCE_DIR}/windows --) -+ target_include_directories(${SIMDJSON_LIB_NAME} INTERFACE -+ $ -+ ) - endif() - - add_cpp_test(jsoncheck) diff --git a/ports/simdjson/portfile.cmake b/ports/simdjson/portfile.cmake index edf2b24f0..7c04a66c4 100644 --- a/ports/simdjson/portfile.cmake +++ b/ports/simdjson/portfile.cmake @@ -7,11 +7,9 @@ endif() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO lemire/simdjson - REF 352dd5e7faf3000004c6ad5852c119ce3e679939 - SHA512 29c578952d7aa117fe5808ceb2cb686895185d5f53bee3fff6636ac6fe6e50e1cc802499710eda4f233e3c5ff57ebf187ff6658fd5048a59cee8cfd8fca64c1d + REF 5040840578de7eb5c80c0250585d03b2f096a4ff + SHA512 be1d07b12a6ed2fdd61862cf8f049209467f1cfd40ad4a73d4da9a31147b83f1e60fc205b64bb311e15fa97432a42aad8a6e3eb5aa0dcc8a0c3afb47b55b6aac HEAD_REF master - PATCHES - fix-cmake.patch ) string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" SIMDJSON_BUILD_STATIC) @@ -27,10 +25,7 @@ vcpkg_install_cmake() vcpkg_copy_pdbs() -vcpkg_fixup_cmake_targets( - CONFIG_PATH lib/cmake/unofficial-${PORT} - TARGET_PATH share/unofficial-${PORT} -) +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/${PORT}) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include -- cgit v1.2.3 From 0d7f4c1b89a13b4548b1b9329019545661596e8c Mon Sep 17 00:00:00 2001 From: myd7349 Date: Fri, 8 Mar 2019 10:22:44 +0800 Subject: [simdjson] Update to 2019-03-09 (fix UWP build) --- ports/simdjson/CONTROL | 2 +- ports/simdjson/portfile.cmake | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'ports/simdjson') diff --git a/ports/simdjson/CONTROL b/ports/simdjson/CONTROL index 1e41a5144..8c71eeee5 100644 --- a/ports/simdjson/CONTROL +++ b/ports/simdjson/CONTROL @@ -1,3 +1,3 @@ Source: simdjson -Version: 2019-03-05 +Version: 2019-03-09 Description: A extremely fast JSON library that can parse gigabytes of JSON per second diff --git a/ports/simdjson/portfile.cmake b/ports/simdjson/portfile.cmake index 7c04a66c4..f6b2f347a 100644 --- a/ports/simdjson/portfile.cmake +++ b/ports/simdjson/portfile.cmake @@ -1,14 +1,17 @@ include(vcpkg_common_functions) -if(TARGET_TRIPLET MATCHES "^x86") - message(FATAL_ERROR "simdjson doesn't support x86 architecture.") +# https://github.com/Microsoft/vcpkg/issues/5418#issuecomment-470519894 +if(TARGET_TRIPLET MATCHES "^(x86|arm-)") + message(FATAL_ERROR "simdjson doesn't support x86 or 32-bit ARM architecture.") +elseif(TARGET_TRIPLET MATCHES "^arm64") + message(FATAL_ERROR "simdjson doesn't support ARM64 architecture currently.") endif() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO lemire/simdjson - REF 5040840578de7eb5c80c0250585d03b2f096a4ff - SHA512 be1d07b12a6ed2fdd61862cf8f049209467f1cfd40ad4a73d4da9a31147b83f1e60fc205b64bb311e15fa97432a42aad8a6e3eb5aa0dcc8a0c3afb47b55b6aac + REF d2fa086198b77df44e7fa48b25200e118fa81eb0 + SHA512 fe92b65e44502381d286b6a7c949055d185e56e7c244a5ab3086b2fe7da76ce81a966daa2d8459794ff0a911b426b1c77e1fc9ef0d616e20868621b1bb30cf67 HEAD_REF master ) -- cgit v1.2.3