Skip to content

Commit

Permalink
More cairo details
Browse files Browse the repository at this point in the history
Signed-off-by: falkTX <falktx@falktx.com>
  • Loading branch information
falkTX committed Dec 11, 2022
1 parent bd55266 commit 3ce0800
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/bootstrap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:

env:
CACHE_VERSION: 19
CACHE_VERSION: 20
DEBIAN_FRONTEND: noninteractive
HOMEBREW_NO_AUTO_UPDATE: 1

Expand Down
2 changes: 1 addition & 1 deletion bootstrap-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ fi # PAWPAW_SKIP_SAMPLERATE

if [ "${MACOS}" -eq 0 ]; then
git_clone zlib "${ZLIB_VERSION}" "${ZLIB_URL}"
build_conf zlib "${ZLIB_VERSION}" "--static --prefix=${PAWPAW_PREFIX}"
build_conf zlib "${ZLIB_VERSION}" "--static --prefix=${PAWPAW_PREFIX} --zprefix"

if [ "${CROSS_COMPILING}" -eq 0 ]; then
run_make zlib "${ZLIB_VERSION}" check
Expand Down
13 changes: 12 additions & 1 deletion bootstrap-plugins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,11 @@ if [ "${MACOS}" -eq 0 ]; then
FONTCONFIG_EXTRAFLAGS+=" --enable-libxml2"
fi

# workaround missing implementation, see https://github.com/emscripten-core/emscripten/issues/12093
if [ "${WASM}" -eq 1 ]; then
export EXTRA_CFLAGS="-Duuid_generate_random=uuid_generate"
fi

download fontconfig "${FONTCONFIG_VERSION}" "${FONTCONFIG_URL}"
build_autoconf fontconfig "${FONTCONFIG_VERSION}" "${FONTCONFIG_EXTRAFLAGS}"

Expand Down Expand Up @@ -235,9 +240,15 @@ else
CAIRO_EXTRAFLAGS+=" --disable-win32-font"
fi

if [ "${WASM}" -eq 1 ]; then
CAIRO_EXTRAFLAGS+=" ax_cv_c_float_words_bigendian=no"
fi

# fix link of test suite
if [ "${MACOS}" -eq 1 ]; then
# fix link of test suite
export EXTRA_LDFLAGS="-framework CoreFoundation -framework CoreGraphics"
elif [ "${WIN32}" -eq 1 ]; then
export EXTRA_CFLAGS="-Dstrndup=_strndup"
fi

download cairo "${CAIRO_VERSION}" "${CAIRO_URL}" "tar.xz"
Expand Down
36 changes: 36 additions & 0 deletions patches/cairo/01_undef-zlib-deflate-macro.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
diff --git a/util/cairo-script/cairo-script-file.c b/util/cairo-script/cairo-script-file.c
index e7c5376..9ef7ded 100644
--- a/util/cairo-script/cairo-script-file.c
+++ b/util/cairo-script/cairo-script-file.c
@@ -40,6 +40,7 @@
#include <limits.h> /* INT_MAX */
#include <string.h>
#include <zlib.h>
+#undef deflate

#if HAVE_LZO
#include <lzo/lzo2a.h>
diff --git a/util/cairo-script/cairo-script-operators.c b/util/cairo-script/cairo-script-operators.c
index e493311..3d30e7b 100644
--- a/util/cairo-script/cairo-script-operators.c
+++ b/util/cairo-script/cairo-script-operators.c
@@ -57,6 +57,7 @@

#if HAVE_ZLIB
#include <zlib.h>
+#undef deflate
#endif

#if HAVE_LZO
diff --git a/util/cairo-script/cairo-script-scanner.c b/util/cairo-script/cairo-script-scanner.c
index 3dfb3a9..fb5e063 100644
--- a/util/cairo-script/cairo-script-scanner.c
+++ b/util/cairo-script/cairo-script-scanner.c
@@ -44,6 +44,7 @@
#include <string.h> /* memset */
#include <assert.h>
#include <zlib.h>
+#undef deflate

#if HAVE_LZO
#include <lzo/lzo2a.h>
13 changes: 13 additions & 0 deletions patches/fontconfig/03_fix-wasm-build.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/src/fcstat.c b/src/fcstat.c
index 5aa1643..d1240c5 100644
--- a/src/fcstat.c
+++ b/src/fcstat.c
@@ -384,7 +384,7 @@ FcFStatFs (int fd, FcStatFS *statb)
# endif
# if defined(HAVE_STRUCT_STATFS_F_FSTYPENAME)
p = buf.f_fstypename;
-# elif defined(__linux__)
+# elif defined(__linux__) || defined(__EMSCRIPTEN__)
switch (buf.f_type)
{
case 0x6969: /* nfs */

0 comments on commit 3ce0800

Please sign in to comment.