aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/font-util
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/font-util
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/font-util')
-rw-r--r--vcpkg/ports/font-util/build.patch33
-rw-r--r--vcpkg/ports/font-util/portfile.cmake57
-rw-r--r--vcpkg/ports/font-util/vcpkg.json10
3 files changed, 100 insertions, 0 deletions
diff --git a/vcpkg/ports/font-util/build.patch b/vcpkg/ports/font-util/build.patch
new file mode 100644
index 0000000..72fa5fa
--- /dev/null
+++ b/vcpkg/ports/font-util/build.patch
@@ -0,0 +1,33 @@
+diff --git a/bdftruncate.c b/bdftruncate.c
+index 2b317c0b0..3ab84978f 100644
+--- a/bdftruncate.c
++++ b/bdftruncate.c
+@@ -40,7 +40,13 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+-
++#if defined(_MSC_VER)
++# if defined(_M_X64) || defined(_M_ARM64)
++# define SSIZE_MAX LLONG_MAX
++# else
++# define SSIZE_MAX LONG_MAX
++# endif
++#endif
+ #if (defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 205)) \
+ || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
+ # define ATTR_NORETURN __attribute((noreturn))
+diff --git a/ucs2any.c b/ucs2any.c
+index 1f575d14f..75b662b3d 100644
+--- a/ucs2any.c
++++ b/ucs2any.c
+@@ -49,7 +49,9 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#ifdef HAVE_UNISTD_H
+ #include <unistd.h>
++#endif
+
+ /* global variable for argv[0] */
+ static const char *my_name = NULL;
diff --git a/vcpkg/ports/font-util/portfile.cmake b/vcpkg/ports/font-util/portfile.cmake
new file mode 100644
index 0000000..c4a84b9
--- /dev/null
+++ b/vcpkg/ports/font-util/portfile.cmake
@@ -0,0 +1,57 @@
+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()
+
+vcpkg_from_gitlab(
+ GITLAB_URL https://gitlab.freedesktop.org/xorg
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO font/util
+ REF "font-util-${VERSION}"
+ SHA512 93285c2e8c5c01f069a7621dba0bbb1175c0ebbea27d521395b40f036443c162fc1948c4d3cb34fe6c509d1818d95ed7e6d38919e3f7857dfa53e388aadb9128
+ HEAD_REF master
+ PATCHES build.patch
+)
+
+set(ENV{ACLOCAL} "aclocal -I \"${CURRENT_INSTALLED_DIR}/share/xorg/aclocal/\"")
+
+if(VCPKG_TARGET_IS_WINDOWS)
+ list(APPEND VCPKG_C_FLAGS " /DNEED_BASENAME")
+ list(APPEND VCPKG_CXX_FLAGS " /DNEED_BASENAME")
+endif()
+
+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(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/share/xorg/")
+file(RENAME "${CURRENT_PACKAGES_DIR}/share/${PORT}/aclocal/" "${CURRENT_PACKAGES_DIR}/share/xorg/aclocal")
+file(RENAME "${CURRENT_PACKAGES_DIR}/share/${PORT}/fonts/" "${CURRENT_PACKAGES_DIR}/share/xorg/fonts")
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/debug")
+
+set(_file "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/fontutil.pc")
+file(READ "${_file}" _contents)
+string(REPLACE "datarootdir=\${prefix}/share/${PORT}" "datarootdir=\${prefix}/share/xorg" _contents "${_contents}")
+string(REPLACE "exec_prefix=\${prefix}" "exec_prefix=\${prefix}/tools/${PORT}" _contents "${_contents}")
+file(WRITE "${_file}" "${_contents}")
+
+if(NOT VCPKG_BUILD_TYPE)
+ set(_file "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/fontutil.pc")
+ file(READ "${_file}" _contents)
+ string(REPLACE "datarootdir=\${prefix}/share/${PORT}" "datarootdir=\${prefix}/../share/xorg" _contents "${_contents}")
+ string(REPLACE "exec_prefix=\${prefix}" "exec_prefix=\${prefix}/../tools/${PORT}" _contents "${_contents}")
+ file(WRITE "${_file}" "${_contents}")
+endif()
+# Handle copyright
+file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME "copyright")
+endif()
diff --git a/vcpkg/ports/font-util/vcpkg.json b/vcpkg/ports/font-util/vcpkg.json
new file mode 100644
index 0000000..0adc619
--- /dev/null
+++ b/vcpkg/ports/font-util/vcpkg.json
@@ -0,0 +1,10 @@
+{
+ "name": "font-util",
+ "version": "1.4.1",
+ "description": "X.Org font package creation/installation utilities",
+ "homepage": "https://gitlab.freedesktop.org/xorg/font/util",
+ "license": null,
+ "dependencies": [
+ "xorg-macros"
+ ]
+}