diff options
Diffstat (limited to 'vcpkg/ports/libxkbcommon')
| -rw-r--r-- | vcpkg/ports/libxkbcommon/build.patch | 26 | ||||
| -rw-r--r-- | vcpkg/ports/libxkbcommon/disable-test.patch | 20 | ||||
| -rw-r--r-- | vcpkg/ports/libxkbcommon/portfile.cmake | 56 | ||||
| -rw-r--r-- | vcpkg/ports/libxkbcommon/vcpkg.json | 21 |
4 files changed, 123 insertions, 0 deletions
diff --git a/vcpkg/ports/libxkbcommon/build.patch b/vcpkg/ports/libxkbcommon/build.patch new file mode 100644 index 0000000..fc51387 --- /dev/null +++ b/vcpkg/ports/libxkbcommon/build.patch @@ -0,0 +1,26 @@ +diff --git a/tools/how-to-type.c b/tools/how-to-type.c +index 72aea1b..783373a 100644 +--- a/tools/how-to-type.c ++++ b/tools/how-to-type.c +@@ -26,7 +26,9 @@ + #include <getopt.h> + #include <stdbool.h> + #include <stdlib.h> ++#ifdef HAVE_UNISTD_H + #include <unistd.h> ++#endif + #include <errno.h> + + #include "xkbcommon/xkbcommon.h" +diff --git a/tools/tools-common.c b/tools/tools-common.c +index 8eb3f4b..8b22307 100644 +--- a/tools/tools-common.c ++++ b/tools/tools-common.c +@@ -42,6 +42,7 @@ + #ifdef _WIN32 + #include <io.h> + #include <windows.h> ++#include <process.h> + #else + #include <unistd.h> + #include <termios.h> diff --git a/vcpkg/ports/libxkbcommon/disable-test.patch b/vcpkg/ports/libxkbcommon/disable-test.patch new file mode 100644 index 0000000..eceb06b --- /dev/null +++ b/vcpkg/ports/libxkbcommon/disable-test.patch @@ -0,0 +1,20 @@ +diff --git a/meson.build b/meson.build +index 2de4ee9..bb53561 100644 +--- a/meson.build ++++ b/meson.build +@@ -601,6 +601,7 @@ configure_file(input: 'test/xkeyboard-config-test.py.in', + configuration: xkct_config) + + # Tests ++if false + test_env = environment() + test_env.set('XKB_LOG_LEVEL', 'debug') + test_env.set('XKB_LOG_VERBOSITY', '10') +@@ -873,6 +874,7 @@ if get_option('enable-x11') + env: bench_env, + ) + endif ++endif + + + # Documentation. diff --git a/vcpkg/ports/libxkbcommon/portfile.cmake b/vcpkg/ports/libxkbcommon/portfile.cmake new file mode 100644 index 0000000..b425748 --- /dev/null +++ b/vcpkg/ports/libxkbcommon/portfile.cmake @@ -0,0 +1,56 @@ +if(NOT X_VCPKG_FORCE_VCPKG_X_LIBRARIES AND NOT VCPKG_TARGET_IS_WINDOWS)
+ message(STATUS "Utils and libraries provided by '${PORT}' should be provided by your system! Install the required packages or force vcpkg libraries by setting X_VCPKG_FORCE_VCPKG_X_LIBRARIES in your triplet!")
+ set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
+else()
+
+set(PATCHES "")
+if(VCPKG_TARGET_IS_WINDOWS)
+ #vcpkg_check_linkage(ONLY_STATIC_LIBRARY) # Meson is not able to automatically export symbols for DLLs
+ set(PATCHES build.patch)
+endif()
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO xkbcommon/libxkbcommon
+ REF "xkbcommon-${VERSION}"
+ SHA512 454fbb2861405ca957d64035e924c1bbb7d43db7867903963fc053b7ecb64a8fba89a21cc8ac18ebeec9b61ae0789fb88c52521a850dc371857f28b08e80167b
+ HEAD_REF master
+ PATCHES
+ disable-test.patch
+ ${PATCHES}
+)
+
+vcpkg_find_acquire_program(FLEX)
+get_filename_component(FLEX_DIR "${FLEX}" DIRECTORY )
+vcpkg_add_to_path(PREPEND "${FLEX_DIR}")
+
+vcpkg_find_acquire_program(BISON)
+get_filename_component(BISON_DIR "${BISON}" DIRECTORY )
+vcpkg_add_to_path(PREPEND "${BISON_DIR}")
+
+set(OPTIONS "")
+if(VCPKG_TARGET_IS_WINDOWS)
+ set(OPTIONS -Denable-xkbregistry=false)
+endif()
+
+vcpkg_configure_meson(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS ${OPTIONS}
+ -Denable-wayland=false
+ -Denable-docs=false
+ -Denable-tools=false
+)
+vcpkg_install_meson()
+vcpkg_fixup_pkgconfig()
+vcpkg_copy_pdbs()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
+
+if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
+endif()
+
+# Handle copyright
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
+endif()
diff --git a/vcpkg/ports/libxkbcommon/vcpkg.json b/vcpkg/ports/libxkbcommon/vcpkg.json new file mode 100644 index 0000000..30e85a7 --- /dev/null +++ b/vcpkg/ports/libxkbcommon/vcpkg.json @@ -0,0 +1,21 @@ +{ + "name": "libxkbcommon", + "version": "1.7.0", + "description": "keymap handling library for toolkits and window systems", + "homepage": "https://xkbcommon.org/", + "license": null, + "dependencies": [ + "getopt", + "libx11", + { + "name": "vcpkg-tool-meson", + "host": true + }, + { + "name": "wayland", + "platform": "linux" + }, + "xcb", + "xcb-render-util" + ] +} |