From b5524f6ea7367ba8d485da6d8234a234ae807afb Mon Sep 17 00:00:00 2001 From: Ghabry Date: Fri, 28 Jul 2023 00:10:53 +0200 Subject: [PATCH 1/4] Add inih and lhasa --- 3ds/1_download_library.sh | 8 ++++++ 3ds/2_build_toolchain.sh | 7 +++++ LICENSE | 2 ++ android/1_download_library.sh | 8 ++++++ android/2_build_toolchain.sh | 2 ++ emscripten/1_download_library.sh | 8 ++++++ emscripten/2_build_toolchain.sh | 2 ++ emscripten/meson-cross.txt | 16 +++++++++++ ios/1_download_library.sh | 8 ++++++ ios/2_build_toolchain.sh | 2 ++ linux-static/1_download_library.sh | 8 ++++++ linux-static/2_build_toolchain.sh | 2 ++ macos/1_download_library.sh | 8 ++++++ macos/2_build_toolchain.sh | 2 ++ shared/add_lib.sh | 13 ++++----- shared/common.sh | 20 +++++++++++++ shared/extra/lhasa.patch | 45 ++++++++++++++++++++++++++++++ shared/packages.sh | 10 +++++++ switch/1_download_library.sh | 8 ++++++ switch/2_build_toolchain.sh | 7 +++++ vita/1_download_library.sh | 8 ++++++ vita/2_build_toolchain.sh | 7 +++++ wii/1_download_library.sh | 8 ++++++ wii/2_build_toolchain.sh | 7 +++++ windows/build.cmd | 2 ++ 25 files changed, 210 insertions(+), 8 deletions(-) create mode 100644 emscripten/meson-cross.txt create mode 100644 shared/extra/lhasa.patch diff --git a/3ds/1_download_library.sh b/3ds/1_download_library.sh index a2af63ae..ff1c51d8 100755 --- a/3ds/1_download_library.sh +++ b/3ds/1_download_library.sh @@ -80,6 +80,14 @@ download_and_extract $OPUSFILE_URL rm -rf $FLUIDLITE_DIR download_and_extract $FLUIDLITE_URL +# inih +rm -rf $INIH_DIR +download_and_extract $INIH_URL + +# lhasa +rm -rf $LHASA_DIR +download_and_extract $LHASA_URL + # fmt rm -rf $FMT_DIR download_and_extract $FMT_URL diff --git a/3ds/2_build_toolchain.sh b/3ds/2_build_toolchain.sh index 3ad4526f..e8ab6fad 100755 --- a/3ds/2_build_toolchain.sh +++ b/3ds/2_build_toolchain.sh @@ -39,6 +39,11 @@ if [ ! -f .patches-applied ]; then patch -Np1 < $SCRIPT_DIR/../shared/extra/opusfile-devkit.patch ) + # Fix lhasa + (cd $LHASA_DIR + patch -Np1 < $SCRIPT_DIR/../shared/extra/lhasa.patch + ) + # Fix icu build perl -pi -e 's/xlocale/locale/' icu/source/i18n/digitlst.cpp cp -rup icu icu-native @@ -95,6 +100,8 @@ install_lib_cmake $WILDMIDI_DIR $WILDMIDI_ARGS install_lib $OPUS_DIR $OPUS_ARGS install_lib $OPUSFILE_DIR $OPUSFILE_ARGS install_lib_cmake $FLUIDLITE_DIR $FLUIDLITE_ARGS +install_lib_meson $INIH_DIR $INIH_ARGS +install_lib $LHASA_DIR $LHASA_ARGS install_lib_cmake $FMT_DIR $FMT_ARGS install_lib_icu_cross install_lib_liblcf diff --git a/LICENSE b/LICENSE index 3ce0ae50..ef910d45 100644 --- a/LICENSE +++ b/LICENSE @@ -9,6 +9,8 @@ fmt: MIT freetype: FreeType License or GPLv2 or later (see docs/LICENSE.TXT) harfbuzz: MIT icu4c: ICU license +inih: BSD +lhasa: ISC modplug: Public Domain mpg123: LGPLv2.1+ nlohmann-json: MIT diff --git a/android/1_download_library.sh b/android/1_download_library.sh index 609f7a4e..f7913f7f 100755 --- a/android/1_download_library.sh +++ b/android/1_download_library.sh @@ -138,6 +138,14 @@ download_and_extract $OPUSFILE_URL rm -rf $FLUIDSYNTH_DIR download_and_extract $FLUIDSYNTH_URL +# inih +rm -rf $INIH_DIR +download_and_extract $INIH_URL + +# lhasa +rm -rf $LHASA_DIR +download_and_extract $LHASA_URL + # fmt rm -rf $FMT_DIR download_and_extract $FMT_URL diff --git a/android/2_build_toolchain.sh b/android/2_build_toolchain.sh index 6e2f8323..0b553c59 100755 --- a/android/2_build_toolchain.sh +++ b/android/2_build_toolchain.sh @@ -119,6 +119,8 @@ function build() { install_lib $OPUS_DIR $OPUS_ARGS install_lib $OPUSFILE_DIR $OPUSFILE_ARGS install_lib_cmake $FLUIDSYNTH_DIR $FLUIDSYNTH_ARGS + install_lib_meson $INIH_DIR $INIH_ARGS + install_lib $LHASA_DIR $LHASA_ARGS install_lib_cmake $FMT_DIR $FMT_ARGS install_lib_icu_cross install_lib_sdl "$2" diff --git a/emscripten/1_download_library.sh b/emscripten/1_download_library.sh index f2ee511b..2e4854bb 100755 --- a/emscripten/1_download_library.sh +++ b/emscripten/1_download_library.sh @@ -122,6 +122,14 @@ download_and_extract $FLUIDSYNTH_URL rm -rf $NLOHMANNJSON_DIR download_and_extract $NLOHMANNJSON_URL +# inih +rm -rf $INIH_DIR +download_and_extract $INIH_URL + +# lhasa +rm -rf $LHASA_DIR +download_and_extract $LHASA_URL + # fmt rm -rf $FMT_DIR download_and_extract $FMT_URL diff --git a/emscripten/2_build_toolchain.sh b/emscripten/2_build_toolchain.sh index 234b9961..fa29e374 100755 --- a/emscripten/2_build_toolchain.sh +++ b/emscripten/2_build_toolchain.sh @@ -121,6 +121,8 @@ install_lib $OPUS_DIR $OPUS_ARGS --disable-stack-protector install_lib $OPUSFILE_DIR $OPUSFILE_ARGS install_lib_cmake $FLUIDSYNTH_DIR $FLUIDSYNTH_ARGS install_lib_cmake $NLOHMANNJSON_DIR $NLOHMANNJSON_ARGS +install_lib_meson $INIH_DIR $INIH_ARGS +install_lib $LHASA_DIR $LHASA_ARGS install_lib_cmake $FMT_DIR $FMT_ARGS # emscripten TARGET_HOST does not work for all libraries but SDL2 requires it diff --git a/emscripten/meson-cross.txt b/emscripten/meson-cross.txt new file mode 100644 index 00000000..0e7cef39 --- /dev/null +++ b/emscripten/meson-cross.txt @@ -0,0 +1,16 @@ +[binaries] +c = 'emcc' +cpp = 'em++' +ar = 'emar' + +[built-in options] +c_args = [] +c_link_args = ['-sEXPORT_ALL=1'] +cpp_args = [] +cpp_link_args = ['-sEXPORT_ALL=1'] + +[host_machine] +system = 'emscripten' +cpu_family = 'wasm32' +cpu = 'wasm32' +endian = 'little' diff --git a/ios/1_download_library.sh b/ios/1_download_library.sh index 2e823a30..911bbf51 100755 --- a/ios/1_download_library.sh +++ b/ios/1_download_library.sh @@ -74,6 +74,14 @@ download_and_extract $OPUSFILE_URL rm -rf $FLUIDLITE_DIR download_and_extract $FLUIDLITE_URL +# inih +rm -rf $INIH_DIR +download_and_extract $INIH_URL + +# lhasa +rm -rf $LHASA_DIR +download_and_extract $LHASA_URL + # fmt rm -rf $FMT_DIR download_and_extract $FMT_URL diff --git a/ios/2_build_toolchain.sh b/ios/2_build_toolchain.sh index b5bba62b..17ba865f 100755 --- a/ios/2_build_toolchain.sh +++ b/ios/2_build_toolchain.sh @@ -98,6 +98,8 @@ install_lib_cmake $WILDMIDI_DIR $WILDMIDI_ARGS install_lib $OPUS_DIR $OPUS_ARGS install_lib $OPUSFILE_DIR $OPUSFILE_ARGS install_lib_cmake $FLUIDLITE_DIR $FLUIDLITE_ARGS -DENABLE_SF3=ON +install_lib_meson $INIH_DIR $INIH_ARGS +install_lib $LHASA_DIR $LHASA_ARGS install_lib_cmake $FMT_DIR $FMT_ARGS install_lib_icu_cross install_lib_liblcf diff --git a/linux-static/1_download_library.sh b/linux-static/1_download_library.sh index 2dfbc196..8fa9a600 100755 --- a/linux-static/1_download_library.sh +++ b/linux-static/1_download_library.sh @@ -78,6 +78,14 @@ download_and_extract $FLUIDSYNTH_URL rm -rf $NLOHMANNJSON_DIR download_and_extract $NLOHMANNJSON_URL +# inih +rm -rf $INIH_DIR +download_and_extract $INIH_URL + +# lhasa +rm -rf $LHASA_DIR +download_and_extract $LHASA_URL + # fmt rm -rf $FMT_DIR download_and_extract $FMT_URL diff --git a/linux-static/2_build_toolchain.sh b/linux-static/2_build_toolchain.sh index 3382d135..450476b2 100755 --- a/linux-static/2_build_toolchain.sh +++ b/linux-static/2_build_toolchain.sh @@ -58,6 +58,8 @@ install_lib $OPUS_DIR $OPUS_ARGS install_lib $OPUSFILE_DIR $OPUSFILE_ARGS install_lib_cmake $FLUIDSYNTH_DIR $FLUIDSYNTH_ARGS install_lib_cmake $NLOHMANNJSON_DIR $NLOHMANNJSON_ARGS +install_lib_meson $INIH_DIR $INIH_ARGS +install_lib $LHASA_DIR $LHASA_ARGS install_lib_cmake $FMT_DIR $FMT_ARGS install_lib $ICU_DIR/source $ICU_ARGS install_lib_liblcf diff --git a/macos/1_download_library.sh b/macos/1_download_library.sh index ad592799..28e466fd 100755 --- a/macos/1_download_library.sh +++ b/macos/1_download_library.sh @@ -78,6 +78,14 @@ download_and_extract $FLUIDSYNTH_URL rm -rf $NLOHMANNJSON_DIR download_and_extract $NLOHMANNJSON_URL +# inih +rm -rf $INIH_DIR +download_and_extract $INIH_URL + +# lhasa +rm -rf $LHASA_DIR +download_and_extract $LHASA_URL + # fmt rm -rf $FMT_DIR download_and_extract $FMT_URL diff --git a/macos/2_build_toolchain.sh b/macos/2_build_toolchain.sh index 03ece8b0..caf41c8c 100755 --- a/macos/2_build_toolchain.sh +++ b/macos/2_build_toolchain.sh @@ -80,6 +80,8 @@ function build() { install_lib $OPUSFILE_DIR $OPUSFILE_ARGS install_lib_cmake $FLUIDSYNTH_DIR $FLUIDSYNTH_ARGS install_lib_cmake $NLOHMANNJSON_DIR $NLOHMANNJSON_ARGS + install_lib_meson $INIH_DIR $INIH_ARGS + install_lib $LHASA_DIR $LHASA_ARGS install_lib_cmake $FMT_DIR $FMT_ARGS install_lib_icu_cross icu_force_data_install diff --git a/shared/add_lib.sh b/shared/add_lib.sh index a2907f06..eb208969 100644 --- a/shared/add_lib.sh +++ b/shared/add_lib.sh @@ -5,10 +5,10 @@ echo "REMOVE THIS LINE";exit 1 # Edit these variables # Remove _cmake when the lib uses autotools for building -NAME=nlohmann-json -LIBVAR=NLOHMANNJSON -TOOLCHAIN_DIRS=(linux-static osx android emscripten 3ds switch vita wii ios) -CMAKE=_cmake +NAME=lhasa +LIBVAR=LHASA +TOOLCHAIN_DIRS=(linux-static macos android emscripten 3ds switch vita wii ios) +CMAKE= #------- @@ -23,7 +23,7 @@ do echo "Updating $n" sed -i "/# fmt/i\\$repA" $SCRIPT_DIR/../$n/1_*.sh - if [ $n == "android" ]; then + if [ $n == "android" ] || [ $n == "macos" ]; then OFFSET="\t" else OFFSET="" @@ -32,6 +32,3 @@ do sed -i "/install_lib_cmake \$FMT_DIR/i\\${OFFSET}$repB" $SCRIPT_DIR/../$n/2_*.sh done - - - diff --git a/shared/common.sh b/shared/common.sh index ca3a6f32..f6dce558 100644 --- a/shared/common.sh +++ b/shared/common.sh @@ -122,6 +122,26 @@ function install_lib_cmake { ) } +# generic meson library installer +function install_lib_meson { + msg "**** Building ${1%-*} ****" + + if [ -f "$PLATFORM_PREFIX/meson-cross.txt" ]; then + MESON_CROSS="$PLATFORM_PREFIX/meson-cross.txt" + else + MESON_CROSS="/dev/null" + fi + + (cd $1 + shift + + meson setup build --prefix $PLATFORM_PREFIX --buildtype release \ + -Ddefault_library=static --cross-file $MESON_CROSS $@ + meson compile -C build + meson install -C build + ) +} + function install_lib_zlib { msg "**** Building zlib ****" diff --git a/shared/extra/lhasa.patch b/shared/extra/lhasa.patch new file mode 100644 index 00000000..9b780daf --- /dev/null +++ b/shared/extra/lhasa.patch @@ -0,0 +1,45 @@ +diff '--color=auto' -Naur lhasa-0.4.0-orig/lib/lha_arch_unix.c lhasa-0.4.0/lib/lha_arch_unix.c +--- lhasa-0.4.0-orig/lib/lha_arch_unix.c 2023-07-27 22:29:46.420748564 +0200 ++++ lhasa-0.4.0/lib/lha_arch_unix.c 2023-07-27 22:35:08.186414880 +0200 +@@ -58,12 +58,12 @@ + + int lha_arch_chown(char *filename, int unix_uid, int unix_gid) + { +- return chown(filename, unix_uid, unix_gid) == 0; ++ return 0; + } + + int lha_arch_chmod(char *filename, int unix_perms) + { +- return chmod(filename, unix_perms) == 0; ++ return 0; + } + + int lha_arch_utime(char *filename, unsigned int timestamp) +@@ -101,7 +101,7 @@ + } + + // Set owner and group. +- ++#if 0 + if (unix_uid >= 0) { + if (fchown(fileno, unix_uid, unix_gid) != 0) { + // On most Unix systems, only root can change +@@ -117,6 +117,7 @@ + return NULL; */ + } + } ++#endif + + // Set file permissions. + // File permissions must be set *after* owner and group have +@@ -165,8 +166,7 @@ + + int lha_arch_symlink(char *path, char *target) + { +- unlink(path); +- return symlink(target, path) == 0; ++ return 0; + } + + #endif /* LHA_ARCH_UNIX */ diff --git a/shared/packages.sh b/shared/packages.sh index 4dae84a5..0e6ea45f 100644 --- a/shared/packages.sh +++ b/shared/packages.sh @@ -119,6 +119,16 @@ FMT_URL="https://github.com/fmtlib/fmt/releases/download/$ver/$lib-$ver.zip" FMT_DIR="$lib-$ver" FMT_ARGS="-DFMT_DOC=OFF -DFMT_TEST=OFF" +lib=inih +ver=r57 +INIH_URL="https://github.com/benhoyt/inih/archive/refs/tags/$ver.tar.gz" +INIH_DIR="$lib-$ver" + +lib=lhasa +ver=0.4.0 +LHASA_URL="https://github.com/fragglet/lhasa/releases/download/v$ver/$lib-$ver.tar.gz" +LHASA_DIR="$lib-$ver" + lib=ICU ver=69.1 ICU_URL=https://github.com/unicode-org/icu/releases/download/release-${ver//./-}/icu4c-${ver//./_}-src.tgz diff --git a/switch/1_download_library.sh b/switch/1_download_library.sh index e9e2e219..9c64123c 100755 --- a/switch/1_download_library.sh +++ b/switch/1_download_library.sh @@ -78,6 +78,14 @@ download_and_extract $OPUSFILE_URL rm -rf $FLUIDSYNTH_DIR download_and_extract $FLUIDSYNTH_URL +# inih +rm -rf $INIH_DIR +download_and_extract $INIH_URL + +# lhasa +rm -rf $LHASA_DIR +download_and_extract $LHASA_URL + # fmt rm -rf $FMT_DIR download_and_extract $FMT_URL diff --git a/switch/2_build_toolchain.sh b/switch/2_build_toolchain.sh index 1d912824..aa082887 100755 --- a/switch/2_build_toolchain.sh +++ b/switch/2_build_toolchain.sh @@ -42,6 +42,11 @@ if [ ! -f .patches-applied ]; then autoreconf -fi ) + # Fix lhasa + (cd $LHASA_DIR + patch -Np1 < $SCRIPT_DIR/../shared/extra/lhasa.patch + ) + cp -rup icu icu-native touch .patches-applied @@ -95,6 +100,8 @@ install_lib_cmake $WILDMIDI_DIR $WILDMIDI_ARGS install_lib $OPUS_DIR $OPUS_ARGS install_lib $OPUSFILE_DIR $OPUSFILE_ARGS install_lib_cmake $FLUIDSYNTH_DIR $FLUIDSYNTH_ARGS +install_lib_meson $INIH_DIR $INIH_ARGS +install_lib $LHASA_DIR $LHASA_ARGS install_lib_cmake $FMT_DIR $FMT_ARGS install_lib_icu_cross install_lib_liblcf diff --git a/vita/1_download_library.sh b/vita/1_download_library.sh index fcc76686..62749618 100755 --- a/vita/1_download_library.sh +++ b/vita/1_download_library.sh @@ -80,6 +80,14 @@ download_and_extract $OPUSFILE_URL rm -rf $FLUIDLITE_DIR download_and_extract $FLUIDLITE_URL +# inih +rm -rf $INIH_DIR +download_and_extract $INIH_URL + +# lhasa +rm -rf $LHASA_DIR +download_and_extract $LHASA_URL + # fmt rm -rf $FMT_DIR download_and_extract $FMT_URL diff --git a/vita/2_build_toolchain.sh b/vita/2_build_toolchain.sh index 534c6d68..d0008135 100755 --- a/vita/2_build_toolchain.sh +++ b/vita/2_build_toolchain.sh @@ -25,6 +25,11 @@ if [ ! -f .patches-applied ]; then autoreconf -fi ) + # Fix lhasa + (cd $LHASA_DIR + patch -Np1 < $SCRIPT_DIR/../shared/extra/lhasa.patch + ) + # Fix icu build cp -rup icu icu-native patch -Np0 < $SCRIPT_DIR/icu69-vita.patch @@ -91,6 +96,8 @@ install_lib_cmake $WILDMIDI_DIR $WILDMIDI_ARGS install_lib_cmake $FLUIDLITE_DIR $FLUIDLITE_ARGS -DENABLE_SF3=ON install_lib $OPUS_DIR $OPUS_ARGS install_lib $OPUSFILE_DIR $OPUSFILE_ARGS +install_lib_meson $INIH_DIR $INIH_ARGS +install_lib $LHASA_DIR $LHASA_ARGS install_lib_cmake $FMT_DIR $FMT_ARGS install_lib_icu_cross install_lib_liblcf diff --git a/wii/1_download_library.sh b/wii/1_download_library.sh index 71a62414..1cb7d4ec 100755 --- a/wii/1_download_library.sh +++ b/wii/1_download_library.sh @@ -80,6 +80,14 @@ download_and_extract $OPUSFILE_URL rm -rf $FLUIDLITE_DIR download_and_extract $FLUIDLITE_URL +# inih +rm -rf $INIH_DIR +download_and_extract $INIH_URL + +# lhasa +rm -rf $LHASA_DIR +download_and_extract $LHASA_URL + # fmt rm -rf $FMT_DIR download_and_extract $FMT_URL diff --git a/wii/2_build_toolchain.sh b/wii/2_build_toolchain.sh index d6ba65b4..278a9884 100755 --- a/wii/2_build_toolchain.sh +++ b/wii/2_build_toolchain.sh @@ -41,6 +41,11 @@ if [ ! -f .patches-applied ]; then autoreconf -fi ) + # Fix lhasa + (cd $LHASA_DIR + patch -Np1 < $SCRIPT_DIR/../shared/extra/lhasa.patch + ) + # Fix icu build perl -pi -e 's/xlocale/locale/' icu/source/i18n/digitlst.cpp cp -rup icu icu-native @@ -98,6 +103,8 @@ install_lib_cmake $WILDMIDI_DIR $WILDMIDI_ARGS install_lib_cmake $FLUIDLITE_DIR $FLUIDLITE_ARGS install_lib $OPUS_DIR $OPUS_ARGS install_lib $OPUSFILE_DIR $OPUSFILE_ARGS +install_lib_meson $INIH_DIR $INIH_ARGS +install_lib $LHASA_DIR $LHASA_ARGS install_lib_cmake $FMT_DIR $FMT_ARGS install_lib_icu_cross install_lib_liblcf diff --git a/windows/build.cmd b/windows/build.cmd index cf6f796d..621ea391 100644 --- a/windows/build.cmd +++ b/windows/build.cmd @@ -9,6 +9,7 @@ vcpkg install --triplet x86-windows-static --recurse^ libpng[core] expat[core] pixman[core] freetype[core,zlib] harfbuzz[core]^ libvorbis[core] libsndfile[core] wildmidi[core] libxmp[core]^ speexdsp[core] mpg123[core] opusfile[core] fluidsynth-easyrpg[core]^ + inih[cpp] lhasa[core]^ sdl2-image[core] icu-easyrpg[core] nlohmann-json[core] fmt[core] :: Build 64-bit libraries @@ -16,4 +17,5 @@ vcpkg install --triplet x64-windows-static --recurse^ libpng[core] expat[core] pixman[core] freetype[core,zlib] harfbuzz[core]^ libvorbis[core] libsndfile[core] wildmidi[core] libxmp[core]^ speexdsp[core] mpg123[core] opusfile[core] fluidsynth-easyrpg[core]^ + inih[cpp] lhasa[core]^ sdl2-image[core] icu-easyrpg[core] nlohmann-json[core] fmt[core] From 873581853ae02b698dbb7c6046d778df4e0c7cb6 Mon Sep 17 00:00:00 2001 From: Ghabry Date: Thu, 26 Oct 2023 00:39:38 +0200 Subject: [PATCH 2/4] lhasa macos: add patch to set std=c++11 --- macos/2_build_toolchain.sh | 6 ++++++ macos/inih-std11.patch | 26 ++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 macos/inih-std11.patch diff --git a/macos/2_build_toolchain.sh b/macos/2_build_toolchain.sh index caf41c8c..0d8c1995 100755 --- a/macos/2_build_toolchain.sh +++ b/macos/2_build_toolchain.sh @@ -23,6 +23,12 @@ if [ ! -f .patches-applied ]; then patches_common + # Fix inih + # Remove when r58 is out + (cd $INIH_DIR + patch -Np1 < $SCRIPT_DIR/inih-std11.patch + ) + cp -rp icu icu-native touch .patches-applied diff --git a/macos/inih-std11.patch b/macos/inih-std11.patch new file mode 100644 index 00000000..88fe1524 --- /dev/null +++ b/macos/inih-std11.patch @@ -0,0 +1,26 @@ +From a4aab8874708ce62db7a866bdb2dbfca83fd392a Mon Sep 17 00:00:00 2001 +From: DownerCase <119755054+DownerCase@users.noreply.github.com> +Date: Sun, 6 Aug 2023 20:50:28 +0100 +Subject: [PATCH] Specify C++11 std in meson build + +Compilers differ on what the default standard is and I had to set C++11 standard as part of the [vcpkg port](https://github.com/microsoft/vcpkg/pull/33001) to get it work on MacOS. + +Also you forgot to bump the version number last release. +--- + meson.build | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/meson.build b/meson.build +index f810525..e0340ff 100644 +--- a/meson.build ++++ b/meson.build +@@ -1,7 +1,8 @@ + project('inih', + ['c'], + license : 'BSD-3-Clause', +- version : '56', ++ version : '57', ++ default_options : ['cpp_std=c++11'] + ) + + #### options #### From 2889337a562be2bfc52ea018530eeab04738fb59 Mon Sep 17 00:00:00 2001 From: Ghabry Date: Fri, 27 Oct 2023 19:47:56 +0200 Subject: [PATCH 3/4] ICU: Fix macOS arm64 build Based on a patch by @monokotech Thanks! --- macos/2_build_toolchain.sh | 3 ++- shared/common.sh | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/macos/2_build_toolchain.sh b/macos/2_build_toolchain.sh index 0d8c1995..63ff7f3f 100755 --- a/macos/2_build_toolchain.sh +++ b/macos/2_build_toolchain.sh @@ -55,7 +55,8 @@ function set_build_flags() { fi export CFLAGS="-g -O2 -mmacosx-version-min=10.9 -isysroot $SDKPATH $3" export CXXFLAGS=$CFLAGS - export CPPFLAGS="-I$PLATFORM_PREFIX/include" + # ICU include is required for arm64 + export CPPFLAGS="-I$PLATFORM_PREFIX/include -I$WORKSPACE/icu/source/common" export LDFLAGS="-L$PLATFORM_PREFIX/lib $ARCH -mmacosx-version-min=10.9 -isysroot $SDKPATH" export MACOSX_DEPLOYMENT_TARGET=10.9 diff --git a/shared/common.sh b/shared/common.sh index f6dce558..80afd3ce 100644 --- a/shared/common.sh +++ b/shared/common.sh @@ -135,6 +135,8 @@ function install_lib_meson { (cd $1 shift + rm -rf build + meson setup build --prefix $PLATFORM_PREFIX --buildtype release \ -Ddefault_library=static --cross-file $MESON_CROSS $@ meson compile -C build From 7504c0c0a71842a9bff358aeefc30da337b71e4d Mon Sep 17 00:00:00 2001 From: Ghabry Date: Fri, 27 Oct 2023 23:17:36 +0200 Subject: [PATCH 4/4] emscripten: Disable lhasa (currently useless in the web) --- emscripten/2_build_toolchain.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emscripten/2_build_toolchain.sh b/emscripten/2_build_toolchain.sh index fa29e374..5a86c325 100755 --- a/emscripten/2_build_toolchain.sh +++ b/emscripten/2_build_toolchain.sh @@ -122,7 +122,7 @@ install_lib $OPUSFILE_DIR $OPUSFILE_ARGS install_lib_cmake $FLUIDSYNTH_DIR $FLUIDSYNTH_ARGS install_lib_cmake $NLOHMANNJSON_DIR $NLOHMANNJSON_ARGS install_lib_meson $INIH_DIR $INIH_ARGS -install_lib $LHASA_DIR $LHASA_ARGS +#install_lib $LHASA_DIR $LHASA_ARGS install_lib_cmake $FMT_DIR $FMT_ARGS # emscripten TARGET_HOST does not work for all libraries but SDL2 requires it