Skip to content

Commit

Permalink
X Window Part 9/N (some xcb ports) (#27240)
Browse files Browse the repository at this point in the history
* [xcb-cursor] add port

* [xcb-errors] add port

* [xcb-image] add port

* [xcb-keysyms] add port

* [xcb-util] add port

* [xcb-wm] add port

* v db

* remove xcb-cursor

* Apply CR

Co-authored-by: Billy O'Neal <bion@microsoft.com>

* update ports to new version

* v db

* fix v db

* add missing DESTINATION parameter

* v db

* rename xcb-errors and xcb-wm

* v db

* only apply the patch on windows

* v db

Co-authored-by: Billy O'Neal <bion@microsoft.com>
  • Loading branch information
Neumann-A and BillyONeal committed Oct 26, 2022
1 parent 043338a commit 4aedc13
Show file tree
Hide file tree
Showing 23 changed files with 393 additions and 4 deletions.
13 changes: 13 additions & 0 deletions ports/xcb-image/add_return_value.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/image/xcb_bitops.h b/image/xcb_bitops.h
index a6872a1f3..bf6fdc179 100644
--- a/image/xcb_bitops.h
+++ b/image/xcb_bitops.h
@@ -207,6 +207,8 @@ xcb_host_byte_order(void) {
return XCB_IMAGE_ORDER_LSB_FIRST;
}
assert(0);
+ exit(EXIT_FAILURE);
+ return -1;
}

#endif /* __XCB_BITOPS_H__ */
30 changes: 30 additions & 0 deletions ports/xcb-image/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
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-image
REF 525ce59fe2329d4b23fc0c52ed9dd92daac8ac2a #v 0.4.1
SHA512 e91471c45983bb3a56fb96a9ab627a5b65fcbc21424f62bed10dba283c97fdd6475d4f380d268a30a99b6544bc804f8263e7b945a4c4d22c79535e3c3b1e10db
HEAD_REF master
PATCHES add_return_value.patch
)
file(TOUCH "${SOURCE_PATH}/m4/dummy")
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")

file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
endif()
11 changes: 11 additions & 0 deletions ports/xcb-image/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "xcb-image",
"version": "0.4.1",
"description": "XCB port of Xlib's XImage and XShmImage functions.",
"homepage": "https://xcb.freedesktop.org/",
"license": null,
"dependencies": [
"xcb",
"xcb-util"
]
}
29 changes: 29 additions & 0 deletions ports/xcb-keysyms/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
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-keysyms
REF 85e093f14b0ade2956e0a5d1c37cfde06d8b1ba6 #v 0.4.1
SHA512 cee1224ba673c637d20387d22d445be92970dd1b169247550befe64908e1b7f8cc4311018b7e7854e46ccaa62b8c6258293dcb144a94e320bee5a1e060b194f1
HEAD_REF master
)
file(TOUCH "${SOURCE_PATH}/m4/dummy")
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")

file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
endif()
13 changes: 13 additions & 0 deletions ports/xcb-keysyms/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "xcb-keysyms",
"version": "0.4.1",
"description": "Standard X key constants and conversion to/from keycodes",
"homepage": "https://xcb.freedesktop.org/",
"license": null,
"dependencies": [
"bzip2",
"xcb",
"xorg-macros",
"xproto"
]
}
4 changes: 2 additions & 2 deletions ports/xcb-render-util/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ vcpkg_from_gitlab(
GITLAB_URL https://gitlab.freedesktop.org/xorg
OUT_SOURCE_PATH SOURCE_PATH
REPO lib/libxcb-render-util
REF 0317caf63de532fd7a0493ed6afa871a67253747 #v 0.3.9
SHA512 9a16c3eb3575586fce85a548cb5fd8b23aa8e42363b2c6d4e074e45f5c04089301ef2ff3012cf9cc94490359d4e28ff062feaecb97a880c9240bf7dbe5d03612
REF 5293d8b6165f23b9f7a8bcc903da0e4d7a75984c #v 0.3.10
SHA512 ecd1876b62c1345ce3c06ac525f1af4f59dcce3c8d76003c59dd64c80f7787d6d2754c481e585507d6bcaf443026a7aa22ab9eac28b5153eff78d216e53eb29f
HEAD_REF master # branch name
PATCHES pthread.patch # required since this port directly depends on pthread functions. So it has to directly link it!
)
Expand Down
2 changes: 1 addition & 1 deletion ports/xcb-render-util/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "xcb-render-util",
"version": "0.3.9",
"version": "0.3.10",
"description": "XCB convenience functions for the Render extension.",
"homepage": "https://xcb.freedesktop.org/",
"license": null,
Expand Down
20 changes: 20 additions & 0 deletions ports/xcb-util-errors/fix_python.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
diff --git a/src/extensions.py b/src/extensions.py
index 94d7d57fe..022d4003e 100644
--- a/src/extensions.py
+++ b/src/extensions.py
@@ -1,5 +1,6 @@
#!/usr/bin/env python
import sys
+import glob
from xml.etree.cElementTree import parse

