diff --git a/Ports/AvailablePorts.md b/Ports/AvailablePorts.md index d638557de3..a2048fdbe8 100644 --- a/Ports/AvailablePorts.md +++ b/Ports/AvailablePorts.md @@ -38,6 +38,7 @@ Please make sure to keep this list up to date when adding and updating ports. :^ | [`flatbuffers`](flatbuffers/) | Flatbuffers | 1.12.0 | https://github.com/google/flatbuffers | | [`flex`](flex/) | flex | 2.6.4 | https://github.com/westes/flex | | [`fotaq`](fotaq/) | Flight of the Amazon Queen | 1.0 | https://www.scummvm.org/games/#games-queen | +| [`fontconfig`](fontconfig/) | Fontconfig | 2.13.94 | https://www.freedesktop.org/wiki/Software/fontconfig/ | | [`ffmpeg`](ffmpeg/) | ffmpeg | 4.4 | https://ffmpeg.org | | [`freeciv`](freeciv/) | Freeciv | 3.0.0-beta2 | http://freeciv.org/ | | [`freetype`](freetype/) | FreeType | 2.10.4 | https://www.freetype.org/ | diff --git a/Ports/fontconfig/package.sh b/Ports/fontconfig/package.sh new file mode 100755 index 0000000000..25fa4cd290 --- /dev/null +++ b/Ports/fontconfig/package.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env -S bash ../.port_include.sh +port=fontconfig +version=2.13.94 +useconfigure="true" +depends=("libxml2") +files="https://www.freedesktop.org/software/fontconfig/release/fontconfig-${version}.tar.xz fontconfig-${version}.tar.xz a5f052cb73fd479ffb7b697980510903b563bbb55b8f7a2b001fcfb94026003c" +auth_type="sha256" +configopts=("--prefix=/usr/local" "--enable-libxml2" "LDFLAGS=-ldl -lxml2") + +export CFLAGS="-I${SERENITY_INSTALL_ROOT}/usr/local/include/libxml2" +export LIBXML2_CFLAGS="-I${SERENITY_INSTALL_ROOT}/usr/local/include/libxml2/" +export LIBXML2_LIBS="-lxml2" diff --git a/Ports/fontconfig/patches/config.sub.patch b/Ports/fontconfig/patches/config.sub.patch new file mode 100644 index 0000000000..dfd575bce5 --- /dev/null +++ b/Ports/fontconfig/patches/config.sub.patch @@ -0,0 +1,10 @@ +--- fontconfig-2.13.94/config.sub.orig 2021-10-24 19:47:39.283922896 -0700 ++++ fontconfig-2.13.94/config.sub 2021-10-24 19:47:56.679967977 -0700 +@@ -1334,6 +1334,7 @@ + # Each alternative MUST end in a * to match a version number. + # sysv* is not here because it comes later, after sysvr4. + gnu* | bsd* | mach* | minix* | genix* | ultrix* | irix* \ ++ | serenity* \ + | *vms* | esix* | aix* | cnk* | sunos | sunos[34]*\ + | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \ + | sym* | kopensolaris* | plan9* \ diff --git a/Ports/fontconfig/patches/fccompat.c.patch b/Ports/fontconfig/patches/fccompat.c.patch new file mode 100644 index 0000000000..6076526821 --- /dev/null +++ b/Ports/fontconfig/patches/fccompat.c.patch @@ -0,0 +1,67 @@ +--- fontconfig-2.13.94/src/fccompat.c 2021-10-24 21:16:27.503925061 -0700 ++++ fontconfig-2.13.94/src/fccompat.c 2021-10-24 21:16:21.115917517 -0700 +@@ -184,54 +184,6 @@ + { + int32_t result; + +-#if HAVE_RANDOM_R +- static struct random_data fcrandbuf; +- static char statebuf[256]; +- static FcBool initialized = FcFalse; +-#ifdef _AIX +- static char *retval; +- long res; +-#endif +- +- if (initialized != FcTrue) +- { +-#ifdef _AIX +- initstate_r (time (NULL), statebuf, 256, &retval, &fcrandbuf); +-#else +- initstate_r (time (NULL), statebuf, 256, &fcrandbuf); +-#endif +- initialized = FcTrue; +- } +- +-#ifdef _AIX +- random_r (&res, &fcrandbuf); +- result = (int32_t)res; +-#else +- random_r (&fcrandbuf, &result); +-#endif +-#elif HAVE_RANDOM +- static char statebuf[256]; +- char *state; +- static FcBool initialized = FcFalse; +- +- if (initialized != FcTrue) +- { +- state = initstate (time (NULL), statebuf, 256); +- initialized = FcTrue; +- } +- else +- state = setstate (statebuf); +- +- result = random (); +- +- setstate (state); +-#elif HAVE_LRAND48 +- result = lrand48 (); +-#elif HAVE_RAND_R +- static unsigned int seed = time (NULL); +- +- result = rand_r (&seed); +-#elif HAVE_RAND + static FcBool initialized = FcFalse; + + if (initialized != FcTrue) +@@ -240,9 +192,6 @@ + initialized = FcTrue; + } + result = rand (); +-#else +-# error no random number generator function available. +-#endif + + return result; + }