diff options
Diffstat (limited to 'vcpkg/ports/libxfont')
| -rw-r--r-- | vcpkg/ports/libxfont/build.patch | 38 | ||||
| -rw-r--r-- | vcpkg/ports/libxfont/build2.patch | 49 | ||||
| -rw-r--r-- | vcpkg/ports/libxfont/configure.patch | 37 | ||||
| -rw-r--r-- | vcpkg/ports/libxfont/portfile.cmake | 52 | ||||
| -rw-r--r-- | vcpkg/ports/libxfont/vcpkg.json | 19 |
5 files changed, 195 insertions, 0 deletions
diff --git a/vcpkg/ports/libxfont/build.patch b/vcpkg/ports/libxfont/build.patch new file mode 100644 index 0000000..27179ae --- /dev/null +++ b/vcpkg/ports/libxfont/build.patch @@ -0,0 +1,38 @@ +diff --git a/Makefile.am b/Makefile.am +index 5af2e237a..e75fd1755 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -159,14 +159,14 @@ endif + EXTRA_DIST = src/builtins/buildfont README.md + + # Test utilities +-EXTRA_DIST += test/utils/README ++# EXTRA_DIST += test/utils/README + +-TEST_UTIL_SRCS = test/utils/font-test-utils.c test/utils/font-test-utils.h ++# TEST_UTIL_SRCS = test/utils/font-test-utils.c test/utils/font-test-utils.h + +-noinst_PROGRAMS = lsfontdir ++# noinst_PROGRAMS = lsfontdir + +-lsfontdir_SOURCES = test/utils/lsfontdir.c $(TEST_UTIL_SRCS) +-lsfontdir_LDADD = libXfont2.la $(LTLIBOBJS) ++# lsfontdir_SOURCES = test/utils/lsfontdir.c $(TEST_UTIL_SRCS) ++# lsfontdir_LDADD = libXfont2.la $(LTLIBOBJS) + + + MAINTAINERCLEANFILES = ChangeLog INSTALL +diff --git a/include/X11/fonts/fontmisc.h b/include/X11/fonts/fontmisc.h +index 06e49f5f0..6b68dfcb8 100644 +--- a/include/X11/fonts/fontmisc.h ++++ b/include/X11/fonts/fontmisc.h +@@ -34,7 +34,9 @@ in this Software without prior written authorization from The Open Group. + #include <X11/Xfuncs.h> + #include <stdlib.h> + #include <stdio.h> ++#ifdef HAVE_UNISTD_H + #include <unistd.h> ++#endif + #include <X11/Xdefs.h> + + diff --git a/vcpkg/ports/libxfont/build2.patch b/vcpkg/ports/libxfont/build2.patch new file mode 100644 index 0000000..420f372 --- /dev/null +++ b/vcpkg/ports/libxfont/build2.patch @@ -0,0 +1,49 @@ +diff --git a/src/FreeType/ftenc.c b/src/FreeType/ftenc.c +index 5b0299345..5abffb6e0 100644 +--- a/src/FreeType/ftenc.c ++++ b/src/FreeType/ftenc.c +@@ -41,6 +41,10 @@ THE SOFTWARE. + #include FT_XFREE86_H + #include "ft.h" + ++#if (defined(WIN32) || defined(WIN64) || defined(_WIN32) || defined(_WIN64)) && !defined(HAVE_STRCASECMP) ++#define strcasecmp _stricmp ++#endif ++ + static int find_cmap(int, int, int, FT_Face, FT_CharMap *); + + static int +diff --git a/src/FreeType/xttcap.c b/src/FreeType/xttcap.c +index f54f76c85..a5a047ee6 100644 +--- a/src/FreeType/xttcap.c ++++ b/src/FreeType/xttcap.c +@@ -56,6 +56,10 @@ static char const * const releaseID = + + #include "xttcap.h" + ++#if (defined(WIN32) || defined(WIN64) || defined(_WIN32) || defined(_WIN64)) && !defined(HAVE_STRCASECMP) ++#define strcasecmp _stricmp ++#endif ++ + + /************************************************************************** + Private Data Types +diff --git a/src/fontfile/renderers.c b/src/fontfile/renderers.c +index a457fb7bb..c44591f13 100644 +--- a/src/fontfile/renderers.c ++++ b/src/fontfile/renderers.c +@@ -31,10 +31,13 @@ in this Software without prior written authorization from The Open Group. + #ifdef HAVE_CONFIG_H + #include <config.h> + #endif ++#include <string.h> + #include "libxfontint.h" + #include "src/util/replace.h" + #include <X11/fonts/fntfilst.h> +- ++#if (defined(WIN32) || defined(WIN64) || defined(_WIN32) || defined(_WIN64)) && !defined(HAVE_STRCASECMP) ++#define strcasecmp _stricmp ++#endif + static FontRenderersRec renderers; + + /* diff --git a/vcpkg/ports/libxfont/configure.patch b/vcpkg/ports/libxfont/configure.patch new file mode 100644 index 0000000..7a9dcd3 --- /dev/null +++ b/vcpkg/ports/libxfont/configure.patch @@ -0,0 +1,37 @@ +diff --git a/configure.ac b/configure.ac +index f507c285a..a821e7311 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -122,14 +122,14 @@ AC_SUBST(FREETYPE_REQUIRES) + AC_DEFINE(X_GZIP_FONT_COMPRESSION,1,[Support gzip for bitmap fonts]) + X_GZIP_FONT_COMPRESSION=1 + AC_SUBST(X_GZIP_FONT_COMPRESSION) +-AC_CHECK_LIB(z, gzopen, [Z_LIBS=-lz], AC_MSG_ERROR([*** zlib is required])) ++AC_SEARCH_LIBS(gzopen, [z zlib zlibd] , [Z_LIBS="$ac_cv_search_gzopen"], AC_MSG_ERROR([*** zlib is required])) + + AC_ARG_WITH(bzip2, + AS_HELP_STRING([--with-bzip2], + [Use libbz2 to support bzip2 compressed bitmap fonts (default: no)]), + [], [with_bzip2=no]) + if test "x$with_bzip2" = xyes; then +- AC_CHECK_LIB(bz2, BZ2_bzopen, [Z_LIBS="$Z_LIBS -lbz2"], ++ AC_SEARCH_LIBS(BZ2_bzopen, [bz2 bz2d], [Z_LIBS="$Z_LIBS $ac_cv_search_BZ2_bzopen"], + AC_MSG_ERROR([*** libbz2 is required for bzip2 support])) + AC_DEFINE(X_BZIP2_FONT_COMPRESSION,1,[Support bzip2 for bitmap fonts]) + fi +@@ -204,8 +204,13 @@ if test "x$XFONT_FC" = xyes; then + fi + + +-AC_CHECK_LIB(m, hypot, [MATH_LIBS=-lm +-AC_SUBST(MATH_LIBS)], AC_MSG_ERROR([*** libm is required])) ++AC_SEARCH_LIBS([hypot], [m], [MATH_LIBS=-lm AC_SUBST(MATH_LIBS)], ++[if test "x$ac_cv_search_hypot" != "xnone required"; then ++ AC_MSG_ERROR([*** libm is required]) ++else ++ AC_MSG_ERROR([*** libm is not required]) ++fi] ++) + + PKG_CHECK_MODULES(XFONT, [xproto xtrans fontsproto >= 2.1.3 fontenc]) + diff --git a/vcpkg/ports/libxfont/portfile.cmake b/vcpkg/ports/libxfont/portfile.cmake new file mode 100644 index 0000000..4769a7b --- /dev/null +++ b/vcpkg/ports/libxfont/portfile.cmake @@ -0,0 +1,52 @@ +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/libxfont
+ REF 3a4f68284c5aeea77789af1fe395cac35efc8562 # 2.0.5
+ SHA512 d9731b50a55c3bceadb0abb4530a673940432467402829559229cfa946105270970db0b7663b72e64279b4b6f8a82b594549d8987205e581de19e55710fec15f
+ HEAD_REF master
+ PATCHES build.patch
+ build2.patch
+ configure.patch
+)
+
+set(ENV{ACLOCAL} "aclocal -I \"${CURRENT_INSTALLED_DIR}/share/xorg/aclocal/\"")
+if(VCPKG_TARGET_IS_WINDOWS)
+ string(APPEND VCPKG_CXX_FLAGS " /D_WILLWINSOCK_") # /showIncludes are not passed on so I cannot figure out which header is responsible for this
+ string(APPEND VCPKG_C_FLAGS " /D_WILLWINSOCK_")
+endif()
+vcpkg_configure_make(
+ SOURCE_PATH "${SOURCE_PATH}"
+ AUTOCONFIG
+ OPTIONS ${OPTIONS}
+ --with-bzip2=yes
+ OPTIONS_DEBUG ${DEPS_DEBUG}
+ OPTIONS_RELEASE ${DEPS_RELEASE}
+)
+
+vcpkg_install_make()
+if(VCPKG_TARGET_IS_WINDOWS)
+ set(_file "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/xfont2.pc")
+ file(READ "${_file}" _contents)
+ string(REPLACE "-lm" "" _contents "${_contents}")
+ file(WRITE "${_file}" "${_contents}")
+ if(NOT VCPKG_BUILD_TYPE)
+ set(_file "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/xfont2.pc")
+ file(READ "${_file}" _contents)
+ string(REPLACE "-lm" "" _contents "${_contents}")
+ file(WRITE "${_file}" "${_contents}")
+ endif()
+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)
+endif()
diff --git a/vcpkg/ports/libxfont/vcpkg.json b/vcpkg/ports/libxfont/vcpkg.json new file mode 100644 index 0000000..c200e47 --- /dev/null +++ b/vcpkg/ports/libxfont/vcpkg.json @@ -0,0 +1,19 @@ +{ + "name": "libxfont", + "version": "2.0.5", + "port-version": 1, + "description": "X font handling library for server & utilities", + "homepage": "https://gitlab.freedesktop.org/xorg/lib/libxfont", + "license": null, + "dependencies": [ + "bzip2", + "freetype", + "libfontenc", + "libx11", + "libxext", + "xorg-macros", + "xproto", + "xtrans", + "zlib" + ] +} |