class Module(object):
@@ -83,7 +84,7 @@ def parseFile(filename):

# Parse the xml file
output_file = sys.argv[1]
-for input_file in sys.argv[2:]:
+for input_file in glob.glob(sys.argv[2]):
parseFile(input_file)

assert xproto != None
40 changes: 40 additions & 0 deletions ports/xcb-util-errors/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
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)
set(PATCHES fix_python.patch)
endif()

vcpkg_from_gitlab(
GITLAB_URL https://gitlab.freedesktop.org/xorg
OUT_SOURCE_PATH SOURCE_PATH
REPO lib/libxcb-errors
REF 517dd82c079de762a7426f20166a44f11e8d38c5 #1.0.1
SHA512 391f6bc9452bf4d6a3f1fa69232cdbef43f9fcd339b8d1965132a3b227ed7ebcbaad553fe64d42bc525811caedf3ff9d5bec108f6ac2efd5a014f75fb35cbf85
HEAD_REF master
PATCHES ${PATCHES}
)
file(TOUCH "${SOURCE_PATH}/m4/dummy")
set(ENV{ACLOCAL} "aclocal -I \"${CURRENT_INSTALLED_DIR}/share/xorg/aclocal/\"")

vcpkg_find_acquire_program(PYTHON3)
get_filename_component(PYTHON3_DIR "${PYTHON3}" DIRECTORY)
vcpkg_add_to_path("${PYTHON3_DIR}")

vcpkg_configure_make(
SOURCE_PATH "${SOURCE_PATH}"
AUTOCONFIG
COPY_SOURCE
)

vcpkg_install_make()
vcpkg_fixup_pkgconfig()

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")

file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
endif()

11 changes: 11 additions & 0 deletions ports/xcb-util-errors/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "xcb-util-errors",
"version": "1.0.1",
"description": "XCB utility library that gives human readable names to error, event, & request codes.",
"homepage": "https://xcb.freedesktop.org/",
"license": null,
"dependencies": [
"xcb",
"xcb-util"
]
}
51 changes: 51 additions & 0 deletions ports/xcb-util-wm/build.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
diff --git a/ewmh/ewmh.c.m4 b/ewmh/ewmh.c.m4
index b986105f6..a0ce37c2a 100644
--- a/ewmh/ewmh.c.m4
+++ b/ewmh/ewmh.c.m4
@@ -45,7 +45,7 @@

#include <sys/types.h>

-#define ssizeof(foo) (ssize_t)sizeof(foo)
+#define ssizeof(foo) (ptrdiff_t)sizeof(foo)
#define countof(foo) (ssizeof(foo) / ssizeof(foo[0]))

