aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio <silvio.traversaro@iit.it>2017-03-19 18:06:05 +0100
committerSilvio <silvio.traversaro@iit.it>2017-03-19 18:06:05 +0100
commit391e10fd2d54e893abaf7043f551be09a36f2ff8 (patch)
tree16944bac4d1928dd3fb3b1ab99a3143827db6c47
parentc433841ef5bcb42b460b95b48c2d425ebd746e1a (diff)
downloadvcpkg-391e10fd2d54e893abaf7043f551be09a36f2ff8.tar.gz
vcpkg-391e10fd2d54e893abaf7043f551be09a36f2ff8.zip
Add dlfcn-win32 port
-rw-r--r--ports/dlfcn-win32/CONTROL3
-rw-r--r--ports/dlfcn-win32/portfile.cmake39
2 files changed, 42 insertions, 0 deletions
diff --git a/ports/dlfcn-win32/CONTROL b/ports/dlfcn-win32/CONTROL
new file mode 100644
index 000000000..198cdbeb7
--- /dev/null
+++ b/ports/dlfcn-win32/CONTROL
@@ -0,0 +1,3 @@
+Source: dlfcn-win32
+Version: 1.1.0
+Description: dlfcn-win32 is an implementation of dlfcn for Windows.
diff --git a/ports/dlfcn-win32/portfile.cmake b/ports/dlfcn-win32/portfile.cmake
new file mode 100644
index 000000000..498d31894
--- /dev/null
+++ b/ports/dlfcn-win32/portfile.cmake
@@ -0,0 +1,39 @@
+# Common Ambient Variables:
+# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT}
+# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET}
+# CURRENT_PORT DIR = ${VCPKG_ROOT_DIR}\ports\${PORT}
+# PORT = current port name (zlib, etc)
+# TARGET_TRIPLET = current triplet (x86-windows, x64-windows-static, etc)
+# VCPKG_CRT_LINKAGE = C runtime linkage type (static, dynamic)
+# VCPKG_LIBRARY_LINKAGE = target library linkage type (static, dynamic)
+# VCPKG_ROOT_DIR = <C:\path\to\current\vcpkg>
+# VCPKG_TARGET_ARCHITECTURE = target architecture (x64, x86, arm)
+#
+
+include(vcpkg_common_functions)
+set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/dlfcn-win32-1.1.0)
+vcpkg_download_distfile(ARCHIVE
+ URLS "https://github.com/dlfcn-win32/dlfcn-win32/archive/v1.1.0.zip"
+ FILENAME "dlfcn-win32-v1.1.0.zip"
+ SHA512 7ce1d62a3ea927f8ab56c335e975172c5eb0f465b8ba92f1cf1548638ad431214a644da18e1f733e8b9631cb89c277f06ca4d08f87726d5c04c8aa21dee1510f
+)
+vcpkg_extract_source_archive(${ARCHIVE})
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+)
+
+vcpkg_install_cmake()
+
+file(READ ${CURRENT_PACKAGES_DIR}/debug/share/dlfcn-win32/dlfcn-win32-targets-debug.cmake dlfcn-win32_DEBUG_MODULE)
+string(REPLACE "\${_IMPORT_PREFIX}" "\${_IMPORT_PREFIX}/debug" dlfcn-win32_DEBUG_MODULE "${dlfcn-win32_DEBUG_MODULE}")
+file(WRITE ${CURRENT_PACKAGES_DIR}/share/dlfcn-win32/dlfcn-win32-targets-debug.cmake "${dlfcn-win32_DEBUG_MODULE}")
+
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
+
+vcpkg_copy_pdbs()
+
+# Handle copyright
+file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/dlfcn-win32)
+file(RENAME ${CURRENT_PACKAGES_DIR}/share/dlfcn-win32/COPYING ${CURRENT_PACKAGES_DIR}/share/dlfcn-win32/copyright)