aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/xcb
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/xcb
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/xcb')
-rw-r--r--vcpkg/ports/xcb/configure.patch47
-rw-r--r--vcpkg/ports/xcb/getpid_include.patch14
-rw-r--r--vcpkg/ports/xcb/makefile.patch13
-rw-r--r--vcpkg/ports/xcb/portfile.cmake108
-rw-r--r--vcpkg/ports/xcb/use_xwindows_includes.patch21
-rw-r--r--vcpkg/ports/xcb/vcpkg.json27
-rw-r--r--vcpkg/ports/xcb/win-fixes.patch40
7 files changed, 270 insertions, 0 deletions
diff --git a/vcpkg/ports/xcb/configure.patch b/vcpkg/ports/xcb/configure.patch
new file mode 100644
index 0000000..94c3322
--- /dev/null
+++ b/vcpkg/ports/xcb/configure.patch
@@ -0,0 +1,47 @@
+diff --git a/configure.ac b/configure.ac
+index 8a05bf1aa..1f57cc688 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -22,6 +22,7 @@ AC_USE_SYSTEM_EXTENSIONS
+ # Initialize libtool
+ LT_PREREQ([2.2])
+ LT_INIT([win32-dll])
++AC_LIBTOOL_WIN32_DLL
+
+ # Require xorg-macros minimum of 1.18 - Initial version
+ m4_ifndef([XORG_MACROS_VERSION],
+@@ -88,11 +88,11 @@ AC_MSG_RESULT($XCBPROTO_XCBPYTHONDIR)
+ AC_SUBST(XCBPROTO_XCBPYTHONDIR)
+
+ AC_HEADER_STDC
+-AC_SEARCH_LIBS(getaddrinfo, socket)
+-AC_SEARCH_LIBS(connect, socket)
++AC_SEARCH_LIBS(getaddrinfo, [socket Ws2_32])
++AC_SEARCH_LIBS(connect, [socket Ws2_32])
+
+ # Find support for sending a message from a socket
+-AC_SEARCH_LIBS(sendmsg, socket, [have_sendmsg="yes"], [have_sendmsg="no"])
++AC_SEARCH_LIBS(sendmsg, [socket Ws2_32], [have_sendmsg="yes"], [have_sendmsg="no"])
+
+ # XPG4v2/UNIX95 added msg_control - check to see if we need to define
+ # _XOPEN_SOURCE to get it (such as on Solaris)
+@@ -140,6 +141,10 @@ mingw*)
+ have_win32="yes"
+ lt_enable_auto_import="-Wl,--enable-auto-import"
+ ;;
++msys*)
++ have_win32="yes"
++ lt_enable_auto_import="-Wl,--enable-auto-import"
++ ;;
+ linux*)
+ AC_DEFINE([HAVE_ABSTRACT_SOCKETS], 1, [Define if your platform supports abstract sockets])
+ ;;
+@@ -208,7 +213,7 @@ esac
+
+ dnl Link with winsock for socket functions on MinGW
+ case $host_os in
+- *mingw*)
++ *mingw*| *msys* )
+ AC_CHECK_LIB([ws2_32],[main])
+ ;;
+ *)
diff --git a/vcpkg/ports/xcb/getpid_include.patch b/vcpkg/ports/xcb/getpid_include.patch
new file mode 100644
index 0000000..755cd3e
--- /dev/null
+++ b/vcpkg/ports/xcb/getpid_include.patch
@@ -0,0 +1,14 @@
+diff --git a/src/xcb_auth.c b/src/xcb_auth.c
+index 8ebe9a437..9a1e459fc 100644
+--- a/src/xcb_auth.c
++++ b/src/xcb_auth.c
+@@ -46,6 +46,9 @@
+ #include <X11/Xwindows.h>
+ #endif
+ #include "xcb_windefs.h"
++#ifdef _MSC_VER
++#include <process.h>
++#endif
+ #else
+ #include <sys/param.h>
+ #include <unistd.h>
diff --git a/vcpkg/ports/xcb/makefile.patch b/vcpkg/ports/xcb/makefile.patch
new file mode 100644
index 0000000..9171fcf
--- /dev/null
+++ b/vcpkg/ports/xcb/makefile.patch
@@ -0,0 +1,13 @@
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 17b64a80e..f45d9d0fe 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -260,7 +260,7 @@ if XCB_SERVERSIDE_SUPPORT
+ C_CLIENT_PY_EXTRA_ARGS += --server-side
+ endif
+
+-$(EXTSOURCES): c_client.py $(XCBPROTO_XCBINCLUDEDIR)/$(@:.c=.xml)
++$(EXTSOURCES): c_client.py /$(@:.c=.xml)
+ $(AM_V_GEN)$(PYTHON) $(srcdir)/c_client.py -c "$(PACKAGE_STRING)" -l "$(XORG_MAN_PAGE)" \
+ -s "$(LIB_MAN_SUFFIX)" -p $(XCBPROTO_XCBPYTHONDIR) \
+ $(C_CLIENT_PY_EXTRA_ARGS) \
diff --git a/vcpkg/ports/xcb/portfile.cmake b/vcpkg/ports/xcb/portfile.cmake
new file mode 100644
index 0000000..c1e3403
--- /dev/null
+++ b/vcpkg/ports/xcb/portfile.cmake
@@ -0,0 +1,108 @@
+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()
+
+vcpkg_from_gitlab(
+ GITLAB_URL https://gitlab.freedesktop.org/xorg
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO lib/libxcb
+ REF ddafdba11f6919e6fcf977c09c78b06f94de47aa #v1.14 + some patches
+ SHA512 d8382b04f2b00671cded9e22d6066164511ee4c08e2cf5de4ec28d09e41228e30d3ba7d0e6b5141abf4e4bc777aa662fe9d1d04f3e1e26e0b323549e845c8072
+ HEAD_REF master
+ PATCHES makefile.patch # without the patch target xproto.c is missing target XCBPROTO_XCBINCLUDEDIR
+ configure.patch
+ use_xwindows_includes.patch # use the X11 include wrappers for windows headers
+ getpid_include.patch # add include for getpid on windows
+ win-fixes.patch # avoid: 'close' undefined; assuming extern returning int
+)
+
+set(ENV{ACLOCAL} "aclocal -I \"${CURRENT_INSTALLED_DIR}/share/xorg/aclocal/\"")
+if(VCPKG_TARGET_IS_WINDOWS)
+ set(OPTIONS --disable-dependency-tracking)
+endif()
+
+vcpkg_find_acquire_program(PYTHON3)
+get_filename_component(PYTHON3_DIR "${PYTHON3}" DIRECTORY)
+file(TO_NATIVE_PATH "${PYTHON3_DIR}" PYTHON3_DIR_NATIVE)
+vcpkg_add_to_path("${PYTHON3_DIR}")
+
+if(NOT XLSTPROC)
+ find_program(XLSTPROC NAMES "xsltproc${VCPKG_HOST_EXECUTABLE_SUFFIX}" PATHS "${CURRENT_HOST_INSTALLED_DIR}/tools/libxslt" PATH_SUFFIXES "bin")
+endif()
+if(NOT XLSTPROC)
+ message(FATAL_ERROR "${PORT} requires xlstproc for the host system. Please install libxslt within vcpkg or your system package manager!")
+endif()
+get_filename_component(XLSTPROC_DIR "${XLSTPROC}" DIRECTORY)
+file(TO_NATIVE_PATH "${XLSTPROC_DIR}" XLSTPROC_DIR_NATIVE)
+vcpkg_add_to_path("${XLSTPROC_DIR}")
+set(ENV{XLSTPROC} "${XLSTPROC}")
+
+if(DEFINED ENV{PYTHONPATH})
+ set(ENV{PYTHONPATH} "${CURRENT_INSTALLED_DIR}/tools/python3/site-packages/${VCPKG_HOST_PATH_SEPARATOR}$ENV{PYTHONPATH}")
+else()
+ set(ENV{PYTHONPATH} "${CURRENT_INSTALLED_DIR}/tools/python3/site-packages/")
+endif()
+
+vcpkg_configure_make(
+ SOURCE_PATH "${SOURCE_PATH}"
+ AUTOCONFIG
+ OPTIONS ${OPTIONS}
+)
+
+vcpkg_install_make()
+
+set(pcfile "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/xcb.pc")
+if(EXISTS "${pcfile}")
+ vcpkg_replace_string("${pcfile}" "Requires: " "Requires: xau xdmcp " IGNORE_UNCHANGED)
+endif()
+set(pcfile "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/xcb.pc")
+if(EXISTS "${pcfile}")
+ vcpkg_replace_string("${pcfile}" "Requires: " "Requires: xau xdmcp " IGNORE_UNCHANGED)
+endif()
+
+vcpkg_fixup_pkgconfig()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
+
+# Handle copyright
+file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
+
+if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic" AND NOT VCPKG_TARGET_IS_MINGW)
+ set(extensions
+ bigreq
+ composite
+ damage
+ dpms
+ dri2
+ dri3
+ ge
+ glx
+ present
+ randr
+ record
+ render
+ res
+ screensaver
+ shape
+ shm
+ sync
+ xc_misc
+ xevie
+ xf86dri
+ xfixes
+ xinerama
+ xinput
+ xkb
+ xprint
+ xtest
+ xv
+ xvmc)
+ foreach(ext IN LISTS extensions)
+ vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/xcb/${ext}.h"
+ "extern xcb_extension_t"
+ "__declspec(dllimport) extern xcb_extension_t")
+ endforeach()
+endif()
+endif()
diff --git a/vcpkg/ports/xcb/use_xwindows_includes.patch b/vcpkg/ports/xcb/use_xwindows_includes.patch
new file mode 100644
index 0000000..23177fc
--- /dev/null
+++ b/vcpkg/ports/xcb/use_xwindows_includes.patch
@@ -0,0 +1,21 @@
+diff --git a/src/xcb_windefs.h b/src/xcb_windefs.h
+index df6026da3..7591c61e7 100644
+--- a/src/xcb_windefs.h
++++ b/src/xcb_windefs.h
+@@ -31,10 +31,13 @@
+ #define WINVER 0x0501 /* required for getaddrinfo/freeaddrinfo defined only for WinXP and above */
+ #endif
+
+-#include <winsock2.h>
++#include <stdio.h>
++#include <X11/Xwindows.h>
++#include <X11/Xwinsock.h>
++typedef unsigned char BYTE;
+-#include <ws2tcpip.h>
+-#include <windef.h>
+
++#define STDERR_FILENO _fileno( stderr )
++
+ struct iovec {
+ void *iov_base; /* Pointer to data. */
+ int iov_len; /* Length of data. */
diff --git a/vcpkg/ports/xcb/vcpkg.json b/vcpkg/ports/xcb/vcpkg.json
new file mode 100644
index 0000000..3551f9d
--- /dev/null
+++ b/vcpkg/ports/xcb/vcpkg.json
@@ -0,0 +1,27 @@
+{
+ "name": "xcb",
+ "version": "1.14",
+ "port-version": 3,
+ "description": "C interface to the X Window System protocol, which replaces the traditional Xlib interface.",
+ "homepage": "https://xcb.freedesktop.org/",
+ "license": "X11-distribute-modifications-variant",
+ "dependencies": [
+ "bzip2",
+ "libxau",
+ "libxdmcp",
+ {
+ "name": "libxslt",
+ "host": true,
+ "default-features": false,
+ "features": [
+ "tools"
+ ]
+ },
+ "pthread",
+ "pthread-stubs",
+ "xcb-proto",
+ "xcb-util-m4",
+ "xorg-macros",
+ "xproto"
+ ]
+}
diff --git a/vcpkg/ports/xcb/win-fixes.patch b/vcpkg/ports/xcb/win-fixes.patch
new file mode 100644
index 0000000..e5f4ccc
--- /dev/null
+++ b/vcpkg/ports/xcb/win-fixes.patch
@@ -0,0 +1,40 @@
+diff --git a/src/xcb_util.c b/src/xcb_util.c
+index 0296ce0dd..cce54aa50 100644
+--- a/src/xcb_util.c
++++ b/src/xcb_util.c
+@@ -389,7 +389,11 @@ static int _xcb_open_tcp(const char *host, char *protocol, const unsigned short
+ fd = _xcb_socket(addr->ai_family, addr->ai_socktype, addr->ai_protocol);
+ if (_xcb_do_connect(fd, addr->ai_addr, addr->ai_addrlen) >= 0)
+ break;
++#ifdef _WIN32
++ closesocket(fd);
++#else
+ close(fd);
++#endif
+ fd = -1;
+ }
+ freeaddrinfo(results);
+@@ -454,7 +458,11 @@ static int _xcb_open_unix(char *protocol, const char *file)
+ setsockopt(fd, SOL_SOCKET, SO_SNDBUF, &val, sizeof(int));
+ }
+ if(connect(fd, (struct sockaddr *) &addr, sizeof(addr)) == -1) {
++#ifdef _WIN32
++ closesocket(fd);
++#else
+ close(fd);
++#endif
+ return -1;
+ }
+ return fd;
+@@ -481,7 +489,11 @@ static int _xcb_open_abstract(char *protocol, const char *file, size_t filelen)
+ if (fd == -1)
+ return -1;
+ if (connect(fd, (struct sockaddr *) &addr, namelen) == -1) {
++#ifdef _WIN32
++ closesocket(fd);
++#else
+ close(fd);
++#endif
+ return -1;
+ }
+ return fd;