From 1a3df6fa3beeb0d7b1c1b693083d240d846554bf Mon Sep 17 00:00:00 2001 From: Emmanuel Engelhart Date: Fri, 26 Nov 2021 10:23:13 +0100 Subject: [PATCH 1/7] Use recent zstdlib 1.5.1 --- kiwixbuild/dependencies/zstd.py | 6 +++--- kiwixbuild/versions.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/kiwixbuild/dependencies/zstd.py b/kiwixbuild/dependencies/zstd.py index ec2e108..e4dd643 100644 --- a/kiwixbuild/dependencies/zstd.py +++ b/kiwixbuild/dependencies/zstd.py @@ -11,9 +11,9 @@ class zstd(Dependency): name = 'zstd' class Source(ReleaseDownload): - 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') + archive = Remotefile('zstd-1.5.1.tar.gz', + 'e28b2f2ed5710ea0d3a1ecac3f6a947a016b972b9dd30242369010e5f53d7002', + 'https://github.com/facebook/zstd/releases/download/v1.5.1/zstd-1.5.1.tar.gz') patches = ['zstd_meson.patch'] class Builder(MesonBuilder): diff --git a/kiwixbuild/versions.py b/kiwixbuild/versions.py index 2912d3b..41d895c 100644 --- a/kiwixbuild/versions.py +++ b/kiwixbuild/versions.py @@ -39,12 +39,12 @@ release_versions = { # This is the "version" of the whole base_deps_versions dict. # Change this when you change base_deps_versions. -base_deps_meta_version = '74' +base_deps_meta_version = '75' base_deps_versions = { 'zlib' : '1.2.8', 'lzma' : '5.2.4', - 'zstd' : '1.4.4', + 'zstd' : '1.5.1', 'docoptcpp' : '0.6.2', 'uuid' : '1.43.4', 'xapian-core' : '1.4.18', From 4ee28541cd621c3fcdfd694fbf031f85cd55e6ca Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Wed, 22 Dec 2021 15:36:16 +0100 Subject: [PATCH 2/7] Remove unnecessary zstd patch. --- kiwixbuild/dependencies/zstd.py | 1 - kiwixbuild/patches/zstd_meson.patch | 20 -------------------- 2 files changed, 21 deletions(-) delete mode 100644 kiwixbuild/patches/zstd_meson.patch diff --git a/kiwixbuild/dependencies/zstd.py b/kiwixbuild/dependencies/zstd.py index e4dd643..f142d82 100644 --- a/kiwixbuild/dependencies/zstd.py +++ b/kiwixbuild/dependencies/zstd.py @@ -14,7 +14,6 @@ class zstd(Dependency): archive = Remotefile('zstd-1.5.1.tar.gz', 'e28b2f2ed5710ea0d3a1ecac3f6a947a016b972b9dd30242369010e5f53d7002', 'https://github.com/facebook/zstd/releases/download/v1.5.1/zstd-1.5.1.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 deleted file mode 100644 index 83e7fc3..0000000 --- a/kiwixbuild/patches/zstd_meson.patch +++ /dev/null @@ -1,20 +0,0 @@ -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']) From 276343c6af558973e263b4fd6158b0d054dc6bfb Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Tue, 7 Dec 2021 15:01:22 +0100 Subject: [PATCH 3/7] Add missing dependency `aria2` to "all" dependencies. `AllBaseDependencies` is used as a dummy target to build all base dependencies in the CI. --- kiwixbuild/dependencies/all_dependencies.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kiwixbuild/dependencies/all_dependencies.py b/kiwixbuild/dependencies/all_dependencies.py index feabe5a..a33bb64 100644 --- a/kiwixbuild/dependencies/all_dependencies.py +++ b/kiwixbuild/dependencies/all_dependencies.py @@ -13,10 +13,12 @@ class AllBaseDependencies(Dependency): @classmethod def get_dependencies(cls, platformInfo, allDeps): base_deps = ['zlib', 'lzma', 'zstd', 'xapian-core', 'pugixml', 'libcurl', 'icu4c', 'mustache', 'libmicrohttpd', 'zim-testing-suite'] - # zimtools - # We do not build zimtools at all on "android" and "iOS" + # Add specific dependencies depending of the platform if platformInfo.build not in ('android', 'iOS'): + # For zimtools base_deps += ['docoptcpp'] + # For kiwix-desktop + base_deps += ['aria2'] if platformInfo.build != 'win32': # zimwriterfs base_deps += ['libmagic', 'gumbo'] From 71b1c2799a6dee479ae8d8d8c9cfbe2ee65f17c9 Mon Sep 17 00:00:00 2001 From: Emmanuel Engelhart Date: Mon, 6 Dec 2021 09:13:06 +0100 Subject: [PATCH 4/7] Update aria2c to 1.36.0 --- kiwixbuild/dependencies/aria2.py | 7 +++---- kiwixbuild/versions.py | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/kiwixbuild/dependencies/aria2.py b/kiwixbuild/dependencies/aria2.py index e2d5dbb..db5c76d 100644 --- a/kiwixbuild/dependencies/aria2.py +++ b/kiwixbuild/dependencies/aria2.py @@ -10,10 +10,9 @@ class Aria2(Dependency): name = "aria2" class Source(ReleaseDownload): - archive = Remotefile('aria2-1.34.0.tar.xz', - '3a44a802631606e138a9e172a3e9f5bcbaac43ce2895c1d8e2b46f30487e77a3', - 'https://github.com/aria2/aria2/releases/download/release-1.34.0/aria2-1.34.0.tar.xz') - + archive = Remotefile('aria2-1.36.0.tar.xz', + '58d1e7608c12404f0229a3d9a4953d0d00c18040504498b483305bcb3de907a5', + 'https://github.com/aria2/aria2/releases/download/release-1.36.0/aria2-1.36.0.tar.xz') patches = ["libaria2_android.patch"] def _post_prepare_script(self, context): diff --git a/kiwixbuild/versions.py b/kiwixbuild/versions.py index 41d895c..157c427 100644 --- a/kiwixbuild/versions.py +++ b/kiwixbuild/versions.py @@ -53,7 +53,7 @@ base_deps_versions = { 'libmicrohttpd' : '0.9.72', 'gumbo' : '0.10.1', 'icu4c' : '58.2', - 'libaria2' : '1.33.1', + 'libaria2' : '1.36.0', 'libmagic' : '5.35', 'android-sdk' : 'r25.2.3', 'android-ndk' : 'r13b', From ea7fa1f207c12a64574d9a56f4f4108c12e65910 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Wed, 22 Dec 2021 16:31:53 +0100 Subject: [PATCH 5/7] Remove unnecessary aria2 patch This patch was to compile libaria2 on android. But we don't compile it for android since a long time. As it doesn't apply anymore, let's remove it. --- kiwixbuild/dependencies/aria2.py | 1 - kiwixbuild/patches/libaria2_android.patch | 29 ----------------------- 2 files changed, 30 deletions(-) delete mode 100644 kiwixbuild/patches/libaria2_android.patch diff --git a/kiwixbuild/dependencies/aria2.py b/kiwixbuild/dependencies/aria2.py index db5c76d..a15466a 100644 --- a/kiwixbuild/dependencies/aria2.py +++ b/kiwixbuild/dependencies/aria2.py @@ -13,7 +13,6 @@ class Aria2(Dependency): archive = Remotefile('aria2-1.36.0.tar.xz', '58d1e7608c12404f0229a3d9a4953d0d00c18040504498b483305bcb3de907a5', 'https://github.com/aria2/aria2/releases/download/release-1.36.0/aria2-1.36.0.tar.xz') - patches = ["libaria2_android.patch"] def _post_prepare_script(self, context): context.try_skip(self.extract_path) diff --git a/kiwixbuild/patches/libaria2_android.patch b/kiwixbuild/patches/libaria2_android.patch deleted file mode 100644 index ef647a5..0000000 --- a/kiwixbuild/patches/libaria2_android.patch +++ /dev/null @@ -1,29 +0,0 @@ -diff -ur libaria2-1.33.1/src/a2io.h libaria2-1.33.1.patched/src/a2io.h ---- libaria2-1.33.1/src/a2io.h 2017-11-08 13:39:06.000000000 +0100 -+++ libaria2-1.33.1.patched/src/a2io.h 2018-03-27 17:02:45.651414060 +0200 -@@ -147,7 +147,7 @@ - // # define a2fseek(fp, offset, origin): No fseek64 and not used in aria2 - #define a2fstat(fd, buf) fstat64(fd, buf) - // # define a2ftell(fd): No ftell64 and not used in aria2 --#define a2_struct_stat struct stat -+#define a2_struct_stat struct stat64 - #define a2stat(path, buf) stat64(path, buf) - #define a2mkdir(path, openMode) mkdir(path, openMode) - #define a2utimbuf utimbuf -diff -ur libaria2-1.33.1/src/crypto_endian.h libaria2-1.33.1.patched/src/crypto_endian.h ---- libaria2-1.33.1/src/crypto_endian.h 2017-11-08 13:39:06.000000000 +0100 -+++ libaria2-1.33.1.patched/src/crypto_endian.h 2018-03-27 16:56:55.264371501 +0200 -@@ -33,9 +33,13 @@ - #define BIG_ENDIAN 4321 - #define BYTE_ORDER LITTLE_ENDIAN - #else // ! defined(_WIN32) || defined(__INTEL_COMPILER) || defined (_MSC_VER) -+#if defined(__ANDROID__) -+#include -+#else // defined(__ANDROID__) - #ifdef HAVE_SYS_PARAM_H - #include - #endif // HAVE_SYS_PARAM_H -+#endif // defined(__ANDROID__) - #endif // ! defined(_WIN32) || defined(__INTEL_COMPILER) || defined (_MSC_VER) - - #if !defined(LITTLE_ENDIAN) || !defined(BIG_ENDIAN) || !defined(BYTE_ORDER) || \ From 612efaad7c1aa99750f8dd22150c3735f0090ce0 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Wed, 22 Dec 2021 16:32:18 +0100 Subject: [PATCH 6/7] Update aria2c version on windows and appimage --- appveyor/install_aria2.cmd | 4 ++-- scripts/create_kiwix-desktop_appImage.sh | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/appveyor/install_aria2.cmd b/appveyor/install_aria2.cmd index 0f40edf..8517c1c 100644 --- a/appveyor/install_aria2.cmd +++ b/appveyor/install_aria2.cmd @@ -1,4 +1,4 @@ REM ======================================================== REM Install aria2 -curl -fsSL -O https://github.com/aria2/aria2/releases/download/release-1.34.0/aria2-1.34.0-win-64bit-build1.zip || exit /b 1 -7z e aria2-1.34.0-win-64bit-build1.zip -o%EXTRA_DIR% aria2-1.34.0-win-64bit-build1\aria2c.exe || exit /b 1 +curl -fsSL -O https://github.com/aria2/aria2/releases/download/release-1.36.0/aria2-1.36.0-win-64bit-build1.zip || exit /b 1 +7z e aria2-1.36.0-win-64bit-build1.zip -o%EXTRA_DIR% aria2-1.36.0-win-64bit-build1\aria2c.exe || exit /b 1 diff --git a/scripts/create_kiwix-desktop_appImage.sh b/scripts/create_kiwix-desktop_appImage.sh index 28f973f..d50bed8 100755 --- a/scripts/create_kiwix-desktop_appImage.sh +++ b/scripts/create_kiwix-desktop_appImage.sh @@ -31,9 +31,9 @@ mkdir -p $APPDIR/usr/share/applications cp $DESKTOPFILE $APPDIR/usr/share/applications/kiwix-desktop.desktop # get the aria2 -wget --continue https://github.com/q3aql/aria2-static-builds/releases/download/v1.34.0/aria2-1.34.0-linux-gnu-64bit-build1.tar.bz2 -mkdir -p $APPDIR/usr/bin/ && tar -C $APPDIR/usr/bin/ -xf aria2-1.34.0-linux-gnu-64bit-build1.tar.bz2 aria2-1.34.0-linux-gnu-64bit-build1/aria2c --strip-components=1 -mkdir -p $APPDIR/etc/ssl/certs/ && tar -C $APPDIR/etc/ssl/certs/ -xf aria2-1.34.0-linux-gnu-64bit-build1.tar.bz2 aria2-1.34.0-linux-gnu-64bit-build1/ca-certificates.crt --strip-components=1 +wget --continue https://github.com/q3aql/aria2-static-builds/releases/download/v1.36.0/aria2-1.36.0-linux-gnu-64bit-build1.tar.bz2 +mkdir -p $APPDIR/usr/bin/ && tar -C $APPDIR/usr/bin/ -xf aria2-1.36.0-linux-gnu-64bit-build1.tar.bz2 aria2-1.36.0-linux-gnu-64bit-build1/aria2c --strip-components=1 +mkdir -p $APPDIR/etc/ssl/certs/ && tar -C $APPDIR/etc/ssl/certs/ -xf aria2-1.36.0-linux-gnu-64bit-build1.tar.bz2 aria2-1.36.0-linux-gnu-64bit-build1/ca-certificates.crt --strip-components=1 # Get linuxdeployqt wget --continue https://github.com/probonopd/linuxdeployqt/releases/download/6/linuxdeployqt-6-x86_64.AppImage From 462538f4a565ba6c820774a053d432a08a8f7f18 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Thu, 23 Dec 2021 19:01:15 +0100 Subject: [PATCH 7/7] Do not try to cross compile aria2. Aria2 is a special case. We actually don't really need to compile it. kiwix-desktop through libkiwix use the aria2c binary but we always use (package) the system binary or a prebuild release. And we don't cross compile kiwix-desktop to windows, so we don't need aria2c neither. --- kiwixbuild/dependencies/all_dependencies.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/kiwixbuild/dependencies/all_dependencies.py b/kiwixbuild/dependencies/all_dependencies.py index a33bb64..0be910c 100644 --- a/kiwixbuild/dependencies/all_dependencies.py +++ b/kiwixbuild/dependencies/all_dependencies.py @@ -17,10 +17,11 @@ class AllBaseDependencies(Dependency): if platformInfo.build not in ('android', 'iOS'): # For zimtools base_deps += ['docoptcpp'] - # For kiwix-desktop - base_deps += ['aria2'] if platformInfo.build != 'win32': # zimwriterfs base_deps += ['libmagic', 'gumbo'] - + if platformInfo.build == 'native' and neutralEnv('distname') != 'Darwin': + # We compile kiwix-desktop only on native and not on `Darwin` + # So we need aria2 only there + base_deps += ['aria2'] return base_deps