Do not use builtin_popcount in cairo and fontconfig, and fix rust-cairo

This commit is contained in:
Jeremy Soller 2019-10-02 19:57:36 -06:00
parent 728253812d
commit acce8a953c
No known key found for this signature in database
GPG Key ID: E988B49EE78A7FB1
3 changed files with 32 additions and 6 deletions

12
recipes/cairo/redox.patch Normal file
View File

@ -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;

View File

@ -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 */

View File

@ -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
}