diff --git a/appveyor/apply_patch.sh b/appveyor/apply_patch.sh new file mode 100644 index 0000000..4d85392 --- /dev/null +++ b/appveyor/apply_patch.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +mydir=$(dirname "$0") +patch -p1 < "$mydir"/../kiwixbuild/patches/"$1" diff --git a/appveyor/install_zstd.cmd b/appveyor/install_zstd.cmd index 6529d63..5f08da9 100644 --- a/appveyor/install_zstd.cmd +++ b/appveyor/install_zstd.cmd @@ -2,6 +2,8 @@ REM ======================================================== REM Install zstd curl -fsSL -o zstd-v1.4.4.zip https://github.com/facebook/zstd/archive/v1.4.4.zip || exit /b 1 7z x zstd-v1.4.4.zip || exit /b 1 +REM Fixing https://github.com/facebook/zstd/issues/2073 +%MINGW64_RUN% "cd /c/projects/kiwix-build/zstd-1.4.4 && ../appveyor/apply_patch.sh zstd_meson.patch" || exit /b 1 cd zstd-1.4.4/build/meson meson . builddir --prefix %EXTRA_DIR% --default-library static --buildtype release -Dbin_programs=false -Dbin_contrib=false || exit /b 1 cd builddir diff --git a/kiwixbuild/dependencies/zstd.py b/kiwixbuild/dependencies/zstd.py index 30e67cd..ec2e108 100644 --- a/kiwixbuild/dependencies/zstd.py +++ b/kiwixbuild/dependencies/zstd.py @@ -14,6 +14,7 @@ class zstd(Dependency): archive = Remotefile('zstd-1.4.4.tar.gz', '59ef70ebb757ffe74a7b3fe9c305e2ba3350021a918d168a046c6300aeea9315', 'https://github.com/facebook/zstd/releases/download/v1.4.4/zstd-1.4.4.tar.gz') + patches = ['zstd_meson.patch'] class Builder(MesonBuilder): subsource_dir = 'build/meson' diff --git a/kiwixbuild/patches/zstd_meson.patch b/kiwixbuild/patches/zstd_meson.patch new file mode 100644 index 0000000..83e7fc3 --- /dev/null +++ b/kiwixbuild/patches/zstd_meson.patch @@ -0,0 +1,20 @@ +diff -ur zstd-1.4.4/build/meson/meson.build zstd-1.4.4.patched/build/meson/meson.build +--- zstd-1.4.4/build/meson/meson.build 2019-11-04 21:54:32.000000000 +0400 ++++ zstd-1.4.4.patched/build/meson/meson.build 2020-04-07 13:59:26.012106549 +0400 +@@ -68,6 +68,7 @@ + # Built-in options + use_debug = get_option('debug') + buildtype = get_option('buildtype') ++default_library_type = get_option('default_library') + + # Custom options + debug_level = get_option('debug_level') +@@ -121,7 +122,7 @@ + if use_multi_thread + msvc_compile_flags += '/MP' + endif +- if enable_static_runtime ++ if use_static_runtime + msvc_compile_flags += '/MT' + endif + add_project_arguments(msvc_compile_flags, language: ['c', 'cpp'])