summaryrefslogtreecommitdiff
path: root/Ports/fontconfig
diff options
context:
space:
mode:
authorBrendan Coles <bcoles@gmail.com>2021-10-26 11:34:34 +0000
committerAndreas Kling <kling@serenityos.org>2021-10-28 11:25:56 +0200
commitc1511ebbead1e09da09ead41e86e1bc41240529b (patch)
tree2e52a40f32597bd678eafeb34938c42db7339aa4 /Ports/fontconfig
parenta8bd78e634f9ef1ff9c47d6764338ecd00700991 (diff)
downloadserenity-c1511ebbead1e09da09ead41e86e1bc41240529b.zip
Ports: Add Fontconfig port
Diffstat (limited to 'Ports/fontconfig')
-rwxr-xr-xPorts/fontconfig/package.sh12
-rw-r--r--Ports/fontconfig/patches/config.sub.patch10
-rw-r--r--Ports/fontconfig/patches/fccompat.c.patch67
3 files changed, 89 insertions, 0 deletions
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;
+ }