aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/xorg-macros
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/xorg-macros
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/xorg-macros')
-rw-r--r--vcpkg/ports/xorg-macros/portfile.cmake67
-rw-r--r--vcpkg/ports/xorg-macros/skip_rawcpp.patch43
-rw-r--r--vcpkg/ports/xorg-macros/vcpkg.json9
3 files changed, 119 insertions, 0 deletions
diff --git a/vcpkg/ports/xorg-macros/portfile.cmake b/vcpkg/ports/xorg-macros/portfile.cmake
new file mode 100644
index 0000000..e2c6e98
--- /dev/null
+++ b/vcpkg/ports/xorg-macros/portfile.cmake
@@ -0,0 +1,67 @@
+set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled)
+
+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 skip_rawcpp.patch)
+endif()
+
+vcpkg_from_gitlab(
+ GITLAB_URL https://gitlab.freedesktop.org/xorg
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO util/macros
+ REF b8766308d2f78bc572abe5198007cf7aeec9b761 #v1.19.3
+ SHA512 dc7383b1579dc6ef0473161764096c8161f23a4c4ba2182e7abd7f73f443eb0520e02f1dfaaba2f8ebb43e0ed93c1e6e5e7cf517561476b858d2471a8ecaf907
+ HEAD_REF master
+ PATCHES ${PATCHES}
+)
+
+vcpkg_configure_make(
+ AUTOCONFIG
+ SOURCE_PATH "${SOURCE_PATH}"
+)
+vcpkg_install_make()
+
+file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/share/xorg/")
+if(NOT CMAKE_HOST_WIN32)
+ file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/share/xorg/aclocal/")
+endif()
+
+file(RENAME "${CURRENT_PACKAGES_DIR}/share/${PORT}/aclocal/" "${CURRENT_PACKAGES_DIR}/share/xorg/aclocal")
+file(RENAME "${CURRENT_PACKAGES_DIR}/share/${PORT}/util-macros/" "${CURRENT_PACKAGES_DIR}/share/xorg/util-macros")
+
+file(READ "${CURRENT_PACKAGES_DIR}/share/${PORT}/pkgconfig/xorg-macros.pc" _contents)
+string(REPLACE "${CURRENT_PACKAGES_DIR}" "${CURRENT_INSTALLED_DIR}" _contents "${_contents}")
+string(REPLACE "datarootdir=\${prefix}/share" "datarootdir=\${prefix}/share/xorg" _contents "${_contents}")
+string(REPLACE "includedir=${CURRENT_INSTALLED_DIR}/include" "includedir=\${prefix}/include" _contents "${_contents}")
+file(WRITE "${CURRENT_PACKAGES_DIR}/share/pkgconfig/xorg-macros.pc" "${_contents}")
+file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/lib/")
+file(RENAME "${CURRENT_PACKAGES_DIR}/share/pkgconfig/" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig")
+file(REMOVE "${CURRENT_PACKAGES_DIR}/share/${PORT}/pkgconfig/xorg-macros.pc")
+
+if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/share/${PORT}/pkgconfig/xorg-macros.pc")
+ file(READ "${CURRENT_PACKAGES_DIR}/debug/share/${PORT}/pkgconfig/xorg-macros.pc" _contents)
+ string(REPLACE "${CURRENT_PACKAGES_DIR}/debug" "${CURRENT_INSTALLED_DIR}/debug" _contents "${_contents}")
+ string(REPLACE "datarootdir=\${prefix}/share}" "datarootdir=\${prefix}/share/xorg/debug}" _contents "${_contents}")
+ string(REPLACE "includedir=${CURRENT_INSTALLED_DIR}/debug/include" "includedir=\${prefix}/../include" _contents "${_contents}")
+ file(WRITE "${CURRENT_PACKAGES_DIR}/debug/share/pkgconfig/xorg-macros.pc" "${_contents}")
+ if(NOT CMAKE_HOST_WIN32)
+ file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/share/xorg/debug/")
+ endif()
+ file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/lib")
+ file(RENAME "${CURRENT_PACKAGES_DIR}/debug/share/pkgconfig/" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig")
+ file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/share/${PORT}/pkgconfig/xorg-macros.pc")
+ file(RENAME "${CURRENT_PACKAGES_DIR}/debug/share/" "${CURRENT_PACKAGES_DIR}/share/xorg/debug/")
+endif()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share/")
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share/${PORT}/pkgconfig")
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/xorg/debug/${PORT}/pkgconfig" "${CURRENT_PACKAGES_DIR}/share/${PORT}/pkgconfig")
+vcpkg_fixup_pkgconfig()
+
+# Handle copyright
+file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
+endif()
diff --git a/vcpkg/ports/xorg-macros/skip_rawcpp.patch b/vcpkg/ports/xorg-macros/skip_rawcpp.patch
new file mode 100644
index 0000000..3e5ce9a
--- /dev/null
+++ b/vcpkg/ports/xorg-macros/skip_rawcpp.patch
@@ -0,0 +1,43 @@
+diff --git a/xorg-macros.m4.in b/xorg-macros.m4.in
+index f0a16da3a..e1c0ff1ed 100644
+--- a/xorg-macros.m4.in
++++ b/xorg-macros.m4.in
+@@ -63,38 +63,6 @@ AC_PATH_TOOL(RAWCPP, [cpp], [${CPP}],
+ # Check for flag to avoid builtin definitions - assumes unix is predefined,
+ # which is not the best choice for supporting other OS'es, but covers most
+ # of the ones we need for now.
+-AC_MSG_CHECKING([if $RAWCPP requires -undef])
+-AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
+-if test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
+- AC_MSG_RESULT([no])
+-else
+- if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
+- RAWCPPFLAGS=-undef
+- AC_MSG_RESULT([yes])
+- # under Cygwin unix is still defined even with -undef
+- elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
+- RAWCPPFLAGS="-undef -ansi"
+- AC_MSG_RESULT([yes, with -ansi])
+- else
+- AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef. I don't know what to do.])
+- fi
+-fi
+-rm -f conftest.$ac_ext
+-
+-AC_MSG_CHECKING([if $RAWCPP requires -traditional])
+-AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve "whitespace"?]])])
+-if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then
+- AC_MSG_RESULT([no])
+-else
+- if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then
+- TRADITIONALCPPFLAGS="-traditional"
+- RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
+- AC_MSG_RESULT([yes])
+- else
+- AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional. I don't know what to do.])
+- fi
+-fi
+-rm -f conftest.$ac_ext
+ AC_SUBST(RAWCPPFLAGS)
+ AC_SUBST(TRADITIONALCPPFLAGS)
+ ]) # XORG_PROG_RAWCPP
diff --git a/vcpkg/ports/xorg-macros/vcpkg.json b/vcpkg/ports/xorg-macros/vcpkg.json
new file mode 100644
index 0000000..7a6bc23
--- /dev/null
+++ b/vcpkg/ports/xorg-macros/vcpkg.json
@@ -0,0 +1,9 @@
+{
+ "name": "xorg-macros",
+ "version": "1.19.3",
+ "port-version": 1,
+ "description": "X.org macros utilities.",
+ "homepage": "https://xcb.freedesktop.org/",
+ "license": null,
+ "supports": "!uwp"
+}