aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/ois
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/ois')
-rw-r--r--vcpkg/ports/ois/0001_install_pkgconfig_win32.patch29
-rw-r--r--vcpkg/ports/ois/0002-fix-cmake4.patch14
-rw-r--r--vcpkg/ports/ois/portfile.cmake29
-rw-r--r--vcpkg/ports/ois/vcpkg.json15
4 files changed, 87 insertions, 0 deletions
diff --git a/vcpkg/ports/ois/0001_install_pkgconfig_win32.patch b/vcpkg/ports/ois/0001_install_pkgconfig_win32.patch
new file mode 100644
index 0000000..2568e3f
--- /dev/null
+++ b/vcpkg/ports/ois/0001_install_pkgconfig_win32.patch
@@ -0,0 +1,29 @@
+diff -Naur a/CMakeLists.txt b/CMakeLists.txt
+--- a/CMakeLists.txt 2021-05-14 03:09:42.000000000 +0800
++++ b/CMakeLists.txt 2022-03-08 12:48:17.012589000 +0800
+@@ -255,7 +255,12 @@
+ install(FILES $<TARGET_PDB_FILE:OIS> DESTINATION bin OPTIONAL)
+ endif(MSVC AND BUILD_SHARED_LIBS)
+
+-if(UNIX)
+- configure_file(${CMAKE_CURRENT_SOURCE_DIR}/OIS.pc.in ${CMAKE_BINARY_DIR}/OIS.pc @ONLY)
+- install(FILES ${CMAKE_BINARY_DIR}/OIS.pc DESTINATION ${OIS_LIB_DIRECTORY}/pkgconfig)
++if (CMAKE_DEBUG_POSTFIX AND CMAKE_BUILD_TYPE STREQUAL "Debug")
++ set(OIS_POSTFIX ${CMAKE_DEBUG_POSTFIX})
++else()
++ set(OIS_POSTFIX "")
+ endif()
++
++configure_file(${CMAKE_CURRENT_SOURCE_DIR}/OIS.pc.in ${CMAKE_BINARY_DIR}/OIS.pc @ONLY)
++install(FILES ${CMAKE_BINARY_DIR}/OIS.pc DESTINATION ${OIS_LIB_DIRECTORY}/pkgconfig)
++
+diff -Naur a/OIS.pc.in b/OIS.pc.in
+--- a/OIS.pc.in 2021-05-14 03:09:42.000000000 +0800
++++ b/OIS.pc.in 2022-03-08 12:48:33.599696300 +0800
+@@ -6,5 +6,5 @@
+ Name: OIS
+ Description: Cross platform C++ Input Framework
+ Version: @OIS_VERSION@
+-Libs: -L${libdir} -lOIS
++Libs: -L${libdir} -lOIS@OIS_POSTFIX@
+ Cflags: -I${includedir} -I${includedir}/ois
diff --git a/vcpkg/ports/ois/0002-fix-cmake4.patch b/vcpkg/ports/ois/0002-fix-cmake4.patch
new file mode 100644
index 0000000..55c6589
--- /dev/null
+++ b/vcpkg/ports/ois/0002-fix-cmake4.patch
@@ -0,0 +1,14 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index f65b86000d..c06b1dd64d 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -188,8 +188,7 @@ endif()
+ if(UNIX)
+
+ if (NOT APPLE)
+- add_dependencies(OIS X11)
+- target_link_libraries(OIS X11)
++ target_link_libraries(OIS X11::X11)
+ endif()
+
+ set_target_properties(OIS PROPERTIES
diff --git a/vcpkg/ports/ois/portfile.cmake b/vcpkg/ports/ois/portfile.cmake
new file mode 100644
index 0000000..7213bbd
--- /dev/null
+++ b/vcpkg/ports/ois/portfile.cmake
@@ -0,0 +1,29 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO wgois/OIS
+ REF v1.5.1
+ SHA512 20598aef999a70900cb7f75ffaf62059acf8e811822971cb21986b5d25d28dacb79e4b4cf4770c70e00d3c55cdd01ef3e68a77c2dd148677784fc4df38891340
+ HEAD_REF master
+ PATCHES
+ 0001_install_pkgconfig_win32.patch
+ 0002-fix-cmake4.patch
+)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ DISABLE_PARALLEL_CONFIGURE
+)
+
+vcpkg_cmake_install()
+
+vcpkg_fixup_pkgconfig()
+
+if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
+endif()
+
+# Include files should not be duplicated into the /debug/include directory
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+
+# Handle copyright
+file(INSTALL "${SOURCE_PATH}/LICENSE.md" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
diff --git a/vcpkg/ports/ois/vcpkg.json b/vcpkg/ports/ois/vcpkg.json
new file mode 100644
index 0000000..64715bf
--- /dev/null
+++ b/vcpkg/ports/ois/vcpkg.json
@@ -0,0 +1,15 @@
+{
+ "name": "ois",
+ "version": "1.5.1",
+ "port-version": 2,
+ "description": "Cross Platform Object Oriented Input Lib System. Meant to be very robust and compatible with many systems and operating systems.",
+ "homepage": "https://wgois.github.io/OIS/",
+ "license": "Zlib",
+ "supports": "!(arm | arm64 | uwp)",
+ "dependencies": [
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ }
+ ]
+}