aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefano Sinigardi <stesinigardi@hotmail.com>2019-03-22 18:35:55 +0100
committerStefano Sinigardi <stesinigardi@hotmail.com>2019-03-22 18:35:55 +0100
commit9ee3215f9400755b593935ca50a2f5eaad31ad9e (patch)
tree9bae014f4cbe6a5891ce3db16dec8606f384f7cb
parent3d2db597ce17afc9308c515ef0ce3de7ddf2ffe1 (diff)
downloadvcpkg-9ee3215f9400755b593935ca50a2f5eaad31ad9e.tar.gz
vcpkg-9ee3215f9400755b593935ca50a2f5eaad31ad9e.zip
[open62541] new port
-rw-r--r--ports/open62541/CONTROL3
-rw-r--r--ports/open62541/fix_runtime_destination.patch30
-rw-r--r--ports/open62541/portfile.cmake61
3 files changed, 94 insertions, 0 deletions
diff --git a/ports/open62541/CONTROL b/ports/open62541/CONTROL
new file mode 100644
index 000000000..ba51acb5d
--- /dev/null
+++ b/ports/open62541/CONTROL
@@ -0,0 +1,3 @@
+Source: open62541
+Version:
+Description:
diff --git a/ports/open62541/fix_runtime_destination.patch b/ports/open62541/fix_runtime_destination.patch
new file mode 100644
index 000000000..2ac967795
--- /dev/null
+++ b/ports/open62541/fix_runtime_destination.patch
@@ -0,0 +1,30 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 64b9a96..8e66848 100755
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -806,14 +806,14 @@ install(TARGETS open62541
+ EXPORT open62541Targets
+ LIBRARY DESTINATION ${LIB_INSTALL_DIR}
+ ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
+- RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}
++ RUNTIME DESTINATION ${BIN_INSTALL_DIR}
+ INCLUDES DESTINATION include/open62541 include)
+ else()
+ install(TARGETS open62541
+ EXPORT open62541Targets
+ LIBRARY DESTINATION ${LIB_INSTALL_DIR}
+ ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
+- RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}
++ RUNTIME DESTINATION ${BIN_INSTALL_DIR}
+ INCLUDES DESTINATION include)
+ endif()
+
+@@ -868,7 +868,7 @@ if(NOT UA_ENABLE_AMALGAMATION)
+ ${historizing_default_plugin_headers}
+ DESTINATION ${open62541_install_include_dir})
+ else()
+- # Export amalgamated header open62541.h which is generated due to build of
++ # Export amalgamated header open62541.h which is generated due to build of
+ # open62541-object
+ install(FILES ${PROJECT_BINARY_DIR}/open62541.h DESTINATION include)
+ endif()
diff --git a/ports/open62541/portfile.cmake b/ports/open62541/portfile.cmake
new file mode 100644
index 000000000..8f44fd7d4
--- /dev/null
+++ b/ports/open62541/portfile.cmake
@@ -0,0 +1,61 @@
+include(vcpkg_common_functions)
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO open62541/open62541
+ REF v0.3.0
+ SHA512 67766d226e1b900c0c37309099ecdbe987d10888ebf43f9066b21cf79f64d34e6ac30c2671a4901892f044859da4e8dbaa9fed5a49c633f73fef3bec75774050
+ HEAD_REF master
+)
+
+file(READ ${SOURCE_PATH}/CMakeLists.txt OPEN62541_CMAKELISTS)
+string(REPLACE
+ "RUNTIME DESTINATION \${CMAKE_INSTALL_PREFIX}"
+ "RUNTIME DESTINATION \${BIN_INSTALL_DIR}"
+ OPEN62541_CMAKELISTS "${OPEN62541_CMAKELISTS}")
+file(WRITE ${SOURCE_PATH}/CMakeLists.txt "${OPEN62541_CMAKELISTS}")
+
+if(CMAKE_HOST_WIN32)
+ set(EXECUTABLE_SUFFIX ".exe")
+else()
+ set(EXECUTABLE_SUFFIX "")
+endif()
+
+vcpkg_find_acquire_program(PYTHON3)
+get_filename_component(PYTHON3_DIR "${PYTHON3}" DIRECTORY)
+vcpkg_add_to_path("${PYTHON3_DIR}")
+if(NOT EXISTS ${PYTHON3_DIR}/easy_install${EXECUTABLE_SUFFIX})
+ if(NOT EXISTS ${PYTHON3_DIR}/Scripts/pip${EXECUTABLE_SUFFIX})
+ vcpkg_download_distfile(GET_PIP
+ URLS "https://bootstrap.pypa.io/get-pip.py"
+ FILENAME "tools/python/python3/get-pip.py"
+ SHA512 fdbcef1037dca7cc914e2304af657ebd08239cd18c3e79786dc25c8ea39957674e012d7ea8ae2c99006e4b61d3a5e24669ac5771dc186697fd9fdb40b6cc07ae
+ )
+ execute_process(COMMAND ${PYTHON3_DIR}/python${EXECUTABLE_SUFFIX} ${PYTHON3_DIR}/get-pip.py)
+ endif()
+ execute_process(COMMAND ${PYTHON3_DIR}/Scripts/pip${EXECUTABLE_SUFFIX} install six)
+else()
+ execute_process(COMMAND ${PYTHON3_DIR}/easy_install${EXECUTABLE_SUFFIX} six)
+endif()
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA
+ OPTIONS_DEBUG
+ -DCMAKE_DEBUG_POSTFIX=d
+)
+
+vcpkg_install_cmake()
+
+if(EXISTS ${CURRENT_PACKAGES_DIR}/lib/cmake/${PORT})
+ vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/${PORT})
+else()
+ vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake)
+endif()
+
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/open62541/tools)
+
+file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/open62541)
+file(RENAME ${CURRENT_PACKAGES_DIR}/share/open62541/LICENSE ${CURRENT_PACKAGES_DIR}/share/open62541/copyright)