From acce8a953c00b926d8a9b3da36c063c0d01303dc Mon Sep 17 00:00:00 2001 From: Jeremy Soller <jeremy@system76.com> Date: Wed, 2 Oct 2019 19:57:36 -0600 Subject: [PATCH] Do not use builtin_popcount in cairo and fontconfig, and fix rust-cairo --- recipes/cairo/redox.patch | 12 ++++++++++++ recipes/fontconfig/redox.patch | 14 +++++++++++++- recipes/rust-cairo/recipe.sh | 12 +++++++----- 3 files changed, 32 insertions(+), 6 deletions(-) create mode 100644 recipes/cairo/redox.patch diff --git a/recipes/cairo/redox.patch b/recipes/cairo/redox.patch new file mode 100644 index 000000000..d02e163c2 --- /dev/null +++ b/recipes/cairo/redox.patch @@ -0,0 +1,12 @@ +diff -ruwN source/src/cairoint.h source-new/src/cairoint.h +--- source/src/cairoint.h 2018-08-16 19:10:53.000000000 -0600 ++++ source-new/src/cairoint.h 2019-10-02 19:55:59.131388156 -0600 +@@ -187,7 +187,7 @@ + static inline int cairo_const + _cairo_popcount (uint32_t mask) + { +-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) ++#if !defined(__redox__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) + return __builtin_popcount (mask); + #else + register int y; diff --git a/recipes/fontconfig/redox.patch b/recipes/fontconfig/redox.patch index 7e9e74724..6beccc26e 100644 --- a/recipes/fontconfig/redox.patch +++ b/recipes/fontconfig/redox.patch @@ -1,6 +1,6 @@ diff -ruwN source/src/fccache.c source-new/src/fccache.c --- source/src/fccache.c 2019-06-10 05:36:37.000000000 -0600 -+++ source-new/src/fccache.c 2019-07-16 17:13:18.730013599 -0600 ++++ source-new/src/fccache.c 2019-10-02 19:48:10.459642095 -0600 @@ -1526,7 +1526,7 @@ #if defined(_WIN32) if (_locking (fd, _LK_LOCK, 1) == -1) @@ -19,3 +19,15 @@ diff -ruwN source/src/fccache.c source-new/src/fccache.c struct flock fl; fl.l_type = F_UNLCK; +diff -ruwN source/src/fccharset.c source-new/src/fccharset.c +--- source/src/fccharset.c 2018-06-05 04:36:38.000000000 -0600 ++++ source-new/src/fccharset.c 2019-10-02 19:48:53.082862133 -0600 +@@ -600,7 +600,7 @@ + static FcChar32 + FcCharSetPopCount (FcChar32 c1) + { +-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) ++#if !defined(__redox__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) + return __builtin_popcount (c1); + #else + /* hackmem 169 */ diff --git a/recipes/rust-cairo/recipe.sh b/recipes/rust-cairo/recipe.sh index f2fea6aae..8de117da2 100644 --- a/recipes/rust-cairo/recipe.sh +++ b/recipes/rust-cairo/recipe.sh @@ -1,5 +1,5 @@ GIT=https://gitlab.redox-os.org/redox-os/rust-cairo.git -BUILD_DEPENDS=(cairo zlib pixman freetype libpng) +BUILD_DEPENDS=(cairo expat fontconfig freetype libpng pixman zlib) CARGOFLAGS="--example gui" function recipe_build { @@ -9,10 +9,12 @@ function recipe_build { -- \ -L "${sysroot}/lib" \ -l cairo \ - -l pixman-1 \ - -l freetype \ - -l png \ - -l z + -l fontconfig \ + -l expat \ + -l pixman-1 \ + -l freetype \ + -l png \ + -l z skip=1 } -- GitLab