aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/xeus
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/xeus')
-rw-r--r--vcpkg/ports/xeus/Fix-Compile-nlohmann-json.patch12
-rw-r--r--vcpkg/ports/xeus/portfile.cmake55
-rw-r--r--vcpkg/ports/xeus/usage4
-rw-r--r--vcpkg/ports/xeus/vcpkg-cmake-wrapper.cmake9
-rw-r--r--vcpkg/ports/xeus/vcpkg.json27
5 files changed, 107 insertions, 0 deletions
diff --git a/vcpkg/ports/xeus/Fix-Compile-nlohmann-json.patch b/vcpkg/ports/xeus/Fix-Compile-nlohmann-json.patch
new file mode 100644
index 0000000..463c091
--- /dev/null
+++ b/vcpkg/ports/xeus/Fix-Compile-nlohmann-json.patch
@@ -0,0 +1,12 @@
+diff --git a/src/xmessage.cpp b/src/xmessage.cpp
+index 1ab9544..5a14ba0 100644
+--- a/src/xmessage.cpp
++++ b/src/xmessage.cpp
+@@ -13,6 +13,7 @@
+ #include <sstream>
+ #include <string>
+ #include <utility>
++#include <ciso646>
+
+ #include "nlohmann/json.hpp"
+
diff --git a/vcpkg/ports/xeus/portfile.cmake b/vcpkg/ports/xeus/portfile.cmake
new file mode 100644
index 0000000..95dafc2
--- /dev/null
+++ b/vcpkg/ports/xeus/portfile.cmake
@@ -0,0 +1,55 @@
+vcpkg_download_distfile(REMOVE_LTO_PATCH
+ URLS https://github.com/jupyter-xeus/xeus/commit/2dcccb574713f81b7d69baed2bd543bf6798f671.diff?full_index=1
+ FILENAME xeus-remove-lto-2dcccb574713f81b7d69baed2bd543bf6798f671.diff
+ SHA512 e0ae94825cb606dcd250394aee5c88e23bd5440a38c9f4cd8059590ec01dc1ec751ab0bb413788439dfbbfb2c28c68a82cb56efa11d05c3a2d63d420876e1e0b
+)
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO QuantStack/xeus
+ REF 0f6327a2782181e7ded9729abb32b7d8eb690aea # 0.24.3
+ SHA512 2c0ccd1bebf487a9a73e73ecfb74b7605756652b2a84c71e739d7b2d8923960594c025e36d75cec850c5f0e38614a20299feccea6cfbe9ea0f66bdf315af02b4
+ HEAD_REF master
+ PATCHES
+ Fix-Compile-nlohmann-json.patch
+ "${REMOVE_LTO_PATCH}"
+)
+
+string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC_LIBS)
+string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" BUILD_SHARED_LIBS)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ -DBUILD_EXAMPLES=OFF
+ -DXEUS_BUILD_STATIC_LIBS=${BUILD_STATIC_LIBS}
+ -DXEUS_BUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}
+ -DBUILD_TESTS=OFF
+ -DDOWNLOAD_GTEST=OFF
+ -DDISABLE_ARCH_NATIVE=OFF
+ -DXEUS_DISABLE_ARCH_NATIVE=On
+)
+
+vcpkg_cmake_install()
+
+vcpkg_copy_pdbs()
+
+vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/${PORT})
+
+file(COPY "${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share")
+
+if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
+ vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/xeus/xeus.hpp
+ "#ifdef XEUS_STATIC_LIB"
+ "#if 1 // #ifdef XEUS_STATIC_LIB"
+ )
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
+endif()
+
+# Handle copyright
+file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
+
+# Install usage
+file(COPY "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
diff --git a/vcpkg/ports/xeus/usage b/vcpkg/ports/xeus/usage
new file mode 100644
index 0000000..1f95980
--- /dev/null
+++ b/vcpkg/ports/xeus/usage
@@ -0,0 +1,4 @@
+The package xeus provides CMake targets:
+
+ find_package(xeus CONFIG REQUIRED)
+ target_link_libraries(main PRIVATE xeus xeus_static)
diff --git a/vcpkg/ports/xeus/vcpkg-cmake-wrapper.cmake b/vcpkg/ports/xeus/vcpkg-cmake-wrapper.cmake
new file mode 100644
index 0000000..62a3cc7
--- /dev/null
+++ b/vcpkg/ports/xeus/vcpkg-cmake-wrapper.cmake
@@ -0,0 +1,9 @@
+_find_package(${ARGS})
+
+if(TARGET xeus AND NOT TARGET xeus_static)
+ add_library(xeus_static INTERFACE IMPORTED)
+ set_target_properties(xeus_static PROPERTIES INTERFACE_LINK_LIBRARIES xeus)
+elseif(TARGET xeus_static AND NOT TARGET xeus)
+ add_library(xeus INTERFACE IMPORTED)
+ set_target_properties(xeus PROPERTIES INTERFACE_LINK_LIBRARIES xeus_static)
+endif()
diff --git a/vcpkg/ports/xeus/vcpkg.json b/vcpkg/ports/xeus/vcpkg.json
new file mode 100644
index 0000000..0c8bba0
--- /dev/null
+++ b/vcpkg/ports/xeus/vcpkg.json
@@ -0,0 +1,27 @@
+{
+ "name": "xeus",
+ "version": "0.24.3",
+ "port-version": 4,
+ "description": "C++ implementation of the Jupyter kernel protocol",
+ "homepage": "https://github.com/jupyter-xeus/xeus",
+ "license": "BSD-3-Clause",
+ "dependencies": [
+ "cppzmq",
+ {
+ "name": "libuuid",
+ "platform": "!windows & !osx"
+ },
+ "nlohmann-json",
+ "openssl",
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ },
+ "xtl",
+ "zeromq"
+ ]
+}