diff options
Diffstat (limited to 'vcpkg/ports/libxkbfile')
| -rw-r--r-- | vcpkg/ports/libxkbfile/fix_u_char.patch | 15 | ||||
| -rw-r--r-- | vcpkg/ports/libxkbfile/portfile.cmake | 41 | ||||
| -rw-r--r-- | vcpkg/ports/libxkbfile/symbol_visibility.patch | 24 | ||||
| -rw-r--r-- | vcpkg/ports/libxkbfile/vcpkg.json | 12 |
4 files changed, 92 insertions, 0 deletions
diff --git a/vcpkg/ports/libxkbfile/fix_u_char.patch b/vcpkg/ports/libxkbfile/fix_u_char.patch new file mode 100644 index 0000000..4e20ce0 --- /dev/null +++ b/vcpkg/ports/libxkbfile/fix_u_char.patch @@ -0,0 +1,15 @@ +diff --git a/src/xkbmisc.c b/src/xkbmisc.c +index 2f9b532e6..8be8dd508 100644 +--- a/src/xkbmisc.c ++++ b/src/xkbmisc.c +@@ -688,7 +688,9 @@ XkbNameMatchesPattern(char *name, char *ptrn) + _X_HIDDEN int + _XkbStrCaseCmp(char *str1, char *str2) + { +- const u_char *us1 = (const u_char *) str1, *us2 = (const u_char *) str2; ++ typedef unsigned char u_char; ++ const u_char *us1 = (const u_char *) str1; ++ const u_char *us2 = (const u_char *) str2; + + while (tolower(*us1) == tolower(*us2)) { + if (*us1++ == '\0') diff --git a/vcpkg/ports/libxkbfile/portfile.cmake b/vcpkg/ports/libxkbfile/portfile.cmake new file mode 100644 index 0000000..78b0eaa --- /dev/null +++ b/vcpkg/ports/libxkbfile/portfile.cmake @@ -0,0 +1,41 @@ +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 AND VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
+ set(PATCHES symbol_visibility.patch)
+ list(APPEND VCPKG_C_FLAGS " /DXKBFILE_BUILD")
+ list(APPEND VCPKG_CXX_FLAGS " /DXKBFILE_BUILD")
+endif()
+
+vcpkg_from_gitlab(
+ GITLAB_URL https://gitlab.freedesktop.org/xorg
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO lib/libxkbfile
+ REF 261992d42905f209cd5bf6afcf8a7ae3aa30b3ff #1.1.0
+ SHA512 5be520e408d25331c9a97648f2a6fa832f0d4f49f93f71490b89746da0fbbda404eaab3797c5fbe195287dc94581a6703fa4ecc2511e046127af057eab60378f
+ HEAD_REF master
+ PATCHES fix_u_char.patch
+ ${PATCHES}
+)
+
+set(ENV{ACLOCAL} "aclocal -I \"${CURRENT_INSTALLED_DIR}/share/xorg/aclocal/\"")
+
+vcpkg_configure_make(
+ SOURCE_PATH "${SOURCE_PATH}"
+ AUTOCONFIG
+)
+
+vcpkg_install_make()
+vcpkg_fixup_pkgconfig()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
+
+# Handle copyright
+file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/share/${PORT}/")
+file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}/" RENAME copyright)
+endif()
+
diff --git a/vcpkg/ports/libxkbfile/symbol_visibility.patch b/vcpkg/ports/libxkbfile/symbol_visibility.patch new file mode 100644 index 0000000..1034421 --- /dev/null +++ b/vcpkg/ports/libxkbfile/symbol_visibility.patch @@ -0,0 +1,24 @@ +diff --git a/include/X11/extensions/XKBfile.h b/include/X11/extensions/XKBfile.h +index 1455463e6..5bcabdd14 100644 +--- a/include/X11/extensions/XKBfile.h ++++ b/include/X11/extensions/XKBfile.h +@@ -83,10 +83,15 @@ typedef void (*XkbFileAddOnFunc)( + #define _XkbErrXReqFailure 25 + #define _XkbErrBadImplementation 26 + +-extern const char * _XkbErrMessages[]; +-extern unsigned _XkbErrCode; +-extern const char * _XkbErrLocation; +-extern unsigned _XkbErrData; ++#if defined(_MSC_VER) && !defined(XKBFILE_BUILD) ++#define XKBFILE_EXTERN __declspec(dllimport) extern ++#else ++#define XKBFILE_EXTERN extern ++#endif ++XKBFILE_EXTERN const char * _XkbErrMessages[]; ++XKBFILE_EXTERN unsigned _XkbErrCode; ++XKBFILE_EXTERN const char * _XkbErrLocation; ++XKBFILE_EXTERN unsigned _XkbErrData; + + /***====================================================================***/ + diff --git a/vcpkg/ports/libxkbfile/vcpkg.json b/vcpkg/ports/libxkbfile/vcpkg.json new file mode 100644 index 0000000..b1f4114 --- /dev/null +++ b/vcpkg/ports/libxkbfile/vcpkg.json @@ -0,0 +1,12 @@ +{ + "name": "libxkbfile", + "version": "1.1.0", + "description": "XKB file handling routines", + "homepage": "https://gitlab.freedesktop.org/xorg/lib/libxkbfile", + "license": null, + "dependencies": [ + "libx11", + "xorg-macros", + "xproto" + ] +} |