diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/xproto | |
Diffstat (limited to 'vcpkg/ports/xproto')
| -rw-r--r-- | vcpkg/ports/xproto/portfile.cmake | 51 | ||||
| -rw-r--r-- | vcpkg/ports/xproto/upstream-1.patch | 12 | ||||
| -rw-r--r-- | vcpkg/ports/xproto/vcpkg.json | 15 | ||||
| -rw-r--r-- | vcpkg/ports/xproto/vcxserver-xw32defs.patch | 22 | ||||
| -rw-r--r-- | vcpkg/ports/xproto/windows-include-guards.patch | 41 | ||||
| -rw-r--r-- | vcpkg/ports/xproto/windows-io.patch | 12 | ||||
| -rw-r--r-- | vcpkg/ports/xproto/windows-long64.patch | 48 | ||||
| -rw-r--r-- | vcpkg/ports/xproto/windows-none.patch | 85 | ||||
| -rw-r--r-- | vcpkg/ports/xproto/windows_mean_and_lean.patch | 13 |
9 files changed, 299 insertions, 0 deletions
diff --git a/vcpkg/ports/xproto/portfile.cmake b/vcpkg/ports/xproto/portfile.cmake new file mode 100644 index 0000000..87380da --- /dev/null +++ b/vcpkg/ports/xproto/portfile.cmake @@ -0,0 +1,51 @@ +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()
+
+if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
+ set(PATCHES
+ vcxserver-xw32defs.patch
+ windows-long64.patch
+ windows-io.patch
+ windows_mean_and_lean.patch
+ windows-none.patch
+ windows-include-guards.patch
+ )
+endif()
+
+vcpkg_from_gitlab(
+ GITLAB_URL https://gitlab.freedesktop.org/xorg
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO proto/xorgproto
+ REF 57acac1d4c7967f4661fb1c9f86f48f34a46c48d # 2021.5
+ SHA512 5d2b6096e7f6ec6a3414f4370da583f6660fbd287474e8b4cd3e51ccc35514181352d3b0b9cd4b8d6e30de7b54f4ce01a9fbf17be75cf8de18aa28e9f774b8c4
+ HEAD_REF master
+ PATCHES
+ upstream-1.patch
+ ${PATCHES}
+)
+
+vcpkg_configure_meson(SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS "-Dlegacy=true")
+vcpkg_install_meson()
+
+# To make CMake consumption easier.
+if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/share/pkgconfig/")
+ file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/lib/")
+ file(RENAME "${CURRENT_PACKAGES_DIR}/debug/share/pkgconfig/" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig")
+endif()
+if(EXISTS "${CURRENT_PACKAGES_DIR}/share/pkgconfig/")
+ file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/lib/")
+ file(RENAME "${CURRENT_PACKAGES_DIR}/share/pkgconfig/" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig")
+endif()
+
+vcpkg_fixup_pkgconfig(SKIP_CHECK) # pc files requiring Xau Xt xt SM ICE X11 xcb Xdmcp are installed before they can be used.
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
+
+# Handle copyright
+file(GLOB_RECURSE _files "${SOURCE_PATH}/COPYING*")
+file(INSTALL ${_files} DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
+vcpkg_install_copyright(FILE_LIST ${_files})
+file(WRITE "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" "")
+endif()
diff --git a/vcpkg/ports/xproto/upstream-1.patch b/vcpkg/ports/xproto/upstream-1.patch new file mode 100644 index 0000000..55f283f --- /dev/null +++ b/vcpkg/ports/xproto/upstream-1.patch @@ -0,0 +1,12 @@ +diff --git a/include/X11/XF86keysym.h b/include/X11/XF86keysym.h
+index c242e42f5fee2e28da11df2d33b005e9bb4b5441..59ba54d1a13fabdded6920ce946c1e20594f49ff 100644
+--- a/include/X11/XF86keysym.h
++++ b/include/X11/XF86keysym.h
+@@ -394,6 +394,7 @@
+ #define XF86XK_VoiceCommand _EVDEVK(0x246) /* v3.16 KEY_VOICECOMMAND */
+ #define XF86XK_Assistant _EVDEVK(0x247) /* v4.13 KEY_ASSISTANT */
+ /* Use: XK_ISO_Next_Group _EVDEVK(0x248) v5.2 KEY_KBD_LAYOUT_NEXT */
++#define XF86XK_EmojiPicker _EVDEVK(0x249) /* v5.13 KEY_EMOJI_PICKER */
+ #define XF86XK_BrightnessMin _EVDEVK(0x250) /* v3.16 KEY_BRIGHTNESS_MIN */
+ #define XF86XK_BrightnessMax _EVDEVK(0x251) /* v3.16 KEY_BRIGHTNESS_MAX */
+ #define XF86XK_KbdInputAssistPrev _EVDEVK(0x260) /* v3.18 KEY_KBDINPUTASSIST_PREV */
diff --git a/vcpkg/ports/xproto/vcpkg.json b/vcpkg/ports/xproto/vcpkg.json new file mode 100644 index 0000000..43a4509 --- /dev/null +++ b/vcpkg/ports/xproto/vcpkg.json @@ -0,0 +1,15 @@ +{ + "name": "xproto", + "version": "2021.5", + "description": "X Window System unified protocol definitions", + "homepage": "https://gitlab.freedesktop.org/xorg/proto/xorgproto", + "license": null, + "dependencies": [ + "libxslt", + { + "name": "vcpkg-tool-meson", + "host": true + }, + "xorg-macros" + ] +} diff --git a/vcpkg/ports/xproto/vcxserver-xw32defs.patch b/vcpkg/ports/xproto/vcxserver-xw32defs.patch new file mode 100644 index 0000000..03b84a4 --- /dev/null +++ b/vcpkg/ports/xproto/vcxserver-xw32defs.patch @@ -0,0 +1,22 @@ +diff --git a/include/X11/Xw32defs.h b/include/X11/Xw32defs.h
+index 683b588..db1eabd 100644
+--- a/include/X11/Xw32defs.h
++++ b/include/X11/Xw32defs.h
+@@ -27,7 +27,6 @@ typedef char *caddr_t;
+ # define execve _execve
+ # define execvp _execvp
+ # define execvpe _execvpe
+-# define fdopen _fdopen
+ # define fileno _fileno
+ # define fstat _fstat
+ # define getcwd _getcwd
+@@ -72,8 +71,8 @@ typedef char *caddr_t;
+ # define S_IEXEC _S_IEXEC
+
+ # define F_OK 0
+-# define X_OK 1
+ # define W_OK 2
+ # define R_OK 4
++# define X_OK R_OK
+ # endif /* __GNUC__ */
+ #endif
diff --git a/vcpkg/ports/xproto/windows-include-guards.patch b/vcpkg/ports/xproto/windows-include-guards.patch new file mode 100644 index 0000000..7e252aa --- /dev/null +++ b/vcpkg/ports/xproto/windows-include-guards.patch @@ -0,0 +1,41 @@ +diff --git a/include/X11/Xwindows.h b/include/X11/Xwindows.h
+index 900257928..666ee6515 100644
+--- a/include/X11/Xwindows.h
++++ b/include/X11/Xwindows.h
+@@ -41,6 +41,11 @@ The Open Group.
+ * do as it's no help at all to X11 clients which also need to use the
+ * Win32 API)
+ */
++#pragma once
++
++#ifndef _X11_XWINDOWS_H_
++#define _X11_XWINDOWS_H_
++
+ #undef _XFree86Server
+ #ifdef XFree86Server
+ # define _XFree86Server
+@@ -130,3 +135,4 @@ typedef int Status;
+ # undef _XFree86Server
+ #endif
+
++#endif
+diff --git a/include/X11/Xwinsock.h b/include/X11/Xwinsock.h
+index 92e0d2a33..1e3e8671b 100644
+--- a/include/X11/Xwinsock.h
++++ b/include/X11/Xwinsock.h
+@@ -32,6 +32,10 @@ The Open Group.
+ * Conflicts come from the fact that including winsock.h actually pulls
+ * in the whole Windows API...
+ */
++#pragma once
++
++#ifndef _X11_XWINSOCK_H_
++#define _X11_XWINSOCK_H_
+
+ #undef _XFree86Server
+ #ifdef XFree86Server
+@@ -100,3 +104,4 @@ typedef int Status;
+ # undef _XFree86Server
+ #endif
+
++#endif
diff --git a/vcpkg/ports/xproto/windows-io.patch b/vcpkg/ports/xproto/windows-io.patch new file mode 100644 index 0000000..159d121 --- /dev/null +++ b/vcpkg/ports/xproto/windows-io.patch @@ -0,0 +1,12 @@ +diff --git a/include/X11/Xos.h b/include/X11/Xos.h
+index 28dfc673a..37d268f27 100644
+--- a/include/X11/Xos.h
++++ b/include/X11/Xos.h
+@@ -80,6 +80,7 @@ in this Software without prior written authorization from The Open Group.
+ # include <unistd.h>
+ # endif
+ # ifdef WIN32
++# include <io.h> // For open()
+ # include <X11/Xw32defs.h>
+ # else
+ # include <sys/file.h>
diff --git a/vcpkg/ports/xproto/windows-long64.patch b/vcpkg/ports/xproto/windows-long64.patch new file mode 100644 index 0000000..5d8b743 --- /dev/null +++ b/vcpkg/ports/xproto/windows-long64.patch @@ -0,0 +1,48 @@ +diff --git a/include/X11/Xwinsock.h b/include/X11/Xwinsock.h +index 624047d..e8d5653 100644 +--- a/include/X11/Xwinsock.h ++++ b/include/X11/Xwinsock.h +@@ -47,6 +47,10 @@ The Open Group. + #define _NO_BOOL_TYPEDEF + #define BOOL WINBOOL + #define INT32 wINT32 ++#ifdef __x86_64__ ++#define INT64 wINT64 ++#define LONG64 wLONG64 ++#endif + #undef Status + #define Status wStatus + #define ATOM wATOM +@@ -58,6 +62,8 @@ The Open Group. + #undef BYTE + #undef BOOL + #undef INT32 ++#undef INT64 ++#undef LONG64 + #undef ATOM + #undef FreeResource + #undef CreateWindowA +diff --git a/include/X11/meson.build b/include/X11/meson.build +index 1c33c64..703ab19 100644 +--- a/include/X11/meson.build ++++ b/include/X11/meson.build +@@ -1,7 +1,8 @@ + fd_set_maybe_headers = [ 'sys/param.h', + 'sys/types.h', + 'sys/time.h', +- 'sys/select.h' ++ 'sys/select.h', ++ 'winsock2.h' + ] + fd_set_headers = '' + foreach h : fd_set_maybe_headers +@@ -15,6 +16,8 @@ if cc.has_member('fd_set', 'fds_bits', prefix: fd_set_headers) + fds_bits = 'fds_bits' + elif cc.has_member('fd_set', '__fds_bits', prefix: fd_set_headers) + fds_bits = '__fds_bits' ++elif cc.has_member('fd_set', 'fd_count', prefix: fd_set_headers) ++ fds_bits = 'fd_count' + else + error('Your fd_set is too weird.') + endif +--
\ No newline at end of file diff --git a/vcpkg/ports/xproto/windows-none.patch b/vcpkg/ports/xproto/windows-none.patch new file mode 100644 index 0000000..87764c8 --- /dev/null +++ b/vcpkg/ports/xproto/windows-none.patch @@ -0,0 +1,85 @@ +diff --git a/include/X11/Xwindows.h b/include/X11/Xwindows.h
+index 70e1debd5..236ec96a7 100644
+--- a/include/X11/Xwindows.h
++++ b/include/X11/Xwindows.h
+@@ -69,6 +69,16 @@ The Open Group.
+ #endif
+ #undef Status
+ #define Status wStatus
++#ifdef None // FS.h defines None which is used in winnt.h
++#pragma push_macro("None")
++#define NoneDefined
++#undef None
++#endif
++#ifdef ControlMask // X.h defines ControlMask which is used in processthreadapi.h
++#pragma push_macro("ControlMask")
++#define ControlMaskDefined
++#undef ControlMask
++#endif
+ #define ATOM wATOM
+ #define BYTE wBYTE
+ #define FreeResource wFreeResource
+@@ -76,6 +77,14 @@ The Open Group.
+ #undef NOMINMAX
+ #undef Status
+-#define Status int
++typedef int Status;
++#ifdef NoneDefined
++#pragma pop_macro("None")
++#undef NoneDefined
++#endif
++#ifdef ControlMaskDefined
++#pragma pop_macro("ControlMask")
++#undef ControlMaskDefined
++#endif
+ #undef BYTE
+ #undef BOOL
+ #undef INT32
+diff --git a/include/X11/Xwinsock.h b/include/X11/Xwinsock.h
+index 624047d..e8d5653 100644
+--- a/include/X11/Xwinsock.h
++++ b/include/X11/Xwinsock.h
+@@ -47,23 +47,42 @@ The Open Group.
+ #define _NO_BOOL_TYPEDEF
+ #define BOOL WINBOOL
+ #define INT32 wINT32
+ #ifdef __x86_64__
+ #define INT64 wINT64
+ #define LONG64 wLONG64
+ #endif
+ #undef Status
+ #define Status wStatus
++#ifdef None
++#pragma push_macro("None")
++#define NoneDefined
++#undef None
++#endif
++#ifdef ControlMask
++#pragma push_macro("ControlMask")
++#define ControlMaskDefined
++#undef ControlMask
++#endif
+ #define ATOM wATOM
+ #define BYTE wBYTE
+ #define FreeResource wFreeResource
+ #include <winsock2.h>
++#include <ws2tcpip.h>
+ #undef Status
+-#define Status int
++typedef int Status;
++#ifdef NoneDefined
++#pragma pop_macro("None")
++#undef NoneDefined
++#endif
++#ifdef ControlMaskDefined
++#pragma pop_macro("ControlMask")
++#undef ControlMaskDefined
++#endif
+ #undef BYTE
+ #undef BOOL
+ #undef INT32
+ #undef INT64
+ #undef LONG64
+ #undef ATOM
+ #undef FreeResource
+ #undef CreateWindowA
diff --git a/vcpkg/ports/xproto/windows_mean_and_lean.patch b/vcpkg/ports/xproto/windows_mean_and_lean.patch new file mode 100644 index 0000000..f50e4c8 --- /dev/null +++ b/vcpkg/ports/xproto/windows_mean_and_lean.patch @@ -0,0 +1,13 @@ +diff --git a/include/X11/Xwindows.h b/include/X11/Xwindows.h +index 70e1debd5..236ec96a7 100644 +--- a/include/X11/Xwindows.h ++++ b/include/X11/Xwindows.h +@@ -54,7 +54,7 @@ The Open Group. + * + */ + #define NOMINMAX +- ++#define WIN32_LEAN_AND_MEAN // Otherwise this will include winsock.h! + /* + * mingw-w64 headers define BOOL as a typedef, protecting against macros + * mingw.org headers define BOOL in terms of WINBOOL |