From cdb07d996072dac664a15a64f306c108343cbcc1 Mon Sep 17 00:00:00 2001 From: Sergii Pylypenko Date: Wed, 5 May 2021 22:49:07 +0300 Subject: [PATCH] Emscripten: fixed fontconfig compilation --- os/emscripten/emscripten-build.sh | 33 ++++++++++++++++----------- os/emscripten/fontconfig-2.13.1.patch | 13 +++++++++++ 2 files changed, 33 insertions(+), 13 deletions(-) create mode 100644 os/emscripten/fontconfig-2.13.1.patch diff --git a/os/emscripten/emscripten-build.sh b/os/emscripten/emscripten-build.sh index 948b46daab..b0ca9d63ee 100755 --- a/os/emscripten/emscripten-build.sh +++ b/os/emscripten/emscripten-build.sh @@ -23,8 +23,10 @@ cd build-wasm-$BUILD_TYPE embuilder build liblzma ogg vorbis zlib sdl2 freetype icu harfbuzz embuilder build --lto liblzma ogg vorbis zlib sdl2 freetype icu harfbuzz +autoreconf -V || exit 1 + [ -e libtimidity-0.2.7/build-wasm/lib/libtimidity.a ] || { - wget https://sourceforge.net/projects/libtimidity/files/libtimidity/0.2.7/libtimidity-0.2.7.tar.gz || exit 1 + wget -nc https://sourceforge.net/projects/libtimidity/files/libtimidity/0.2.7/libtimidity-0.2.7.tar.gz || exit 1 tar xvf libtimidity-0.2.7.tar.gz || exit 1 cd libtimidity-0.2.7 || exit 1 autoreconf -fi @@ -42,7 +44,7 @@ embuilder build --lto liblzma ogg vorbis zlib sdl2 freetype icu harfbuzz } [ -e expat-2.3.0/build-wasm/lib/libexpat.a ] || { - wget https://github.com/libexpat/libexpat/releases/download/R_2_3_0/expat-2.3.0.tar.gz || exit 1 + wget -nc https://github.com/libexpat/libexpat/releases/download/R_2_3_0/expat-2.3.0.tar.gz || exit 1 tar xvf expat-2.3.0.tar.gz || exit 1 cd expat-2.3.0 autoreconf -fi @@ -60,7 +62,7 @@ embuilder build --lto liblzma ogg vorbis zlib sdl2 freetype icu harfbuzz } [ -e libuuid-1.0.3/build-wasm/lib/libuuid.a ] || { - wget https://sourceforge.net/projects/libuuid/files/libuuid-1.0.3.tar.gz || exit 1 + wget -nc https://sourceforge.net/projects/libuuid/files/libuuid-1.0.3.tar.gz || exit 1 tar xvf libuuid-1.0.3.tar.gz || exit 1 cd libuuid-1.0.3 autoreconf -fi @@ -77,25 +79,30 @@ embuilder build --lto liblzma ogg vorbis zlib sdl2 freetype icu harfbuzz } [ -e fontconfig-2.13.1/build-wasm/lib/libfontconfig.a ] || { - wget https://www.freedesktop.org/software/fontconfig/release/fontconfig-2.13.1.tar.gz || exit 1 + wget -nc https://www.freedesktop.org/software/fontconfig/release/fontconfig-2.13.1.tar.gz || exit 1 tar xvf fontconfig-2.13.1.tar.gz || exit 1 cd fontconfig-2.13.1 + # Tests do not compile, disable them + #sed -i 's/po-conf test/po-conf/' Makefile.am + patch -p1 < ../../os/emscripten/fontconfig-2.13.1.patch || exit 1 autoreconf -fi OPT="-O3 -flto=thin" [ "$BUILD_TYPE" = "Debug" ] && OPT="-g" emconfigure ./configure --prefix=`pwd`/build-wasm \ --disable-shared --enable-static \ + --disable-docs cross_compiling=yes \ + ac_cv_func_fstatfs=no ac_cv_func_fstatvfs=no \ FREETYPE_CFLAGS="-I`em-config EMSCRIPTEN_ROOT`/cache/sysroot/include/freetype2 \ -I`em-config EMSCRIPTEN_ROOT`/cache/sysroot/include/freetype2/freetype" \ FREETYPE_LIBS="-lfreetype" \ EXPAT_CFLAGS="-I`pwd`/../expat-2.3.0/build-wasm/include" \ - EXPAT_LIBS="`pwd`/../expat-2.3.0/build-wasm/lib/libexpat.a" \ + EXPAT_LIBS="-L`pwd`/../expat-2.3.0/build-wasm/lib -lexpat" \ UUID_CFLAGS="-I`pwd`/../libuuid-1.0.3/build-wasm/include" \ - UUID_LIBS="`pwd`/../libuuid-1.0.3/build-wasm/lib/libuuid.a" \ + UUID_LIBS="-L`pwd`/../libuuid-1.0.3/build-wasm/lib -luuid" \ CFLAGS="$OPT" \ LDFLAGS="$OPT" \ || exit 1 - make -j8 || exit 1 + make -j8 V=1 || exit 1 make install || exit 1 cd .. } @@ -112,21 +119,21 @@ embuilder build --lto liblzma ogg vorbis zlib sdl2 freetype icu harfbuzz mkdir -p baseset [ -e baseset/opengfx-0.6.1.tar ] || { - wget https://cdn.openttd.org/opengfx-releases/0.6.1/opengfx-0.6.1-all.zip || exit 1 + wget -nc https://cdn.openttd.org/opengfx-releases/0.6.1/opengfx-0.6.1-all.zip || exit 1 unzip opengfx-0.6.1-all.zip || exit 1 rm opengfx-0.6.1-all.zip mv opengfx-0.6.1.tar baseset/ || exit 1 } [ -e baseset/opensfx-1.0.1.tar ] || { - wget https://cdn.openttd.org/opensfx-releases/1.0.1/opensfx-1.0.1-all.zip || exit 1 + wget -nc https://cdn.openttd.org/opensfx-releases/1.0.1/opensfx-1.0.1-all.zip || exit 1 unzip opensfx-1.0.1-all.zip || exit 1 rm opensfx-1.0.1-all.zip mv opensfx-1.0.1.tar baseset/ || exit 1 } [ -e baseset/openmsx-0.4.0 ] || { - wget https://cdn.openttd.org/openmsx-releases/0.4.0/openmsx-0.4.0-all.zip || exit 1 + wget -nc https://cdn.openttd.org/openmsx-releases/0.4.0/openmsx-0.4.0-all.zip || exit 1 unzip openmsx-0.4.0-all.zip || exit 1 rm openmsx-0.4.0-all.zip cd baseset || exit 1 @@ -140,17 +147,17 @@ mkdir -p baseset } [ -e fonts ] || { - wget https://sourceforge.net/projects/libsdl-android/files/openttd-fonts.zip || exit 1 + wget -nc https://sourceforge.net/projects/libsdl-android/files/openttd-fonts.zip || exit 1 unzip openttd-fonts.zip || exit 1 rm openttd-fonts.zip } #[ -e TimGM6mb.sf2 ] || { -# wget 'https://sourceforge.net/p/mscore/code/HEAD/tree/trunk/mscore/share/sound/TimGM6mb.sf2?format=raw' -O TimGM6mb.sf2 || exit 1 +# wget -nc 'https://sourceforge.net/p/mscore/code/HEAD/tree/trunk/mscore/share/sound/TimGM6mb.sf2?format=raw' -O TimGM6mb.sf2 || exit 1 #} [ -e timidity/timidity.cfg ] || { - wget https://sourceforge.net/projects/libsdl-android/files/timidity.zip || exit 1 + wget -nc https://sourceforge.net/projects/libsdl-android/files/timidity.zip || exit 1 unzip timidity.zip } diff --git a/os/emscripten/fontconfig-2.13.1.patch b/os/emscripten/fontconfig-2.13.1.patch new file mode 100644 index 0000000000..ccf0225d17 --- /dev/null +++ b/os/emscripten/fontconfig-2.13.1.patch @@ -0,0 +1,13 @@ +Only in fontconfig-2.13.1-new: Makefile +diff -u -r fontconfig-2.13.1/Makefile.am fontconfig-2.13.1-new/Makefile.am +--- fontconfig-2.13.1/Makefile.am 2018-06-05 13:36:38.000000000 +0300 ++++ fontconfig-2.13.1-new/Makefile.am 2021-05-05 22:32:49.230804234 +0300 +@@ -24,7 +24,7 @@ + SUBDIRS=fontconfig fc-case fc-lang src \ + fc-cache fc-cat fc-conflist fc-list fc-match \ + fc-pattern fc-query fc-scan fc-validate conf.d \ +- its po po-conf test ++ its po po-conf + if ENABLE_DOCS + SUBDIRS += doc + endif