/**
@@ -1119,12 +1119,13 @@ xcb_ewmh_append_wm_icon_checked(xcb_ewmh_connection_t *ewmh,
uint32_t img_len, uint32_t *img)
{
const uint32_t data_len = img_len + 2;
- uint32_t data[data_len];
+ uint32_t *data = (uint32_t*)malloc(data_len*sizeof(uint32_t));

- set_wm_icon_data(data, width, height, img_len, img);
-
- return xcb_ewmh_set_wm_icon_checked(ewmh, XCB_PROP_MODE_APPEND, window,
- data_len, data);
+ set_wm_icon_data(data, width, height, img_len, img);
+ const xcb_void_cookie_t res = xcb_ewmh_set_wm_icon_checked(ewmh, XCB_PROP_MODE_APPEND, window,
+ data_len, data);
+ free(data);
+ return res;
}

xcb_void_cookie_t
@@ -1134,12 +1135,13 @@ xcb_ewmh_append_wm_icon(xcb_ewmh_connection_t *ewmh,
uint32_t img_len, uint32_t *img)
{
const uint32_t data_len = img_len + 2;
- uint32_t data[data_len];
-
- set_wm_icon_data(data, width, height, img_len, img);
+ uint32_t *data = (uint32_t*)malloc(data_len*sizeof(uint32_t));

- return xcb_ewmh_set_wm_icon(ewmh, XCB_PROP_MODE_APPEND, window,
- data_len, data);
+ set_wm_icon_data(data, width, height, img_len, img);
+ const xcb_void_cookie_t res = xcb_ewmh_set_wm_icon(ewmh, XCB_PROP_MODE_APPEND, window,
+ data_len, data);
+ free(data);
+ return res;
}

DO_GET_PROPERTY(wm_icon, _NET_WM_ICON, XCB_ATOM_CARDINAL, UINT_MAX)
30 changes: 30 additions & 0 deletions ports/xcb-util-wm/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
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-wm
REF 0c6681e465c9cc7b1fbb60778ba1eaa61ab01a14 #v 0.4.2
SHA512 6af514465eaa98d5417de352bd3e4f3880180f886dc1202c64496cb5a07c82c377afeb9396acf57e20caa73e858fe7e6309f3ed7a74e88eb58e1da1f31ac0bd8
HEAD_REF master
PATCHES build.patch
)
file(TOUCH "${SOURCE_PATH}/m4/dummy")
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")

file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
endif()
13 changes: 13 additions & 0 deletions ports/xcb-util-wm/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "xcb-util-wm",
"version": "0.4.2",
"description": "XCB client and window-manager helpers for ICCCM & EWMH.",
"homepage": "https://gitlab.freedesktop.org/xorg/lib/libxcb-wm/",
"license": null,
"dependencies": [
"bzip2",
"xcb",
"xorg-macros",
"xproto"
]
}
31 changes: 31 additions & 0 deletions ports/xcb-util/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
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-util
REF acf790d7752f36e450d476ad79807d4012ec863b #v0.4.0
SHA512 d1ef49c1e16b7643a7afeca1495a96ab9ab9c537ea7669a13b3adda400a204626714afc8ed7fcc3d7532ebe1f89a3aa31e3ca0ee9617330d4df5b65b0c8e6dbc
HEAD_REF master
PATCHES ssize.patch
)

file(TOUCH "${SOURCE_PATH}/m4/dummy")
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")

file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
endif()
15 changes: 15 additions & 0 deletions ports/xcb-util/ssize.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/src/event.c b/src/event.c
index 88058c4e7..3bc0d635f 100644
--- a/src/event.c
+++ b/src/event.c
@@ -38,6 +38,10 @@

#include <sys/types.h>

+#if !defined ssize_t && defined(_WIN32)
+ #define ssize_t ptrdiff_t
+#endif
+
#define ssizeof(foo) (ssize_t)sizeof(foo)
#define countof(foo) (ssizeof(foo) / ssizeof(foo[0]))

12 changes: 12 additions & 0 deletions ports/xcb-util/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "xcb-util",
"version": "0.4.0",
"description": "C interface to the X Window System protocol, which replaces the traditional Xlib interface.",
"homepage": "https://xcb.freedesktop.org/",
"license": null,
"dependencies": [
"xcb",
"xcb-util-m4",
"xorg-macros"
]
}
22 changes: 21 additions & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -8016,18 +8016,38 @@
"baseline": "1.14",
"port-version": 0
},
"xcb-image": {
"baseline": "0.4.1",
"port-version": 0
},
"xcb-keysyms": {
"baseline": "0.4.1",
"port-version": 0
},
"xcb-proto": {
"baseline": "1.14.1",
"port-version": 0
},
"xcb-render-util": {
"baseline": "0.3.9",
"baseline": "0.3.10",
"port-version": 0
},
"xcb-util": {
"baseline": "0.4.0",
"port-version": 0
},
"xcb-util-errors": {
"baseline": "1.0.1",
"port-version": 0
},
"xcb-util-m4": {
"baseline": "2022-01-24",
"port-version": 0
},
"xcb-util-wm": {
"baseline": "0.4.2",
"port-version": 0
},
"xerces-c": {
"baseline": "3.2.3",
"port-version": 4
Expand Down
Loading

0 comments on commit 4aedc13

Please sign in to comment.