Compare commits

...

1438 Commits
0.0.3 ... main

Author SHA1 Message Date
Kelson 2f37d80111
Merge pull request #819 from kiwix/release-zim-tools-3.6.0
Relase zim-tools 3.6.0
2025-04-17 23:37:20 +02:00
Emmanuel Engelhart 971971a60f
Relase zim-tools 3.6.0 2025-04-17 22:36:18 +02:00
Kelson f58795bd1e
Merge pull request #818 from kiwix/qt_installed_only_if_necessary
QT is installed only in a windows native_mixed job
2025-04-17 20:53:00 +02:00
Veloman Yunkan fcc6798187 QT is installed only in a windows native_mixed job
kiwix-desktop is built under Windows only in native_mixed config and QT
is not required for anything else. Therefore it doesn't make sense to
run QT installation in Windows native_dyn and native_static CI/CD jobs.
That will reduce the risk of those jobs failing because of problems with
QT mirrors.
2025-04-17 19:18:10 +02:00
Veloman Yunkan 9c5e1966a0
Merge pull request #817 from kiwix/workaround_for_download.qt.io_outage
Workaround for download.qt.io outage
2025-04-17 20:32:02 +04:00
Veloman Yunkan f13cd4264a Updated .github/configs/aqt.ini
- Made https://qt.mirror.constant.com/ the default QT download URL.

- Added https://qt.mirror.constant.com/ and https://ftp.fau.de/qtproject/
  to the list of trusted mirrors (used for obtaining package hashes)

- Deleted the kde_patches section (we don't build QT from source)
2025-04-17 17:43:10 +02:00
Veloman Yunkan efd995acbf Copied aqtinstall default config into our repo
Copied settings.ini of aqtinstall==3.1.21 python package (the version of
aqtinstall used by the jurplel/install-qt-action@v4 action as of today)
as .github/configs/aqt.ini and made the QT installation step use that
config. The cloned config file is going to be modified in the next commit.
2025-04-17 17:20:02 +02:00
Kelson 43c4add1fc
Merge pull request #815 from kiwix/build-libzim-9.3.0
Build libzim 9.3.0
2025-04-17 11:28:33 +02:00
Emmanuel Engelhart e4a8ac215c
Build libzim 9.3.0 2025-04-17 11:27:51 +02:00
Kelson 4d65a50db4
Merge pull request #814 from kiwix/zim-testing-suite_update
Update zim-testing-suite to 0.8.0
2025-04-17 10:50:49 +02:00
Veloman Yunkan 4071762b9a Update zim-testing-suite to 0.8.0 2025-04-17 10:03:07 +02:00
Kelson 77592b12ff
Merge pull request #813 from kiwix/commented-out-ninja-install-macos
Comment-out ninja install for macOS
2025-04-16 12:43:22 +02:00
Emmanuel Engelhart e67295a3d0 Comment-out ninja install for macOS 2025-04-16 12:09:16 +02:00
Kelson 8780b994a3
Merge pull request #811 from kiwix/no-double-native-archives
Dont publish built dependencies on jammy to prevent double archives
2025-04-16 10:04:49 +02:00
rgaudin f888c87459
Issue #770: Dont publish built dependencies on jammy to prevent double archives
Currently, both jammy and focal publish the native_dyn versions of dependencies
for libzim and libkiwix.
This creates concurrent upload issues.
This removes this step for jammy so it gets uploaded only once.
2025-04-16 09:26:02 +02:00
Kelson 1aa720a7fd
Merge pull request #809 from kiwix/python3.13+_friendly_android-ndk-r21e
Enabled android-ndk to work with Python 3.12+
2025-04-03 06:53:54 +02:00
Veloman Yunkan 1676e740c0 Enabled android-ndk to work with Python 3.12+
distutils was dropped from Python 3.12. Fortunately, our usage of
android-ndk only relied on distutils.dir_util.copy_tree() in
build/tools/make_standalone_toolchain.py which
is easy to replace with shutil.copytree(). That is done via a small
patch.

Note that there are more references to distutils in the following
files but it looks like our CI/CD flows aren't affected by those:

sources/third_party/shaderc/third_party/spirv-tools/utils/generate_registry_tables.py
sources/third_party/vulkan/src/scripts/update_deps.py
prebuilt/linux-x86_64/bin/python2.7-config
prebuilt/linux-x86_64/bin/python-config
prebuilt/linux-x86_64/bin/python2-config
various files under prebuilt/linux-x86_64/lib/python2.7/
python-packages/fastboot/setup.py
python-packages/adb/setup.py
2025-04-03 06:16:04 +02:00
Kelson 4a279da24b
Merge pull request #807 from kiwix/curl_with_ssl_support
Enable SSL support in libcurl
2025-03-08 12:06:24 +01:00
Veloman Yunkan 45be5ebeda Enable SSL support in libcurl 2025-02-24 19:36:10 +04:00
Matthieu Gautier 8a911ccd75
Merge pull request #806 from kiwix/test_zim_suite_0.7.0
Update zim-testing-suite to 0.7.0
2025-02-13 09:57:33 +01:00
Matthieu Gautier 685f3f1e1a Update zim-testing-suite to 0.7.0 2025-02-11 16:11:03 +01:00
Kelson baed570f14
Merge pull request #800 from kiwix/better-flatpak-permissions
Allow to directly access ZIM file (ready-only) in Kiwix Desktop Flatpak
2025-01-05 18:27:53 +01:00
Emmanuel Engelhart 5de1d1f65e
Allow to directly access ZIM file (ready-only) 2025-01-05 18:27:27 +01:00
Kelson 75ca8fc723
Merge pull request #795 from kiwix/win-qt6
Windows build uses Qt 6.4.3
2024-12-24 10:00:24 +01:00
Adam Lamar 006db92fd3 Windows build uses Qt 6.4.3 2024-12-23 15:22:48 -07:00
Kelson 1a100a2def
Merge pull request #798 from kiwix/few-workflow-fixes
Few workflow fixes
2024-12-22 15:52:35 +01:00
Emmanuel Engelhart 4eae4fe654
pkgconfig & autoconf are alread installed on macOS runner 2024-12-22 15:13:22 +01:00
Kelson 949232dc00
Merge pull request #687 from kiwix/dependabot/npm_and_yarn/actions/dl_deps_archive/undici-5.28.4
Bump undici from 5.28.2 to 5.28.4 in /actions/dl_deps_archive
2024-12-22 14:43:27 +01:00
dependabot[bot] a62d741363 Bump undici from 5.28.2 to 5.28.4 in /actions/dl_deps_archive
Bumps [undici](https://github.com/nodejs/undici) from 5.28.2 to 5.28.4.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v5.28.2...v5.28.4)

---
updated-dependencies:
- dependency-name: undici
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-22 11:30:27 +01:00
Kelson ce40d311f2
Merge pull request #797 from kiwix/flatpak-qt6
Flatpak uses qt6
2024-12-22 11:22:31 +01:00
Adam Lamar ac254d2082 Flatpak uses qt6 2024-12-21 11:38:49 -07:00
Kelson f7027cbf96
Merge pull request #796 from kiwix/fix_trigger_workflow
Fix OS_NAME for Trigger_Docker job in CD
2024-12-20 09:05:43 +01:00
rgaudin 234dd5f096
Fix OS_NAME for Trigger_Docker job in CD
In commit 2321717, OS_NAME was introduced to build_definition
in order to support jammy + focal.
The Trigger_Docker job was not updated and was to expecting to run on OS_NAME=linux
for which there is now line anymore and thus no possibility to trigger
2024-12-20 07:35:03 +00:00
Kelson 575a556412
Merge pull request #794 from kiwix/release-kiwix-desktop-2.4.1
Bump-up Kiwix-Desktop to version 2.4.1
2024-12-19 20:26:36 +01:00
Emmanuel Engelhart a0f1202880
Bump-up Kiwix-Desktop to version 2.4.1 2024-12-19 19:15:00 +01:00
Kelson c23567a3f7
Merge pull request #793 from kiwix/fix-flathub
Fix compilation of Kiwix Desktop 2.4.0 on Flathub
2024-12-19 18:33:12 +01:00
Emmanuel Engelhart 525e4acc3b
Include libmicrohttpd patches on Flathub compilation 2024-12-19 17:48:03 +01:00
Kelson d92ac512f9
Merge pull request #790 from kiwix/aria2c-1.37
Use aria2c 1.37.0 in kiwix-desktop appimage
2024-12-19 13:28:14 +01:00
Emmanuel Engelhart 57e2c518c2
Use aria2c 1.37.0 in kiwix-desktop appimage 2024-12-19 13:27:34 +01:00
Kelson 656d65ea17
Merge pull request #789 from kiwix/aria2c-on-drive
Aria2c has to be stored on dev.kiwix.org
2024-12-18 17:29:36 +01:00
Emmanuel Engelhart c8b2dd4fd8
Aria2c has to be stored on dev.kiwix.org 2024-12-18 15:17:39 +01:00
Kelson 0109c8ced3
Merge pull request #787 from kiwix/fix_for_publishing_kiwix-desktop_sources
Fixed a bug in kiwix-desktop's source publishing step
2024-12-18 05:55:09 +01:00
Veloman Yunkan a5a6ba1c52 Fixed kiwix-desktop Windows package name generation 2024-12-17 18:42:15 +04:00
Veloman Yunkan 4d838cf4de Fixed a bug in kiwix-desktop's source publishing step
The bug was there since 2018. It's strange that it didn't cause problems
with previous releases. The most plausible explanation is that this is
the first time when the sources of kiwix-desktop are being published
via this procedure.
2024-12-17 11:59:03 +04:00
Emmanuel Engelhart b1b545a65b
Properly appending '.zip' 2024-12-16 22:31:03 +01:00
Kelson ef54fd823e
Merge pull request #786 from kiwix/kiwix-desktop-version-bump 2024-12-16 19:35:58 +01:00
Veloman Yunkan c61e4c27c5
Bumped version of kiwix-desktop to 2.4.0 2024-12-16 16:06:58 +04:00
Kelson d830f3171a
Merge pull request #784 from kiwix/kiwix-desktop-2.4.0
Release Kiwix for Linux/Windows 2.4.0
2024-12-14 17:02:08 +01:00
Emmanuel Engelhart 4b750aa02e
Release Kiwix for Linux/Windows 2.4.0 2024-12-14 16:37:04 +01:00
Kelson 97d89e634c
Merge pull request #781 from kiwix/dev_kiwix_org
Fix dev.kiwix.org URL for kiwix-build's own deps
2024-12-04 14:12:34 +01:00
rgaudin 2df3c0b5e2
Use dev.kiwix.org
download.kiwix.org/dev/ was deprecated long ago, using correct address
2024-12-03 15:01:46 +00:00
Kelson a14970bc43
Merge pull request #771 from kiwix/kiwix-desktop_jammy_appimage
Kiwix desktop jammy appimage
2024-12-02 20:21:57 +01:00
Veloman Yunkan ff2ade262c Migrate kiwix-desktop appimage build to jammy 2024-12-02 11:50:46 +04:00
Veloman Yunkan 2321717c83 Added OS_NAME in build definition table for focal
Next we are going to have some CI/CD jobs running on jammy instead
of focal that's why the build platform for Linux jobs has to be made explicit.
2024-12-02 11:50:46 +04:00
Veloman Yunkan c116685b21 kiwix-desktop appimage creation under jammy
- Switched from linuxdeployqt to (linuxdeploy + linuxdeploy-plugin-qt)

- Eliminated custom creation of the AppDir & most manual copying of
  some stuff into it (trusting linuxdeploy to do everything needed
  for the correct operation of the appimage). Note, however, that
  nss/ libs are no longer bundled with the appimage (libthai.so is
  forcefully bundled via a special option to linuxdeploy).
2024-12-02 11:50:46 +04:00
Veloman Yunkan d0eeca32d1 Revert "libssl is embedded in the kiwix-desktop appimage"
This reverts commit dee57f131c.
2024-12-02 11:50:46 +04:00
Kelson 83b45a013c
Merge pull request #778 from kiwix/libcurl_toolless_build
Avoid building and installing curl executable
2024-11-26 14:38:10 +01:00
Veloman Yunkan 680ff58756 Don't install curl tool
We only need the libcurl library. Building and installing the curl tool
leads to a build failure under Windows because of a missing "strip"
utility.
2024-11-22 19:30:13 +01:00
Kelson 8c3ba3f3cb
Merge pull request #779 from kiwix/windows_builds_in_release_mode
Under Windows builds are forced to release mode
2024-11-22 19:29:05 +01:00
Veloman Yunkan 1c6994546c Under Windows builds are forced to release mode
base_deps_meta_version was bumped so that the base dependencies archives for CI
workflows are recreated (we need only the Windows flavours of the
archives updated but such surgical intervention is not supported).
2024-11-22 19:59:28 +04:00
Kelson 6cb347c576
Merge pull request #775 from kiwix/fix-kiwix-desktop-zip
Fix kiwix desktop zip
2024-11-02 18:54:22 +01:00
Emmanuel Engelhart c7a0d8c13b ZIP only the content of the directory 2024-10-31 17:10:39 +01:00
Emmanuel Engelhart 946a28da0e Add execution flag to package_kiwix-desktop_windows.py 2024-10-31 17:10:39 +01:00
Kelson 63b59b7d16
Merge pull request #774 from kiwix/remove-bintray
Bintray is deprecated
2024-10-31 17:10:25 +01:00
Emmanuel Engelhart 2a25dbb22f
Bintray is deprecated 2024-10-31 16:28:46 +01:00
Kelson 374411e05a
Merge pull request #773 from kiwix/small-readme-badge-fix
Fix CD badge
2024-10-31 16:05:25 +01:00
Emmanuel Engelhart a50d782ab7
Fix CD badge 2024-10-31 16:04:51 +01:00
Kelson 889e931a99
Merge pull request #772 from kiwix/unsync-ci-cd
Execute nightly at 3AM (in place of 1AM)
2024-10-31 15:43:25 +01:00
Emmanuel Engelhart bcb16d34ef
Execute nightly at 3AM (in place of 1AM) 2024-10-30 17:42:55 +01:00
Kelson 022f657cd7
Merge pull request #769 from kiwix/speedup-sftp-via-better-cipher
Better comment about scp vs. sftp
2024-10-18 19:57:05 +02:00
Emmanuel Engelhart d03837b47f
Better comment about scp vs. sftp 2024-10-18 18:15:08 +02:00
Kelson ecd8f988cf
Merge pull request #768 from kiwix/libkiwix-14.0.0-1
New libkiwix build due to bundled libcurl dep issue
2024-10-18 17:10:40 +02:00
rgaudin bb0b86d9b8
New libkiwix build due to bundled libcurl dep issue 2024-10-18 14:40:48 +00:00
Kelson e1b6d1f1ce
Merge pull request #767 from kiwix/rename-fix-cd-workflow
Using upload_failure_logs.py (not .sh)
2024-10-18 14:40:34 +02:00
Emmanuel Engelhart e8a7924794 Use actions/setup-python@v5 2024-10-18 14:40:18 +02:00
Emmanuel Engelhart 0b8919d919 Use actions/checkout@v4 2024-10-18 14:40:18 +02:00
Emmanuel Engelhart be5fe08dfc Stalebot is deprecated 2024-10-18 14:40:18 +02:00
Emmanuel Engelhart 7aba1ddcb9 FUNDING.yml is provide via .github repo 2024-10-18 14:40:18 +02:00
Emmanuel Engelhart 8e5afad538 Using upload_failure_logs.py (not .sh) 2024-10-18 14:40:18 +02:00
Kelson c9920d5e18
Merge pull request #766 from kiwix/depsup
Bump base_deps_meta_version to rebuild libcurl
2024-10-18 14:15:02 +02:00
rgaudin edfbefb11e
Bump base_deps_meta_version to rebuild libcurl 2024-10-18 10:05:19 +00:00
Kelson dfe53e13e9
Merge pull request #765 from kiwix/gss-symbols
Fix missing symbols on CoreKiwix.xcframework
2024-10-17 18:42:31 +02:00
rgaudin 59778f4452
Disable GSS-API (via Kerberos which uses it) in libcurl compile 2024-10-17 10:50:39 +00:00
rgaudin 74767e6234
Disable libpsl when compiling libcurl
libpsl is a lib that provides the Public Suffix List: the list
of all TLDs.
It's an optional feature of libcurl that we dont need for libkiwix.

Leaving it included causes issues when compiling for apple_all_static
on x86_64 as libpsf is installed (and thus found by libcurl's configure)
but is obviously only for x86_64.

An alternative could be to either cross-compile it first and properly
reference that version.

That sounds like too much effort for a feature we know we dont need.

https://github.com/rockdaboot/libpsl
2024-10-16 09:52:17 +00:00
rgaudin c58b209f33
Download libcurl patches from dev.kiwix.org 2024-10-16 09:42:03 +00:00
Kelson 8f73fb6b30
Merge pull request #763 from kiwix/libkiwix_14.0.0
Release libkiwix 14.0.0
2024-10-11 15:54:18 +02:00
Emmanuel Engelhart a80121593b
Release libkiwix 14.0.0 2024-10-11 15:21:51 +02:00
Kelson a33705dfb6
Merge pull request #762 from kiwix/trigger_base_deps_rebuild
Bump base_deps_meta_version to rebuild libmicrohttpd
2024-10-08 18:18:39 +00:00
Veloman Yunkan 145b1b2723 Bump base_deps_meta_version to rebuild libmicrohttpd 2024-10-08 20:58:11 +04:00
Kelson 642f63cbaa
Merge pull request #761 from kiwix/libmicrohttpd_enable_ipv6_under_windows
Enable IPv6 in meson build of libmicrohttpd under Windows
2024-10-08 16:11:44 +00:00
Veloman Yunkan b2a756baa6 Enable IPv6 in meson build of libmicrohttpd under Windows 2024-10-08 17:04:29 +04:00
Kelson e53edc8d42
Merge pull request #756 from kiwix/sign_windows_binaries
Sign windows binaries
2024-09-10 11:21:18 +00:00
Matthieu Gautier 263ce4c87d
Sign all binaries (exe) on Windows when we do a release 2024-09-10 09:25:24 +00:00
Matthieu Gautier 49b15d12b7
Remove cross-building libzim to win32.
Now we build libzim natively on Windows, we can remove cross-compilation
to Windows.
2024-09-10 09:25:24 +00:00
Kelson 507d05a256
Merge pull request #751 from kiwix/release-zim-tools-4.5.0
Release zim-tools 3.5.0
2024-09-08 19:10:10 +00:00
Emmanuel Engelhart 1ab240d44b
Release zim-tools 3.5.0 2024-09-08 20:43:54 +02:00
Matthieu Gautier d8071bd947 Rebuild libzim release, with manylinux fixes 2024-09-02 17:48:08 +02:00
Matthieu Gautier 04f7d6457d
Merge pull request #728 from kiwix/zim-tools_windows 2024-09-02 16:02:35 +02:00
Matthieu Gautier 6c9889d4e8 Compile kiwix-tools on Windows github CI 2024-09-02 14:25:26 +02:00
Matthieu Gautier ba4a54bf9d Compile zim-tools on Windows github CI. 2024-09-02 14:25:26 +02:00
Matthieu Gautier 7e9cb8c501
Merge pull request #747 from kiwix/manylinux_archive 2024-09-02 14:03:33 +02:00
Matthieu Gautier dc2a837450 Update to libkiwix version change (14.0.0)
Libkiwix update its version to 14.0.0 and we use the declared version in
`version.py` to select file to package and sign.
So we must be in sync.
2024-09-02 12:38:43 +02:00
Matthieu Gautier e5b7bccdf2 Correctly include lib64 library on manylinux archives
Manylinux build are based on Redhat and libs are put in `/lib64`
directory and not in `/lib/<arch>/` as on Debian based build.

Fix #746
2024-09-02 12:05:36 +02:00
Matthieu Gautier 3905de7110
Merge pull request #745 from kiwix/nigthly_publish 2024-08-30 17:27:47 +02:00
Matthieu Gautier c716617bbd Make nigthly CD build and publish only "publishable" project.
There is no reason to publish nightly for all project we try to build
in the CI.

We should publish nigthly for same project that we do for releases.
(Minus the filter of what have changed since last release)

Fix #743
2024-08-30 16:33:38 +02:00
Matthieu Gautier b0a610ffec
Merge pull request #741 from kiwix/no_appveyor 2024-08-30 15:45:13 +02:00
Matthieu Gautier 334b1f81cc Do not build kiwix-desktop using Appveyor CI
Fix #521, #425
2024-08-30 15:02:03 +02:00
Matthieu Gautier b527c7c0bb
Merge pull request #744 from kiwix/naming_fixes 2024-08-30 15:01:47 +02:00
Matthieu Gautier d091c8802f Fix library publication of libkiwix on Windows
Fix #743
2024-08-30 14:32:03 +02:00
Matthieu Gautier 6207b0ab0b Fix binary extension on Windows 2024-08-30 14:32:03 +02:00
Matthieu Gautier 8401ee5ea3 Fix kiwix-desktop archive name on Windows 2024-08-30 14:32:03 +02:00
Matthieu Gautier 5f65164e1a
Merge pull request #740 from kiwix/kiwix-desktop_signing 2024-08-29 19:47:57 +02:00
renaud gaudin 8b9d9f87e5 Use specific version of signtool
Default version of signtool in PATH does not work properly with our CKA.
We could also load an SDK's env batch file instead but setting this on the workflow
is more maintainable as we'll get a clear missing file error on GA Image change
2024-08-29 19:10:55 +02:00
Matthieu Gautier de90c6fefc Setup kiwix-destkop signature on Windows.
Fix #713
2024-08-29 15:53:58 +02:00
Matthieu Gautier 52d757c660 Publish kiwix-desktop Windows build in Windows CI 2024-08-29 14:35:50 +02:00
Matthieu Gautier 21176bcf82
Merge pull request #739 from kiwix/no_cache_release 2024-08-29 11:15:53 +02:00
Matthieu Gautier 69358afe0b Rebuild libzim release 2024-08-29 10:26:07 +02:00
Matthieu Gautier b4bc9dbec9 Do not use base_deps when building releases.
Initially we were building all our dependencies in release.
This was simply made by always compiling project using autotool or cmake
in release. As our project are using meson/qmake, all the dependencies
are build in release.

However, with recent port to Windows github CI, we have two problems:
- We have moved almost all buildsystem to meson
- On Windows, we cannot mix debug and release build.

So, when doing a release, do not use base dependencies cache.
This will extend the release workflow as we need to build everything but
at least we should build everything correctly.
2024-08-29 10:26:07 +02:00
Kelson c17c2f274c
Merge pull request #737 from kiwix/release-libzim-9.2.3
Release libzim 9.2.3
2024-08-28 21:37:23 +02:00
Emmanuel Engelhart c627f62ee1 Release libzim 9.2.3 2024-08-28 21:04:22 +02:00
Matthieu Gautier 290a8b811f
Merge pull request #736 from kiwix/zim-tools_deps_windows 2024-08-28 20:41:19 +02:00
Matthieu Gautier e75fc76162 Bump base_deps_meta_version to rebuild docopt, icu and boostregex 2024-08-28 20:10:52 +02:00
Matthieu Gautier 01655d3ce0 Use icu4c pre-compiled using MSVC2022 on Windows 2024-08-28 20:10:52 +02:00
Matthieu Gautier 7009841bcc Make docoptcpp use boost.regex on Windows
std::regex is kind of broken on Windows[1].

[1] https://github.com/docopt/docopt.cpp/issues/49
2024-08-28 20:10:52 +02:00
Matthieu Gautier 3eefbf7312
Merge pull request #734 from kiwix/icu_dll 2024-08-28 17:09:07 +02:00
Matthieu Gautier 244e4d209f Add icu dlls in nightly and releases
On windows, we use prebuild icu and is available as dll.

So we must include those dll in all our archives.
2024-08-28 14:03:34 +02:00
Matthieu Gautier 31aee276ad
Merge pull request #733 from kiwix/tools_deps_ci_windows 2024-08-27 17:14:48 +02:00
Matthieu Gautier 37c5d35969 Be explicit about windows image to use in CI 2024-08-27 16:45:17 +02:00
Matthieu Gautier ef94b2bea5 Add docoptcpp as dependency of kiwix-tools 2024-08-27 15:53:22 +02:00
Matthieu Gautier 147e98f7cb Use our hosted archive for aarch toolschain.
Upstream have removed the archive with its new release.
2024-08-27 15:53:22 +02:00
Matthieu Gautier ec5a36903b Bump base_deps_meta_version to rebuild docopt 2024-08-27 15:39:25 +02:00
Matthieu Gautier 93d3fdd14e Build docoptcpp using Meson 2024-08-27 15:39:25 +02:00
Matthieu Gautier a7f42fcc99 Compile zim-tools dependencies on Windows github CI. 2024-08-27 15:39:25 +02:00
Matthieu Gautier d08c6095a3
Merge pull request #732 from kiwix/test_likiwix
Activate testing of libkiwix on Windows
2024-08-27 14:01:50 +02:00
Matthieu Gautier 667deb00c3 Activate testing of libkiwix on Windows
Now we have fixed libkiwix on Windows, we can activate testing it.

See kiwix/libkiwix#1113
2024-08-27 13:19:15 +02:00
Matthieu Gautier ab7983ede6
Merge pull request #731 from kiwix/fix_nightly_qt 2024-08-27 10:11:44 +02:00
Matthieu Gautier 86509a9ce6 Install QT on Windows CI release&nigthly 2024-08-27 09:13:49 +02:00
Matthieu Gautier 4ff5132704
Merge pull request #719 from kiwix/win-kiwix-desktop 2024-08-26 12:26:22 +02:00
Matthieu Gautier d8b4d24d7f Add more dependencies is base dependencies on Windows 2024-08-26 10:40:24 +02:00
Matthieu Gautier 45ad41724c Package kiwix-desktop on Windows 2024-08-26 10:40:24 +02:00
Matthieu Gautier 1d93c35c50 Format common.py file. 2024-08-26 10:40:24 +02:00
Matthieu Gautier ce4d03989b Build only debug or release on Windows.
On Windows we cannot mix debug and release build.
So we have to choose only one.
2024-08-26 10:40:24 +02:00
Matthieu Gautier 1e4b88d2f0 Use nmake instead of make on Windows
Qmake in generating Makefile for nmake on Windows/msvc.
2024-08-26 10:40:24 +02:00
Matthieu Gautier 7fbeb2fc6d Move `-j4` option in `make_options`
This way we can remove it when on Windows.
2024-08-26 10:40:24 +02:00
Matthieu Gautier 702292c14c [CI] Build kiwix-desktop on Windows 2024-08-26 10:40:24 +02:00
Matthieu Gautier 3d40dbbaad Install QT on Windows CI 2024-08-26 10:40:24 +02:00
Matthieu Gautier 9c7f963681
Merge pull request #727 from kiwix/libzim_nigthly_windows 2024-08-26 10:39:48 +02:00
Matthieu Gautier c0bf54486d Correctly include dll and lib of libzim archive on Windows 2024-08-24 11:24:11 +02:00
Matthieu Gautier b5986e569f
Merge pull request #726 from kiwix/libmicrohttpd_size_windows 2024-08-22 16:46:26 +02:00
Matthieu Gautier 3bdce3069a Patch libmicrohttpd's meson to correctly detect size of `timeval.tv_sec` 2024-08-22 15:21:53 +02:00
Matthieu Gautier bc64bdbbac
Merge pull request #725 from kiwix/CI_Windows_projects 2024-08-21 16:15:39 +02:00
Matthieu Gautier d87b37fba2 Fix flatpak builder for source with several archives 2024-08-21 15:43:28 +02:00
Matthieu Gautier cc4af80c2c Create zip archive on Windows.
Fix #128
2024-08-21 15:11:42 +02:00
Matthieu Gautier f00fa4cbd6 Use prebuild aria2c on Windows 2024-08-21 15:11:42 +02:00
Matthieu Gautier 5905de35a1 Bump base_deps_meta_version to rebuild libmicrohttpd and libcurl 2024-08-21 13:33:26 +02:00
Matthieu Gautier 85d1bcff7e Do not build pugixml in release mode.
All project must be either compile in debug or release on Windows.
2024-08-21 13:33:26 +02:00
Matthieu Gautier 6c8a9540bd Build libmicrohttpd with meson 2024-08-21 13:33:26 +02:00
Matthieu Gautier 23a6b93fcc Build libcurl with meson. 2024-08-21 13:33:26 +02:00
Matthieu Gautier 04d0ba6a92 Temporary deactivate test for libkiwix on Windows. 2024-08-21 13:33:26 +02:00
Matthieu Gautier dba6065457 Build dependencies of other projects on Windows 2024-08-21 13:33:26 +02:00
Matthieu Gautier e0ffa7bdc2 [CI] Correctly include dll and lib in libzim archive 2024-08-21 11:02:36 +02:00
Matthieu Gautier b027e1b78c
Merge pull request #724 from kiwix/fix_icu4c_meson_patch 2024-08-21 11:02:24 +02:00
Matthieu Gautier 294c34ca80 Fix extract of meson archive.
Previous commit was removing the meson_archive.

Fix #723
2024-08-21 10:02:33 +02:00
Matthieu Gautier 2a9d545576
Merge pull request #722 from kiwix/fix_pkg_config_icu4c
Fix pkg_config template for icu4c on Windows.
2024-08-20 18:51:24 +02:00
Matthieu Gautier edf1e4ce03 Fix pkg_config template for icu4c on Windows.
We must use `/` separator.
Meson post-process output of pkg-config. If we use `\`,  it miss-interpret it
and libdir is broken.
2024-08-20 18:15:24 +02:00
Matthieu Gautier 3bd6ba5ec7
Merge pull request #721 from kiwix/ci_windows_all_config 2024-08-20 17:37:15 +02:00
Matthieu Gautier 00363fdc8c Use prebuilt icu on Windows 2024-08-20 17:07:45 +02:00
Matthieu Gautier 97d446642c [CI] Run native windows CI on release/Nigthly 2024-08-20 09:56:22 +02:00
Matthieu Gautier 51cceb7c58 [CI] Run the Windows CI using all native config (static, dyn, mixed) 2024-08-20 09:53:52 +02:00
Matthieu Gautier b2704f66f8
Merge pull request #720 from kiwix/no_qt_compile 2024-08-19 13:50:42 +02:00
Matthieu Gautier f433b25013 Kiwix-build doesn't try to build qt nor qtwebengine
Fix #714
2024-08-19 12:11:38 +02:00
Matthieu Gautier c917ff08c3
Merge pull request #718 from kiwix/fix_dl_deps_archive 2024-08-19 11:53:47 +02:00
Matthieu Gautier cf60d1789d Update dl_deps_archive dist 2024-08-19 11:37:44 +02:00
Matthieu Gautier ad72464794
Merge pull request #715 from kiwix/win-xapian 2024-08-18 12:10:18 +02:00
Matthieu Gautier be232d790e Add xapian-core to base dependencies on Windows. 2024-08-15 14:10:17 +02:00
Matthieu Gautier 28d02bfd7a Deactivate xapian fuller compact on libzim.
This flag used on xapian-meson build on Windows ends in a crash in
libzim when compacting the database.

To be fixed at a moment but let's not use this flag for now on Windows
2024-08-15 14:09:15 +02:00
Matthieu Gautier 752bdd18ac Build xapian with classic autotools on other platform than Windows.
The meson build fails on cross compiliation `win32_*` and
on `native_dyn` on Macos (but doesn't fail on `native_static` or
`native_mixed`...)

On top of that, the fact that xapian-meson build system is fluky on
Windows doesn't make me confident.
As I will be out for few months, I prefer keep the autotool build system
on already working configs.
2024-08-15 14:07:24 +02:00
Matthieu Gautier 16654f9563 All native config are compatible with windows. 2024-08-15 14:07:16 +02:00
Matthieu Gautier ef6f654e7b Build native_mixed on windows
Xapian build with meson is static only.
This is mainly due to missing "ddl export" or ".def" file.

Autotool buildsystem seems to handle that automatically but not meson.
See https://github.com/mesonbuild/meson/issues/2132 about meson
supporting this.
2024-08-15 14:04:32 +02:00
Matthieu Gautier b026e7e06c Bump base_deps_meta_version to rebuild xapian-core 2024-08-15 14:04:26 +02:00
Matthieu Gautier 942dba4d9c Use git source for xapian.
We have move the meson build system (and various fixes) in a git
repository.
2024-08-15 14:03:59 +02:00
Matthieu Gautier b589496076 Do not use custom data for icu4c on Windows.
Meson build system of ICU seems to not support custom data on Windows.
So let's use the default data on Windows.
2024-08-15 14:03:55 +02:00
Matthieu Gautier f9b890c58d Build xapian using meson build system. 2024-08-15 14:03:49 +02:00
Matthieu Gautier 8648e8bc27 Revert "Do not build libzim with xapian dependency on Windows."
This reverts commit 6bfe9ec8b1.
2024-08-15 14:03:45 +02:00
Matthieu Gautier 9931bb690a
Merge pull request #717 from kiwix/update_flatpak
Update flatpak build
2024-08-14 21:50:32 +02:00
Matthieu Gautier 907d39ab84 Update flatpak build
Fix https://github.com/flathub/org.kiwix.desktop/issues/10
Fix https://github.com/kiwix/kiwix-desktop/issues/961
2024-08-14 17:12:41 +02:00
Matthieu Gautier 08efe8e1f7
Merge pull request #716 from kiwix/gz_dep_archive 2024-08-14 17:12:29 +02:00
Matthieu Gautier 5248b4eb2a Use gz compression for deps archive.
It is a bit of memory waste but a lot of time win (at least
on android build)
2024-08-14 15:02:57 +02:00
Matthieu Gautier 6463307ac7
Merge pull request #711 from kiwix/zim-tools_3.4.2 2024-07-11 09:48:17 +02:00
Matthieu Gautier 2a1b18066f New version 3.4.2 of zim-tools 2024-07-10 19:12:25 +02:00
Matthieu Gautier 02b0ae677c
Merge pull request #710 from kiwix/no_qmake5_hardcoded 2024-07-10 19:12:09 +02:00
Matthieu Gautier c7bd6182e0 Do not hard-code qmake command 2024-07-08 15:25:54 +02:00
Matthieu Gautier cba77fdca6
Merge pull request #709 from kiwix/rebuild_libkiwix 2024-06-28 10:41:54 +02:00
Matthieu Gautier d066655a73 Rebuild libkiwix 13.1.0
When releasing libzim and libkiwix, we use config native_mixed with is a
mix of static and dynamic linking:

- Dependencies are build as static libraries.
- Released projects (libzim/libkiwix) are build as dynamic libraries,
  statically linked to dependencies.

This way, we have only one `.so` file which contain all our needed symbols.

However, this logic is "local" to each project.
This mean that libkiwix is linked **statically** to libzim.
So libkiwix.so is containing libzim symbols.

But on "java-libkiwix", we are both linking to libzim.so and libkiwix.so.
If the version of the (dynamically) used libzim.so is not the same that the
version on which we have (statically) linked libkiwix.so, we end with
symbols of two different versions being loaded and conflicting.

So let's rebuild libkiwix with last version of libzim to avoid this conflict.
2024-06-28 09:50:52 +02:00
Kelson 289ae6f78a
Merge pull request #708 from kiwix/libzim_9.2.2
Release libzim 9.2.2
2024-06-22 15:52:19 +02:00
Emmanuel Engelhart 35ca7068a1
Bump-up version of base_deps_meta_version 2024-06-22 15:00:08 +02:00
Emmanuel Engelhart 4b6c4a2547
Use version 0.6.0 of ZIM testing suite 2024-06-22 14:55:32 +02:00
Emmanuel Engelhart 2b25f3cfc3
Release libzim 9.2.2 2024-06-22 14:24:20 +02:00
Matthieu Gautier 23de94e0ca
Merge pull request #707 from kiwix/fix_appveyor_build 2024-06-20 17:49:41 +02:00
Matthieu Gautier 2652899781 [AppVeyor] Update url of pkg-config-lite 2024-06-20 17:24:38 +02:00
Matthieu Gautier e31147c7e5 Revert "WIP Use windows branch on windows CI"
This reverts commit 05fc3b409c.

This was a temporary commit to make the PR compile with a dev branch of libzim.
Now PR on libzim is merged. We must remove this commit.
2024-06-17 10:11:03 +02:00
Kelson e408b5b1ca
Merge pull request #703 from kiwix/libzim_github_ci_windows
Libzim GitHub CI windows
2024-06-15 16:43:10 +02:00
Matthieu Gautier 05fc3b409c WIP Use windows branch on windows CI 2024-06-07 18:34:30 +02:00
Matthieu Gautier d2d1f686b1 Build libzim on windows with werror=false
MSVC throw a lot of warning because we also must re-export stl symbols
used in our exported class.

See [1] and [2] (and links inside) for more information.

Especially [3] which seems to say that we should have issue at link time if
it compatibility issue occurs (and so easily catchable).

So I just remove the `werror=true` for now.

[1] https://stackoverflow.com/questions/16419318/one-way-of-eliminating-c4251-warning-when-using-stl-classes-in-the-dll-interface
[2] https://stackoverflow.com/questions/2132747/warning-c4251-when-building-a-dll-that-exports-a-class-containing-an-atlcstrin
2024-06-07 18:33:55 +02:00
Matthieu Gautier 703554d556 Correctly strip newline (on Windows) 2024-06-07 15:38:46 +02:00
Matthieu Gautier 46e58b763d Don't depend on lzma. 2024-06-07 15:38:45 +02:00
Matthieu Gautier 6bfe9ec8b1 Do not build libzim with xapian dependency on Windows. 2024-06-07 15:38:05 +02:00
Matthieu Gautier e3656ab3f6 Do not print warning on windows 2024-06-07 15:36:58 +02:00
Matthieu Gautier cd04a895fb Bump base_deps_meta_version 2024-06-07 15:36:58 +02:00
Matthieu Gautier bea72574b0 Use python to update failure logs. 2024-06-07 15:36:58 +02:00
Matthieu Gautier bdda21f7c7 Use paramiko module to upload archives. 2024-06-07 15:36:58 +02:00
Matthieu Gautier 1f4409d2ac Correctly get temp dir on Windows. 2024-06-07 15:36:58 +02:00
Matthieu Gautier 0e0ac010bb Build icu4c using meson on Windows. 2024-06-07 15:36:58 +02:00
Matthieu Gautier 93a8c89996 Do not set permission to 0 for extracted file. 2024-06-07 15:36:58 +02:00
Matthieu Gautier ca3d90d793 Use the correct path separator on Windows 2024-06-07 15:36:58 +02:00
Matthieu Gautier baa4470ebb Use setup command in meson. 2024-06-07 15:36:58 +02:00
Matthieu Gautier 3b0532b395 Update zstd 2024-06-07 15:36:58 +02:00
Matthieu Gautier 45255078f9 Build lzma using meson build system. 2024-06-07 15:36:58 +02:00
Matthieu Gautier 04942020d7 Fix extracting of several archives.
- Archive already existing must not stop download of other archives.
- Use copytree instead of rename to use second archive as patch on existing
  directory. (No need to remove tmpdir, as it is a temporary directory)
2024-06-07 15:36:58 +02:00
Matthieu Gautier 941cbc8310 Build zlib using meson.
Use the wrap coming from meson's wrapdb.
2024-06-07 15:36:58 +02:00
Matthieu Gautier 62dc698fad Build only libzim (and dependencies on Windows) 2024-06-07 15:36:54 +02:00
Matthieu Gautier 92673f357b Build on Windows with github-actions. 2024-06-07 15:29:55 +02:00
Matthieu Gautier e8f873f106
Merge pull request #705 from kiwix/rebuild_android_libzim_libkiwix 2024-06-05 18:17:10 +02:00
Matthieu Gautier bfb029bd6c Rebuild libzim and libkiwix.
This rebuild is for android arm compilation fix.
2024-06-05 15:43:36 +02:00
Matthieu Gautier 9f9c03a1b9
Merge pull request #704 from kiwix/fix_android_compilation 2024-06-05 14:39:18 +02:00
Matthieu Gautier b1f7beef4f Exclude libgcc and libunwind from linked libraries on Android.
As said in [1], unwinder is linked automatically by Clang and shared
library must not re-export it.

ndk after r23 (we are using r21) should be this. Else we must take care to
not re-export it.

From [2], we should pass the flags `Wl,--exclude-libs,libgcc.a` and
`-Wl,--exclude-libs,libunwind.a` to avoid re-export `_Unwind_Resume` methods.

Fix https://github.com/kiwix/kiwix-android/issues/3661

[1] https://android.googlesource.com/platform/ndk/+/master/docs/BuildSystemMaintainers.md#Unwinding
[2] https://github.com/android/ndk/issues/889#issuecomment-464334469
2024-06-04 15:12:40 +02:00
Matthieu Gautier f4e2f0a845
Merge pull request #702 from kiwix/no_bionic 2024-06-03 16:53:39 +02:00
Matthieu Gautier 8832888aaa Add almalinux as compatible host for native and aarch config 2024-06-03 10:43:37 +02:00
Matthieu Gautier 1534b85c56 Fix indentation of build_definition 2024-06-03 10:43:37 +02:00
Matthieu Gautier 683250ca9d Use manylinux container instead of bionic
Alignement of the table in build_definition will be fixed in later commit
to not mix functionnal and cosmetic changes in the same commit.
2024-06-03 10:42:49 +02:00
Matthieu Gautier 82500c545b
Merge pull request #694 from kiwix/kiwix-desktop-appimage-openssl 2024-05-17 17:51:12 +02:00
Veloman Yunkan dee57f131c libssl is embedded in the kiwix-desktop appimage
libssl.so and libcrypto.so are embedded in the appimage so that it can
work on newer systems having a deceptively backward incompatible
version of OpenSSL.

The fix includes patching the libQt5Network.so library so that aria2's CA
certificate bundle (being included in the appimage before this change)
is used as a fallback if no certificates can be found in various
locations used for certificate stores on different major Linux
distributions. To this end, the AppRun entry point of the AppImage is
changed from a symlink to the kiwix-desktop binary to a small shell
script that creates a temporary symlink at a hardcoded path
(/tmp/cert_bundle_provided_by_kiwix.crt) pointing to the said
certificate bundle within the AppImage filesystem.
2024-05-17 15:33:52 +02:00
Kelson 5b82252230
Merge pull request #701 from kiwix/zim-tools_3.4.1
Release libzim 3.4.1
2024-05-16 21:08:05 +02:00
Emmanuel Engelhart 652af505a6
Release libzim 3.4.1 2024-05-16 19:20:45 +02:00
Kelson 23dd7b367c
Merge pull request #693 from kiwix/kiwix-desktop-appimage-libthai_so
Forcefully adding libthai.so to kiwix-desktop appimage
2024-05-02 21:20:31 +02:00
Veloman Yunkan d5333139d9 Adding libthai.so to kiwix-desktop appimage 2024-05-02 21:17:18 +02:00
Kelson 723fb60d74
Merge pull request #699 from kiwix/libzim_9.2.1
Build libzim 9.2.1 and subsequent projects
2024-05-02 13:13:11 +02:00
Emmanuel Engelhart 29c7780d4f
Build libzim 9.2.1 and subsequent projects 2024-05-02 13:11:35 +02:00
Kelson 0ebf4c97ed
Merge pull request #698 from kiwix/update-actions-for-nodejs20
Update actions relying on old Node.js16
2024-05-02 12:49:13 +02:00
Emmanuel Engelhart 4b33546b77
Update actions relying on old Node.js16 2024-05-02 11:35:59 +02:00
Matthieu Gautier 8041938350
Merge pull request #692 from kiwix/libzim_9.2.0 2024-04-16 19:43:58 +02:00
Matthieu Gautier 6aa661a474 New libzim version 9.2.0 2024-04-16 18:28:32 +02:00
Matthieu Gautier a2cb517edb
Merge pull request #689 from kiwix/ci-apple-silicon 2024-04-12 13:13:36 +02:00
Matthieu Gautier 89802f5e07 Publish deps archive on macos arm64 using mixed config. 2024-04-12 11:54:38 +02:00
Matthieu Gautier a0baee815f Update to python 3.10 2024-04-12 11:52:49 +02:00
Matthieu Gautier 145d981328
Merge pull request #688 from kiwix/fix_build_dir 2024-04-12 10:28:50 +02:00
Matthieu Gautier 9235f8b048 Do not expect a full working environment when only asking for build dir.
Job `Trigger_Docker` is run in a simple environment not configured.
So tools as `ninja` are not installed. But we don't care as we just want
to trigger a docker build.
But `common` script now start by asking kiwix-build the build dir.
kiwix-build must not fail in this case.
2024-04-11 17:05:45 +02:00
Matthieu Gautier d6285adaf9
Merge pull request #685 from kiwix/build_dir 2024-04-09 11:33:30 +02:00
Matthieu Gautier a93b3c8896 Remove the `2` in base_deps name 2024-04-08 16:53:17 +02:00
Matthieu Gautier 0d27cbd8cf Update github's action to download the right deps archive. 2024-04-08 16:50:10 +02:00
Matthieu Gautier b880da6ca2 native_static is compatible with Darwin 2024-04-08 16:50:10 +02:00
Matthieu Gautier 6fbe60386e Do not pollute stdout with warning and trace. 2024-04-08 16:50:10 +02:00
Matthieu Gautier afda1f6673 Make CI common script use the correct build dir.
- Add an option to kiwix-build to get it.
2024-04-08 16:50:10 +02:00
Matthieu Gautier 0c0eac69c4 Introduce arch_name to name build dir base on arch name instead of config. 2024-04-08 16:50:03 +02:00
Matthieu Gautier 734c1ea6fc Update base_deps_version 2024-04-08 16:50:03 +02:00
Matthieu Gautier f0b214681c Properly escape char in `progress_chars` 2024-04-08 16:50:03 +02:00
Matthieu Gautier f42999199a `pj` now normalize path. 2024-04-08 16:50:03 +02:00
Matthieu Gautier 944eedcf56 Publish deps archive name using declared `dependency_name`.
Instead of compose it from `OS_NAME`, `COMPILE_CONFIG`.
2024-04-08 14:48:56 +02:00
Matthieu Gautier c6936ebc72 Introduce new dependency_name in build_definition 2024-04-08 14:48:56 +02:00
Matthieu Gautier 696242a0b1 Introduce helper `get_column_name()` 2024-03-25 15:40:16 +01:00
Kelson 6501464f76
Merge pull request #684 from kiwix/release-kiwix-tools-3.7.0
Release Kiwix Tools 3.7.0
2024-03-13 15:56:09 +01:00
Emmanuel Engelhart b8e499e81f
Release Kiwix Tools 3.7.0 2024-03-13 15:26:40 +01:00
Kelson cf5c2d35f1
Merge pull request #682 from kiwix/release-libkiwix-13.1.0
Release libkiwix 13.1.0
2024-02-25 16:01:51 +01:00
Emmanuel Engelhart 06512650fa
Release libkiwix 13.1.0 2024-02-25 15:17:43 +01:00
Matthieu Gautier 3ff2fe7be0
Merge pull request #681 from kiwix/zim-testing-suite-v5 2024-02-24 11:04:17 +01:00
Matthieu Gautier 0f82aff3c1 New version 0.5 for zim-testing-suite 2024-02-23 17:06:32 +01:00
Matthieu Gautier 4766ae5b56
Merge pull request #679 from kiwix/target_config
Rename option `--target-platform` to `--config`
2024-02-08 17:58:52 +01:00
Matthieu Gautier d4acd108ca Bump base_deps_meta_version. 2024-02-08 16:12:13 +01:00
Matthieu Gautier c25a2e63e3 [CI/CD] Use config instead of target in the CI. 2024-02-05 18:03:12 +01:00
Matthieu Gautier c0ec9c44b8 Rename option `--target-platform` to `--config`
The target_platform option has always be wrongly named.
This is not the platform we are targeted but how we compile.

This was ok at beginning as specifying how we compile somehow define
for what we compile but this is not a one to one mapping.
2024-02-05 18:03:11 +01:00
Matthieu Gautier 6dfb0da943 Cleanup README about libkiwix-app. 2024-02-05 18:02:30 +01:00
Matthieu Gautier 20ca39145d Remove `backend` (internal) option.
This is not used and it is a good things as it is broken..
2024-02-05 11:42:04 +01:00
Matthieu Gautier 5a1175cf2d Format our code with black 2024-02-05 11:41:09 +01:00
Matthieu Gautier 939f323709
Merge pull request #675 from kiwix/appveyor_update
Last appveyor platform version doesn't have python 3.6
2024-01-08 17:41:34 +01:00
Matthieu Gautier fa6fcb1c9f Last appveyor platform version doesn't have python 3.6 2024-01-08 16:29:29 +01:00
Kelson c91db165ba
Merge pull request #674 from kiwix/zim-tools-3.4.0
Release zim-tools 3.4.0
2023-12-31 16:41:13 +01:00
Emmanuel Engelhart aeaee8e075
Release zim-tools 3.4.0 2023-12-31 16:34:20 +01:00
Matthieu Gautier e000eddfd7
Merge pull request #669 from kiwix/download_deps_action
Download deps action
2023-12-19 13:49:06 +01:00
Matthieu Gautier 0aa09ca7c5 Remove `a` flag 2023-12-19 11:56:46 +01:00
Matthieu Gautier 0886129cab Correctly import path 2023-12-19 11:56:31 +01:00
Matthieu Gautier 4078003c98 Add path dependency. 2023-12-19 11:54:49 +01:00
Matthieu Gautier b97bd8e4ed New github's action to download dependencies archive.
To be used by other projects instead of the small bash script we currently have.
2023-12-19 11:54:46 +01:00
Kelson 2f39aedfa6
Merge pull request #672 from kiwix/libzim-9.1.0
Release libzim 9.1.0
2023-12-16 11:58:18 +01:00
Emmanuel Engelhart 817c46a529
Release libzim 9.1.0 2023-12-16 11:23:27 +01:00
Kelson 455cd2e181
Merge pull request #670 from kiwix/libkiwix-13.0.0-1
New build #1 of libkiwix-13.0.0
2023-12-08 14:10:13 +01:00
Emmanuel Engelhart 7f4dea0b89
New build #1 of libkiwix-13.0.0 2023-12-08 14:09:33 +01:00
Matthieu Gautier 6695af6014
Merge pull request #668 from kiwix/667-xcf
CoreKiwix for iOS Simulator
2023-12-05 11:09:09 +01:00
renaud gaudin 8c5bca05b7
Updated CI and builddef for renamed platform ; including new arm64 simulator 2023-12-05 07:04:53 +00:00
renaud gaudin afb7c504ea
Fixed #667: CoreKiwix for iOS Simulator
When we introduced CoreKiwix.xcframework, we made two mistakes:

- We forgot that some devs are on Apple Silicon and did not include arm64 arch for simulator
- We kept the `x86_64-apple-ios` target thinking simulator is a “just” an iOS on x64

This target mistake prevented XCode from finding our lib usable with the Simulator on x64.
Not including an arm64 version obviously prevented Silicon-using devs from using the Simulator.

The included libs changes now from

| Name                         | Content                                               |
| ---------------------------- | ----------------------------------------------------- |
| `ios-arm64`                  | All iOS devices are arm64                             |
| `ios-x86_64-simulator`       | Single x64 binary for Simulator                       |
| `macos-arm64_x86_64`         | Fat binary for macOS with both x64 and arm64          |

To

| Name                         | Content                                               |
| ---------------------------- | ----------------------------------------------------- |
| `ios-arm64`                  | All iOS devices are arm64                             |
| `ios-arm64_x86_64-simulator` | Fsat binary for iOS Simulator with both x64 and arm64 |
| `macos-arm64_x86_64`         | Fat binary for macOS with both x64 and arm64          |

- `iOSx64` Platforn renamed to `iOSx64Simulator` with its target fixed to `x86-apple-ios-simulator` (was `x86_64-apple-ios`)
- Added platformn `iOSArm64Simulator` for Apple Silicon devs to run Simulator
- `AppleXCFramework` dependency gets two changes:
    - Depends on all those platforms
    - `_make_macos_fat()` turned generic and called both for macOS fat binary and iOS Simulator one
2023-12-04 14:20:24 +00:00
Matthieu Gautier 98b5f3e84f
Merge pull request #654 from kiwix/no_shell
Run command without using shell.
2023-12-04 14:11:15 +01:00
Matthieu Gautier ab273f7d12 Run apple command as list. 2023-12-01 11:12:32 +01:00
Matthieu Gautier b7c4854d83 Build only libzim dependencies on bionic.
We compile only libzim on bionic, for compatibility with old libc.
No need to compile all other dependencies (and fight with some of them not
compiling)
2023-12-01 11:12:32 +01:00
Matthieu Gautier a0978a6ab4 Remove SvnClone.
We don't use it since a long time.
2023-12-01 11:12:32 +01:00
Matthieu Gautier c753e62913 Change base deps_meta version. 2023-12-01 11:12:24 +01:00
Matthieu Gautier 985643089a Detect the command instead of hardcoding them. 2023-12-01 11:11:26 +01:00
Matthieu Gautier c99a9bd91f Run the command without using shell=True.
It mainly allow to run command in directory containing space.
(Hello, `C:\Program Files\...`)
It would also allow to work on directory containning spaces
(`C:\Users\John Doe`) but xapian configure (at least) expressly doesn't
support it :/

- Run the command without shell=True
- The command must be a list instead of a string.
- All options must also be a list (or an iterable).
2023-12-01 11:11:24 +01:00
Matthieu Gautier e87835c61d Correctly set the environment.
When running command without `shell=True`, python's subproccess will look
for variable `"PATH"` and `b"PATH"` and will complain if both are set.
So the defaultdict should not return something for `b"PATH"`.

We also escape space ` ` in the environment variables to not break
everything with directory containing space.
2023-12-01 11:10:34 +01:00
Matthieu Gautier 738bfa6744
Merge pull request #665 from kiwix/ios_deps_publish 2023-11-20 17:21:31 +01:00
Matthieu Gautier 1a48bb509b Publish CI libkiwix's dependencies for iOS cross-compilation
See kiwix/libkiwix#1018
2023-11-20 14:17:50 +01:00
Matthieu Gautier e121d04dbf
Merge pull request #664 from kiwix/android_debug 2023-11-20 14:17:42 +01:00
Matthieu Gautier 88cc75475c Build libzim and libkiwix in debug mode on android.
Fix #623
2023-11-20 11:10:24 +01:00
Kelson 2467771891
Merge pull request #663 from kiwix/release-kiwix-tools-3.6.0
Release kiwix-tools 3.6.0
2023-11-19 14:52:28 +01:00
Emmanuel Engelhart 78225e865e
Relase kiwix-tools 3.6.0 2023-11-19 14:22:29 +01:00
Kelson 2130ec1255
Merge pull request #662 from kiwix/osname
Add OS_NAME to docker trigger job
2023-11-17 16:03:37 +01:00
renaud gaudin d59902f460
Add OS_NAME to docker trigger job 2023-11-17 15:01:32 +00:00
Kelson b97e5d20b8
Merge pull request #661 from kiwix/release-libkiwix-13.0.0
Release libkiwix 13.0.0
2023-11-17 15:49:45 +01:00
Emmanuel Engelhart 5da02d9ccc
Release libkiwix 13.0.0 2023-11-17 15:15:24 +01:00
Matthieu Gautier 2b6e02853d
Merge pull request #658 from kiwix/docker-trigger 2023-11-17 13:23:28 +01:00
Kelson 84193ab80c
Merge pull request #637 from kiwix/emsdk
Update emsdk version.
2023-11-17 12:49:52 +01:00
Matthieu Gautier 861682ecaa Update emsdk version. 2023-11-17 12:28:14 +01:00
Kelson 9ef684747f
Merge pull request #657 from kiwix/aria2-1.37.0
Bump-up aria2 to 1.37.0
2023-11-17 12:23:25 +01:00
Emmanuel Engelhart 6a9093642c Bump-up aria2 to 1.37.0 2023-11-17 12:21:39 +01:00
Kelson 8a47b3e4d4
Merge pull request #659 from kiwix/zim-tools-3.3.0
Release zim-tools 3.3.0
2023-11-17 12:18:54 +01:00
Emmanuel Engelhart f76ce0069b
Release zim-tools 3.3.0 2023-11-17 10:58:35 +01:00
renaud gaudin aa29f5029a
Fixed docker workflow trigger
There is no such thing as a `LINUX_DOCKER_TRIGGER` platform target nor expected OS_NAME.
BuildDefinition expects the docker publish trigger to happen for native_static
2023-11-16 10:54:27 +00:00
renaud gaudin 1d70d1a0c4
Fixed incorrect py3 exception raising 2023-11-16 10:53:15 +00:00
rgaudin 1b81500c0b
Merge pull request #653 from kiwix/xcframework
Build CoreKiwix.xcframework
2023-11-15 09:39:51 +00:00
renaud gaudin ac22caca6d
Don't set context.no_skip on meson builder
no_skip is thus computed automatically depending on project being our or not.
We dont want to skip configure on our own projetcs (limited impact, simplifies deps mgmt)
2023-11-15 08:50:38 +00:00
renaud gaudin a063b91349
Build CoreKiwix.xcframework
CoreKiwix.xcframework is the packaging format required by Kiwix apple (macOS/iOS) reader for libkiwix.
Naming will hopefully be revisited later (libkiwix.xcframework?)

This folder is a combination of all static archive (*.a): dependencies and libkiwix itself
for all apple-supported platforms: macOS x86_64, macOS arm64, iOS arm64 and iOS x86_64.
It also includes the headers.
Note: while iOS archs are separated in the framework, the macOS archs are bundled as a fat binary.

This thus adds:

- A new `apple_all_static` target that lists mentioned sub-platforms.
- A new `AppleXCFramework` virtual dependency and builder
  -  requires `libkiwix`
  - merges the archives into one per target
  - creates the fat binary for macOS
  - creates the xcframework
- `libkiwix_xcframework-VERSION.tar.gz` because platformname is xcframework
  - it only contains the xcframework but in libkiwix_xcframework-VERSION/lib folder
    Because with this virtual target, there are no other files
  - requires a new `xcframework` platform_name in builddef
- subplatforms deps and macOS/iOS _ok files to make_deps_archive

---

https://developer.apple.com/documentation/xcode/creating-a-multi-platform-binary-framework-bundle
2023-11-15 08:50:00 +00:00
renaud gaudin 6cfbd0c297
Use TMP_DIR (standard) instead of hard-coded /tmp
Allows overriding it
2023-11-15 08:40:22 +00:00
Kelson 5a8f8c90ff
Merge pull request #655 from kiwix/build-libzim-release-9.0.0
Release libzim 9.0.0
2023-11-13 21:26:34 +01:00
Emmanuel Engelhart adf3ed801a
Release libzim 9.0.0 2023-11-12 12:38:25 +01:00
Matthieu Gautier 9b2b8c98c8
Merge pull request #649 from kiwix/tools_on_macos_m1
Build zim-tools and kiwix-tools on macos-arm64
2023-11-10 18:50:00 +01:00
Kelson eeb22c1cb4
Merge pull request #650 from kiwix/apple-xcf
Apple Platforms updates
2023-11-10 16:01:02 +01:00
renaud gaudin 12b176bf85
fixed typo in native (using min-macos-version) 2023-11-10 11:26:44 +00:00
Matthieu Gautier 1000bfecbe
Set `min_macos_version` also on native platform.
`-min_macos_version` define our minimum targeted macos version.
We need to set it even if we build native on macos.
2023-11-10 11:26:37 +00:00
Matthieu Gautier 5b22821e61 Build zim-tools and kiwix-tools on macos-arm64 2023-11-09 11:52:08 +01:00
renaud gaudin 670bbb0417
removed iOSMacABI target as useless 2023-11-09 08:14:52 +00:00
renaud gaudin 7be0b3b586
generalized min macOS/iOS target versions. bumped to iOS15 and macOS12 2023-11-09 08:14:52 +00:00
renaud gaudin 09dacaa25e
disabled bitcode support, as deprecated since xcode14
See https://stackoverflow.com/questions/72543728/xcode-14-deprecates-bitcode-but-why
2023-11-09 08:14:52 +00:00
renaud gaudin fbc1ca11f2
removed -stdlib=libc++ flag to clang as required by xcode 15 2023-11-09 08:14:52 +00:00
renaud gaudin a79b08f4c5
build on macos-13 with xcode 15.0.1 2023-11-09 08:14:52 +00:00
Matthieu Gautier 2f6663a84c
Merge pull request #651 from kiwix/no_publish_of_pr_deps
Publish projects deps in branch-named folder when outside of main
2023-11-08 13:14:09 +01:00
Matthieu Gautier 0a02353f28 Do not publish projects deps if we are in a branch.
Still publish the deps in the dep_previews directory in case we
would like to test it project's CI.
2023-11-08 10:43:27 +01:00
Matthieu Gautier 42a0658729
Merge pull request #648 from kiwix/fix_musl_archive_name
Fix naming of musl archive for x86_64.
2023-11-07 16:34:55 +01:00
Matthieu Gautier cf5dde88e2 Fix naming of musl archive for x86_64.
Fix openzim/libzim#820
2023-11-06 14:00:37 +01:00
Matthieu Gautier 0ce0f20870
Merge pull request #642 from kiwix/update_icu
Update icu4c to version 71.1
2023-11-03 09:50:45 +01:00
Matthieu Gautier fb6d6b8e25 Package ICU data with libzim/libkiwix. 2023-11-02 17:34:24 +01:00
Matthieu Gautier 2a5a5c3a42 Correctly build ICU data when building for wasm.
When we use `--disable-tools` (ie, when we are cross-compiling), ICU
will build the data only if it detects we are cross-compiling.

This make sens until we cross-compiling for wasm.
Wasm output is a script file with the interpreter in the sdk we have
installed. So ICU's configure can run the test binary and so doesn't detect
we are cross-compiling.

So we have to patch ICU Makefile to make it build the ICU data anyway.
2023-11-02 17:33:51 +01:00
Matthieu Gautier beadc3b16c Use custom data.
ICU is used to:
- List locales (`locales_tree`)
- Get information about those locales in different languages (`lang_tree`)
- Remove accents (`translit`)

Tracing ICU without custom data, we also load `likelySubtags` and
`metadata`. Not sure why and what happen when missing but let's be
conservatives and include them.
2023-11-02 11:14:04 +01:00
Matthieu Gautier 717dcd801d Move to ICU 73.2 2023-11-02 11:14:04 +01:00
Matthieu Gautier 8cf6c39d11 Extend `ReleaseDownload` source to be composed of several archives. 2023-11-02 11:13:29 +01:00
Kelson 45c55013bd
Merge pull request #645 from kiwix/xapian-1.4.23
Bump-up Xapian to version 1.4.23
2023-11-01 04:17:42 +01:00
Emmanuel Engelhart e966385069 Bump-up Xapian to version 1.4.23 2023-10-31 11:39:29 +01:00
Kelson 0e103dd0b5
Merge pull request #646 from kiwix/remove-ci-images
Move CI container creation to kiwix/container-images
2023-10-31 11:39:08 +01:00
Emmanuel Engelhart b743487ba0
Use CI container image 2023-10-30 2023-10-30 20:07:22 +01:00
Emmanuel Engelhart 0f0f7c5003
Move CI container creation to kiwix/container-images 2023-10-29 11:57:59 +01:00
Matthieu Gautier 8c5db8b221
Merge pull request #643 from kiwix/kelson42-patch-1
Better badges in README.md
2023-10-26 09:57:47 +02:00
Kelson 977c74dc5a
Better badges in README.md 2023-10-26 06:23:23 +02:00
Matthieu Gautier 078dfa0c45
Merge pull request #641 from kiwix/fix_ci_docker_image
Correctly set the docker image for `x86-64_musl`.
2023-10-25 11:21:59 +02:00
Matthieu Gautier c2cd1331b7 Correctly set the docker image for `x86-64_musl`.
Use the same strategy that for `CI` workflow:
- By default use a target with `image_variant` to `focal`
- Add include for other image_variant.
2023-10-25 10:20:48 +02:00
Matthieu Gautier d8757c375d
Merge pull request #636 from kiwix/musl
Add x86-64 musl
2023-10-24 14:09:07 +02:00
Matthieu Gautier 3f908f429c Remove `x86-64_musl_dyn` from the CI.
This target fails on the CI because of conflict between the builded
libraries (lzma, libz) and native library.
As they are both for the same arch but with different libc, python tries
to load them and fails.

There is a real bug somewhere in our toolchain but we need to build for
x86_64 musl right now and this is done in `x86-64_musl_mixed` which pass.
So let's remove it for now.

(`x86-64_musl_dyn` fails with the docker image. It is ok with native
(fedora 38) system)
2023-10-24 10:53:31 +02:00
Matthieu Gautier 9a2a9ca188 Do not follow symlink when we copy a directory. 2023-10-24 10:53:31 +02:00
Matthieu Gautier b57f83ed25 Move all toolchain installation in TOOLCHAIN directory.
This is a clearer install and it simplify the base_deps archive creation.
2023-10-24 10:53:31 +02:00
Matthieu Gautier 750eeedc42 Update base_deps_meta_version. 2023-10-23 10:19:12 +02:00
Matthieu Gautier 149c1d25fb Use musl toolchain with gcc 10.
We need a "old" gcc version to be able to run on "old" systems
(libstdc++.6.0.28)
2023-10-23 10:19:12 +02:00
Matthieu Gautier 0ae6b0766b Build x86-64_musl in the CI 2023-10-23 10:19:12 +02:00
Matthieu Gautier c3d3cc5a97 Add x86_64 musl toolchain and platform. 2023-10-23 10:19:12 +02:00
Matthieu Gautier f0ad7b126a Rename `arm_musl.py` to `musl.py`.
Those files will contain toolchain for musl. Not specific to arm.
2023-10-23 10:19:12 +02:00
Matthieu Gautier 7807e10325 Rename files containing toolchain to `tc_*` 2023-10-23 10:19:12 +02:00
Matthieu Gautier 442fe3df19
Merge pull request #639 from kiwix/fix_libkiwix_version
Revert back the libkiwix version to 12.1.1
2023-10-20 16:24:19 +02:00
Matthieu Gautier 2c258d52eb Revert back the libkiwix version to 12.1.1
We don't have a version 13.0.0 for libkiwix.
So the master branch of libkiwix is generating version 12.1.1.

We must use the correct version as we try to fix the rpath on macos
and we we don't have the right version, we fail because the lib file
doesn't exist.
2023-10-20 11:20:57 +02:00
Matthieu Gautier 44a8963c50 New version libkiwix 13.0.0
This is mainly a release of libkiwix 12.1.0 as 12.1.0 introduce breaking
changes.

No need to rebuild kiwix-tools (it is already builded with 12.1.0)
Don't build kiwix-destkop as current version of kiwix-desktop is not
ported to kiwix-13.0.0 (`main` is, but not last release).
2023-09-14 16:06:13 +02:00
Matthieu Gautier 6ee003bf9b New version of libkiwix.
Libkiwix 12.1.1 is just a hot patch to avoid a breaking change in 12.1.0

No need to rebuild kiwix-tools.
2023-09-14 13:49:16 +02:00
Matthieu Gautier 19ef9178b0 Trigger a new build of libzim.
With the fallback of aarc64 toolchain, we need to rebuild libzim.
2023-09-01 11:06:49 +02:00
Matthieu Gautier 4dfae35d8a
Merge pull request #635 from kiwix/aarch_glibcxx 2023-08-24 17:04:03 +02:00
Matthieu Gautier 65dd03e58f Move back to the old toolchain for aarch64
Fix #634
2023-08-11 16:18:25 +02:00
Matthieu Gautier 75a1963572
Merge pull request #633 from kiwix/fix_kiwix-desktop_deps 2023-07-31 22:59:47 +02:00
Matthieu Gautier 458aa97b36 Correctly build (and publish) dependencies for kiwix-desktop. 2023-07-31 17:44:36 +02:00
Matthieu Gautier ad866a7790
Merge pull request #632 from kiwix/fix_ci2 2023-07-29 16:15:38 +02:00
Matthieu Gautier a6aa18cfcc Add missing env variable.
The variables are not used in the context of docker triggering.

I prefer set dummy variables instead of use a default value in the code
to be sure that the variable are defined when needed.
2023-07-29 13:33:37 +02:00
Matthieu Gautier 58f9ede10a
Merge pull request #631 from kiwix/fix_ci 2023-07-28 11:22:08 +02:00
Matthieu Gautier 32db47d007 Add missing `runs-on` 2023-07-28 10:12:17 +02:00
Matthieu Gautier e9c039dc9b
Merge pull request #630 from kiwix/better_ci_def 2023-07-27 16:11:51 +02:00
Matthieu Gautier 45b459a03a Trigger docker workflow at the end of other jobs. 2023-07-27 15:20:00 +02:00
Matthieu Gautier 8070a750f5 Reorder few lines.
No functional change but it regroups lines with a platform_name.
2023-07-26 15:30:15 +02:00
Matthieu Gautier 46c663db09 Move the release platform name in the build definition.
Having the name of the archive define in common is splitting definition
in different files.

The purpose of build_definition is to centralize definition, so move them
there.
2023-07-26 15:28:50 +02:00
Matthieu Gautier 7e9a145bc5 Introduce D(ocker) build definition.
Partially fix #629
2023-07-26 15:09:13 +02:00
Matthieu Gautier 07e72ffba4 Extend the build definition with P(ublish) and S(ource)
This allow us to better control what we publish.
This fix #628
2023-07-26 15:04:37 +02:00
Matthieu Gautier 1876b5f542 New version of libzim and libkiwix
- libzim 8.2.1
- libkiwix 12.1.0
2023-07-20 15:58:54 +02:00
Matthieu Gautier 10e920ca00 Fix typos 2023-06-15 09:48:08 +02:00
Matthieu Gautier c58d50474b
Merge pull request #611 from kiwix/arm64_musl 2023-06-14 16:45:30 +02:00
Matthieu Gautier 7cdffbe22f Correctly add toolchains in deps archives. 2023-06-14 15:57:49 +02:00
Matthieu Gautier 1748f48197 Publish aarch64_musl. 2023-06-14 15:57:49 +02:00
Matthieu Gautier 64a686effe Build aarch64_musl on the CI. 2023-06-14 15:57:49 +02:00
Matthieu Gautier 5884909b25 Add target aarch64_musl_*
I have to mention that adding a new cross compiled target never seems
so simple.
2023-06-14 15:57:49 +02:00
Matthieu Gautier d1b39dfb98 Correctly build native_mixed on bionic and focal.
If `native_mixed` is part of the original target, the "include" with the
`image_variant` will overwrite the combination.

If we remove `native_mixed`, both combinations are added.

See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstrategymatrixinclude
2023-06-13 12:38:36 +02:00
Matthieu Gautier 0f75a42498 Do not build libzim and libkiwix on macos arm64 static.
We should build them using mixed target only.
2023-06-12 14:46:06 +02:00
Matthieu Gautier d6a2901ff8 Fix typos in build_release_nigthly 2023-06-08 10:15:38 +02:00
Kelson 23fab75d04
Merge pull request #610 from kiwix/fix_publication_macos
Fix packaging of libzim and libkiwix on macOS.
2023-06-07 17:03:54 +02:00
Matthieu Gautier 06d7a26cb4 Fix extraction of major version from version.
Taking the first char is ok only if major version is < 10.
2023-06-07 15:55:59 +02:00
Matthieu Gautier 4602ead6be Fix packaging of libzim and libkiwix on macOS.
On MacOs, libraries are in `.dylib`, not `.so`.

Also package the `.pc` file.
2023-06-07 14:06:07 +02:00
Matthieu Gautier 07d443d96b
Merge pull request #612 from kiwix/better_build_def2 2023-06-07 14:03:33 +02:00
Matthieu Gautier 6fe37ba0de Rename osx to macos. 2023-06-02 16:09:22 +02:00
Matthieu Gautier 7b6ed275ed Remove code for kiwix-desktop workaround.
As we don't use the workaround now, we can remove the code associated to
it.

It simplify our build definition.
2023-06-02 16:09:22 +02:00
Matthieu Gautier 8237adf950 Do not use a specific target `native_desktop`.
`native_desktop` is not a real target_platform. It is workaround to
specify "build only kiwix-desktop on native_dyn".

It was useful, when we need to build kiwix-desktop on a different build
env than the other project (because of packaging constraints).
Now we can build kiwix-desktop and all other projects on the same build
env, we can remove it and build kiwix-desktop with other `native_dyn`.
2023-06-02 16:09:22 +02:00
Matthieu Gautier 7db434ee6d Use the common build definition to specify which deps build.
The build definition update follow what we build in the project's CI,
not what was defined by the replaced python code.
2023-06-02 16:09:22 +02:00
Matthieu Gautier 3defd4eba7 Be explicit about all our combinations. 2023-06-02 16:00:26 +02:00
Matthieu Gautier e59e3698b2 Open build definition system to more complex build definition. 2023-06-02 15:58:53 +02:00
Matthieu Gautier fc81551555 Remove unused import. 2023-06-02 15:58:02 +02:00
Matthieu Gautier fd46c52473 Move the definition of what to build in a table.
This provide a better visual definition (and potential better explicit)
of the previous code base on `if/else`.
2023-06-02 15:58:00 +02:00
Matthieu Gautier 7f7156ece5 New build of libzim, kiwix-tools and zim-tools.
Previous build was broken on arm and aarch64.
With new toolschain, it should be ok, but we need a new build for them.
2023-06-01 15:29:18 +02:00
Kelson c5037e6fd4
Merge pull request #615 from kiwix/better_arm
Switch (again) to new arm cross-compilation toolchain.
2023-05-23 13:39:54 +03:00
Matthieu Gautier e751c1166c Correctly package armv* toolchain in base dependency. 2023-05-23 08:58:17 +03:00
Matthieu Gautier ae4dcac4e5 Update base_deps_meta_version 2023-05-22 19:03:57 +02:00
Matthieu Gautier a302a597e2 Remove `lib_postfix` from CI.
This variable is never used.
2023-05-22 19:03:57 +02:00
Matthieu Gautier c6ea16edd9 Build for armv6 and armv8 on the CI. 2023-05-22 19:03:57 +02:00
Matthieu Gautier 897e7f292c Switch (again) to new arm cross-compilation toolchain.
This introduce a difference between armv6 and armv8.
2023-05-22 19:03:57 +02:00
Kelson 01eda7a44f
Merge pull request #622 from kiwix/custom-scp-cipher
Use a scp cipher which goes faster
2023-05-22 19:57:20 +03:00
Emmanuel Engelhart 3cd20201c1 Use a scp cipher which goes faster 2023-05-21 14:31:33 +03:00
Kelson 46f4ad76af
Merge pull request #621 from kiwix/explicit-outcomes
Add explicit outcomes in README
2023-05-21 14:31:05 +03:00
Emmanuel Engelhart 26116bc8ff
Add explicit outcomes in README 2023-05-21 13:29:23 +02:00
Kelson 4f3d9bc756
Merge pull request #620 from kiwix/macos11
We should build using macos11
2023-05-20 21:01:44 +03:00
Emmanuel Engelhart 7db62390f1
We should build using macos11 2023-05-20 16:15:24 +02:00
Kelson bd9e60f526
Merge pull request #617 from kiwix/libmagic-5.44
Bump-up libmagic to version 5.44
2023-05-20 17:00:30 +03:00
Emmanuel Engelhart 5057444acd
Disable decompression feature in libmagic 2023-05-20 13:23:25 +02:00
Emmanuel Engelhart e0d4eea050
Bump-up libmagic to version 5.44 2023-05-19 15:28:34 +02:00
Matthieu Gautier 147947e886
Merge pull request #616 from kiwix/dev_push_subdir 2023-05-16 16:35:43 +02:00
Matthieu Gautier af29fd5f2e Publish dev preview in `dev_preview` subdirectory in tmp.kiwix.org/ci. 2023-05-16 15:26:24 +02:00
Matthieu Gautier 64c5f20d78
Merge pull request #604 from kiwix/fix_flatpak_publish 2023-05-10 14:38:44 +02:00
Matthieu Gautier 3e712db880 Fix publish of kiwix-desktop flatpak.
We cannot directly push on master. We have to create a pull request.
The CI is adapted to push a new branch. The PR has to be created manually.
2023-05-10 14:12:06 +02:00
Matthieu Gautier 868d82b384
Merge pull request #606 from kiwix/fix-oses-ci 2023-05-09 14:44:17 +02:00
Emmanuel Engelhart a11b813f82
Use always fix version of macOS & Ubuntu 2023-05-04 15:06:52 +02:00
Matthieu Gautier 647304c253 New releaes of libzim, zim-tools and kiwix-tools. 2023-04-28 11:39:29 +02:00
Matthieu Gautier fd53141b9c Use docker image version 38. 2023-04-28 10:00:11 +02:00
Matthieu Gautier 34363684c3
Merge pull request #602 from kiwix/macos_arm64_tools 2023-04-28 09:35:02 +02:00
Matthieu Gautier 8f8ea01aec Do not build binaries on macOS not _dyn.
Tools fails to compile for different reasons:
- Missing dependencies
- Use of invalid options (`-dead_strip_dylibs`/`-bitcode_bundle`)
2023-04-28 08:59:14 +02:00
Matthieu Gautier 02e2598056 Build zim-tools and kiwix-tools and macosOs_arm64. 2023-04-27 19:10:55 +02:00
Matthieu Gautier ab14ce957b Build kiwix-tools on macos (native) 2023-04-27 19:02:23 +02:00
Kelson 826ce1718d
Merge pull request #597 from kiwix/libzim_bionic
Build libzim on bionic
2023-04-27 14:10:24 +02:00
Matthieu Gautier fd85b80b2c Move back to gcc 6.3.0 when compiling to aarch64. 2023-04-26 16:54:35 +02:00
Matthieu Gautier fc3b446c76 Also build libzim mixed for aarch64 on bionic. 2023-04-26 16:54:35 +02:00
Matthieu Gautier fffbd122c9 Make bionic CI create archive containing bionic in the name. 2023-04-26 16:54:35 +02:00
Matthieu Gautier 4aa613c8e6 Update CI build script
Update CI scripts to build only libzim on native_mixed if os name is
bionic.
2023-04-26 16:54:35 +02:00
Matthieu Gautier 7a0f490e00 Update CI workflows
Update CI to build on native_mixed bionic and build the bionic docker
image.
2023-04-26 15:21:17 +02:00
Matthieu Gautier c55a96678e Build a minimalist bionic builder.
Reuse the bionic builder (we should have remove in pr #588) and
remove all deps not needed to build libzim.
2023-04-26 15:21:17 +02:00
Matthieu Gautier bb0e8d6e70
Merge pull request #600 from kiwix/update_xapian 2023-04-26 15:20:56 +02:00
Matthieu Gautier 5ef7e2a017 New version of xapian 1.4.22
Fix #599
2023-04-25 16:54:40 +02:00
Matthieu Gautier 5bb67d7ebb
Merge pull request #596 from kiwix/fix_deps_aarch64 2023-04-19 15:06:01 +02:00
Matthieu Gautier 2b6e305911 Install things in `lib/aarch64-linux-gnu` 2023-04-19 11:36:08 +02:00
Matthieu Gautier 51925bc4da Add the aarch64 toolchains to deps archive.
We need the aarch64 compiler to let's project build themselves.
2023-04-19 10:54:16 +02:00
Matthieu Gautier 65cf449c66 Update docker image to 37. 2023-04-18 10:34:08 +02:00
Kelson bfc9294318
Merge pull request #588 from kiwix/ubuntu-20.04
Move all our CI to focal instead of bionic
2023-04-12 16:54:41 +02:00
Matthieu Gautier e6d04fb760 Update README. 2023-04-12 16:53:32 +02:00
Matthieu Gautier d00c06da32 Use last version of linuxdeployqt.
LinuxDeployQt check for the libc version to not being to recent.
As we have change the version of libc by moving to focal, we have to
update the version of LinuxDeployQt.
2023-04-12 16:53:32 +02:00
Matthieu Gautier 0919f4d3dd [WIP] Use the docker image of our branch. 2023-04-12 16:53:32 +02:00
Matthieu Gautier c9e9c5c070 Move all our CI to focal instead of bionic
Bionic is EOL.
2023-04-12 16:53:32 +02:00
Kelson 3db22ba0bc
Merge pull request #591 from kiwix/fix_arm64_compilation
Fix compilation on CI macOS
2023-04-12 16:53:02 +02:00
Matthieu Gautier 4b8862a959 Use only one code to determine what to build.
As we build the "same"[*] things with build_project and build_release_nightly,
let's use the same code.

[*] We are not building the same things has we don't run the same runners
(not the same `PLATFORM_TARGET`) but for a given `PLATFORM_TARGET`, we
are building the same things.
2023-04-12 11:26:12 +02:00
Matthieu Gautier b905e87280 Fix compilation on CI macOS
We don't want to compile zim-tools on macOS_arm64_dynamic.
2023-04-12 11:26:12 +02:00
Matthieu Gautier 2cd4f782ba
Merge pull request #589 from kiwix/zim_tools_publication
Build zim-tools cross-compiling.
2023-04-11 22:58:59 +02:00
Matthieu Gautier 9ee7567e80 Fix typos 2023-04-11 12:05:06 +02:00
Matthieu Gautier ae3b1b6a25 Build zim-tools cross-compiling. 2023-04-11 12:05:06 +02:00
Matthieu Gautier 0b5eb668e7
Merge pull request #584 from kiwix/macos_arm64 2023-04-05 15:48:52 +02:00
Matthieu Gautier 7b7afc36e7 Mixed platform are not static. 2023-03-31 10:51:11 +02:00
Matthieu Gautier 892e4bbffe [CI] Upload `macOS_arm64_mixed` builds. 2023-03-30 17:37:11 +02:00
Matthieu Gautier 260b93a51d Correctly set the include dirs for mixed_target.
Until now, mixed targets was only about native build and so we were not
using a meson cross_config file and env var was enough.

But now we also to correctly set it in the cross_config file.
2023-03-30 16:40:20 +02:00
Matthieu Gautier b218875d49 Rename `macOS_arm64` to `macOS_arm64_static`.
Publication code in `.github/scripts` expected that `foo_mixed` target
is tied to a `foo_static` target.
2023-03-30 14:18:53 +02:00
Matthieu Gautier b4e0d60363 Build and publish libzim and libkiwix on macos_arm64. 2023-03-30 14:18:53 +02:00
Matthieu Gautier de25a1e63b Add `macOS_arm64_mixed` platform. 2023-03-30 14:18:53 +02:00
Matthieu Gautier 52335fbd32
Merge pull request #580 from kiwix/arm_build 2023-03-30 14:16:55 +02:00
Matthieu Gautier c1d0ed4e4f Correctly store the source toolchain for "aarch64" 2023-03-29 15:46:06 +02:00
Matthieu Gautier 695a3ef0c0 Correctly store the `static` compiled source when doing archive for mixed. 2023-03-29 15:46:06 +02:00
Matthieu Gautier 18c5d3bf5f Publish nigthly and release of kiwix-tools on aarch64 2023-03-29 11:40:04 +02:00
Matthieu Gautier 8e61acbca2 Addapt CI to build armhf and aarch64.
- Aarch64 added
- libzim compilation on (armhf|aarch64)_mixed added.
2023-03-28 17:57:39 +02:00
Matthieu Gautier 7ae3afd805 Introduce mixed target for armhf and aarch64. 2023-03-28 17:48:08 +02:00
Matthieu Gautier ab2cbdbe5b Introduce aarch64 target.
In opposition to 32 bits, it is adapted to all PI (as long as they are
in 64 bits).
2023-03-28 17:47:48 +02:00
Matthieu Gautier 4e88c6eb10 Correctly set the armhf toolchain to a 32 bits arch.
cross-gcc-10.3.0-pi_64.tar.gz for 64 bits architecture and armhf
is about 32 bits.

However, we know use a pi 2 and 3 and Stretch only[*] toolchains

[*] To be tested. Maybe the only is for the target compilation but binary
run elsewhere too.
2023-03-28 17:46:31 +02:00
Matthieu Gautier 31771fa35c Introduce MixedMixin
We will need to create "mixed linkage" library for other arch than native.
It is better to move associated code in a separate part.
2023-03-28 17:40:12 +02:00
Matthieu Gautier b6f49efcda Update meta version to not used cached library. 2023-03-28 16:16:22 +02:00
Matthieu Gautier b8cd12a360 Update armhf toolschain. 2023-03-28 16:16:22 +02:00
Matthieu Gautier bc3a73f26d
Merge pull request #582 from kiwix/correct_libzim_version 2023-03-28 15:46:38 +02:00
Matthieu Gautier 556f02cf48 Set back the version of libzim to 8.1.0
The version of libzim (and other project too) is used to know what we
need to package in the published archive (nightly and releasee).

So the version must correspond to what is build.
For nightlies, we build the `main` branch and the main branch of libzim
is still on 8.1.0 so we must have the same version.

Fix openzim/libzim#772
2023-03-28 11:47:56 +02:00
Kelson be486cea4f
Merge pull request #581 from kiwix/mainref
Additional master to main fixes
2023-03-28 11:05:26 +02:00
renaud gaudin 7c02c6b778 Fixed triggering workflows on zim-tools and kiwix-tools
Both the fallback and the passed ref were targeting the master branch of those repositories.
This triggers the workflow on their main branch and sets the default target branch to main as all our repositories use it.
2023-03-28 07:58:41 +00:00
renaud gaudin c5acad73b4 Prevent incorrectly setting DEV_BRANCH
DEV_BRANCH is used to change archive upload behavior.
We current code it was incorrectly considering being on a dev branch while on main one (main)
2023-03-28 07:56:37 +00:00
Matthieu Gautier 61fb624f66 Correctly set the release version of libzim.
As we have change the version of libzim, release build must be 0.
2023-03-22 14:04:36 +01:00
Matthieu Gautier efff7abbfc New release of libzim 8.1.1
As this is just a ABI fix and we recompile everything when we do
a release of our projects, we don't need to recompile our projects.
Building with libzim 8.1.0 was enough, no need to trigger a update in all
the users of prebuild binary.
2023-03-22 13:29:52 +01:00
Matthieu Gautier 82f9d89fd3
Merge pull request #579 from kiwix/fix_wasm_lib 2023-03-20 21:57:18 +01:00
Matthieu Gautier 424d426a0e Correctly package wasm archives.
With commit 6181d7bb, we have changed where archives are written.
We must addapt our packaging script.

Fix #556
2023-03-20 19:32:41 +01:00
Kelson 7b776893fd
Merge pull request #578 from kiwix/fix-release-workflow
Fix release workflow
2023-03-19 15:49:46 +01:00
Emmanuel Engelhart 9f448f83de
Use fix versions for CI/CD 2023-03-19 15:24:33 +01:00
Emmanuel Engelhart eae088e80f
Remove unecessary dependence to container workflow 2023-03-19 15:22:50 +01:00
Kelson d17745ba49
Merge pull request #577 from kiwix/ci-uses-containers-35
Use new container images v36
2023-03-16 13:04:36 +01:00
Emmanuel Engelhart f376e82aac
Use new container images v36 2023-03-16 10:42:07 +01:00
Emmanuel Engelhart 92951ee827
Fix container image tagging 2023-03-16 10:31:08 +01:00
Kelson 8862963dbc
Merge pull request #576 from kiwix/new-attempt-for-container-images
New attempt for container images
2023-03-16 09:35:12 +01:00
Emmanuel Engelhart 245ca71692
Rename container workflow file 2023-03-16 09:34:22 +01:00
Emmanuel Engelhart bd58d50051
Fix docker tag command 2023-03-16 09:33:56 +01:00
Kelson 9d2eae0c34
Merge pull request #575 from kiwix/use-latest-container-images
Use latest container images
2023-03-16 09:16:36 +01:00
Emmanuel Engelhart ea3a07e3c2
Fix container release 2023-03-16 09:05:03 +01:00
Emmanuel Engelhart ad6de2897e
Better name for container workflow 2023-03-16 09:01:50 +01:00
Kelson b8978b1c60
Merge pull request #566 from kiwix/new-ci-container-build
Move CI container building to a dedicated CI workflow
2023-03-15 17:17:49 +01:00
Emmanuel Engelhart 534dee9c94 Use new Docker images for kiwix-build CI 2023-03-15 13:25:13 +01:00
Matthieu Gautier fb9ca9ec89 Add missing packages in bionic container. 2023-03-15 13:25:13 +01:00
Emmanuel Engelhart 672c6fdcb5 Update container user config 2023-03-15 13:25:13 +01:00
Emmanuel Engelhart f16f55fd07 Add container 'latest' tag 2023-03-15 13:25:13 +01:00
Emmanuel Engelhart fed574d0c9 Update CI container image doc 2023-03-15 13:25:13 +01:00
Emmanuel Engelhart c1b8ff5d86 Better container image creation/upload workflow 2023-03-15 13:25:13 +01:00
Emmanuel Engelhart b977392446 Remove CI container builds 2023-03-15 13:25:13 +01:00
Emmanuel Engelhart b16cedc6be Move ci_images 2023-03-15 13:25:13 +01:00
Emmanuel Engelhart dd1a276d7a Move CI container building to a dedicated CI workflow 2023-03-15 13:25:13 +01:00
Kelson d3e4111a18
Merge pull request #574 from kiwix/fix_android_base_deps 2023-03-15 12:36:18 +01:00
Matthieu Gautier 7a23bb5b8b Fix creation of base dependencies archive.
The `INSTALL_DIR` was added twice. It was not a issue as we then transform
the list into a set to remove duplicated.

But with `filter_install_dir` call only on one "add", the (textual)
entries are not duplicated and so, not removed. So the files where add
twice.

Now we correctly filter initial `INSTALL_DIR` and we remove the second add.
2023-03-14 17:17:30 +01:00
Kelson e77442b9a9
Merge pull request #569 from kiwix/wasm_lib
Install wasm libraries in `INSTALL/lib` directory.
2023-03-01 17:36:21 +01:00
Matthieu Gautier 674c29c351 Bump the base_deps_meta_version.
As we install base library in a different directory, we have to
regenereate the base_deps archives.
2023-03-01 14:17:48 +01:00
Matthieu Gautier 6181d7bb08 Install wasm libraries in `INSTALL/lib` directory.
The default detected libdir is based on the build architecture.
On ubuntu, it is `lib/x86_64-linux-gnu` which is obviously not the right
directory.

Let's simply use `lib`.

Fix #556
2023-03-01 14:16:36 +01:00
Matthieu Gautier 45767044f0
Merge pull request #571 from kiwix/libmicrohttp-0.9.76 2023-03-01 14:15:40 +01:00
Emmanuel Engelhart 7e88bf14a2
Bumpup libmicrohttpd to 0.9.76 2023-03-01 10:10:15 +01:00
Kelson 8db9902a0a
Merge pull request #568 from kiwix/no_doc_man
Remove `share/doc` and `share/man` from the deps archive.
2023-02-22 18:13:06 +01:00
Matthieu Gautier 5c0d9d87c1 Remove `share/doc` and `share/man` from the deps archive.
They are useless and they use precious disk space.
Fix #567
2023-02-22 11:57:47 +01:00
Kelson 3e396f6ed9
Merge pull request #564 from kiwix/fix_ios_macabi
Fix the iOsMacABI target in the CI
2023-02-12 07:54:21 +01:00
Matthieu Gautier d8c9d5c45d
Merge pull request #565 from kiwix/container-doc 2023-02-08 17:22:25 +01:00
Matthieu Gautier d89f622471 Fix description of which dependencies is in the docker image. 2023-02-07 16:53:15 +01:00
Emmanuel Engelhart 19beb1323f
Internal usage purpose only of CI containers 2023-02-07 16:10:40 +01:00
Emmanuel Engelhart 6f51871cc1
Add env container images documentation 2023-02-07 15:50:26 +01:00
Matthieu Gautier f6a7f43ece Fix the iOsMacABI target in the CI
It seems that on last version of CI envirronement, ios' clang doesnt
recognize ios13.0.

Moving to ios 14.0
2023-02-07 09:52:37 +01:00
Matthieu Gautier dc0d0804e4
Merge pull request #563 from kiwix/update-workflow-actions 2023-02-07 09:46:57 +01:00
Emmanuel Engelhart 3138c71b82
Update GitHub actions to latest version 2023-02-05 08:45:47 +01:00
Matthieu Gautier 2564b072f1
Merge pull request #560 from kiwix/main_by_default
"main" is now our default branch for all our projects.
2023-01-03 12:01:27 +01:00
Matthieu Gautier 1f8ccde487 "main" is now our default branch for all our projects. 2023-01-03 10:19:52 +01:00
Kelson 9d910ac9c5
Delete move.yml 2022-12-25 16:06:52 +01:00
Kelson 953a0a3816
« main » is the new git default branch 2022-12-25 16:05:41 +01:00
Matthieu Gautier 720209891d
Merge pull request #559 from kiwix/move_to_main 2022-12-22 15:57:48 +01:00
Matthieu Gautier 344b9328c3 libzim and zim-tools are now using "main" for the default branch. 2022-12-22 14:32:13 +01:00
Matthieu Gautier d76819390e Do not always fallback to master. 2022-12-22 14:31:20 +01:00
Matthieu Gautier bcbcbb525f Trigger a new build of libzim.
With the wasm arch fixed, we need to do a new build release.
2022-12-09 10:55:14 +01:00
Matthieu Gautier 536748500b Remove uneeded patches for flatpak
Patches are uneeded for all arch.
But we were trying to copy them on flatpak.
2022-12-09 10:55:14 +01:00
Matthieu Gautier 04db1bafe8
Merge pull request #555 from kiwix/fix_wasm_build 2022-12-07 14:15:40 +01:00
Matthieu Gautier f6cd94366a Fix wasm compilation.
On wasm, we cannot do mmap. We have to do plain read.

Fix openzim/libzim#751
2022-12-06 19:01:38 +01:00
Matthieu Gautier dba386a427 Fix wasm workflow configuration. 2022-12-01 22:28:23 +01:00
Matthieu Gautier fb095d91e6 Retrigger a build for wasm.
Other platforms will fail at upload because archives are read only but
the wasm build should be ok.
2022-12-01 22:09:51 +01:00
Matthieu Gautier 91ef647e78 Run releaseNigthly workflow also for wasm 2022-12-01 22:06:43 +01:00
Matthieu Gautier 3be9eca1a9 New version of all projects
- libzim 8.1.0
- libkiwix 12.0.0
- zim-tools 3.1.3
- kiwix-tools 3.4.0
- kiwix-desktop 2.3.1
2022-11-30 18:16:21 +01:00
Matthieu Gautier c99ad0b081
Merge pull request #554 from kiwix/fix_kiwixbuild_linux_packaging 2022-11-30 15:26:15 +01:00
Matthieu Gautier ab2458c1c4 Add "static" include dir when compiling native_mixed. 2022-11-30 14:22:13 +01:00
Matthieu Gautier 07d1561a87 [CI] Build libkiwix on on native_mixed 2022-11-30 14:22:13 +01:00
Matthieu Gautier cd0c2da542 Correctly compile libkiwix on native_mixed 2022-11-30 12:20:40 +01:00
Matthieu Gautier 67a20fd576
Merge pull request #553 from kiwix/fix_wasm_packaging 2022-11-30 12:17:06 +01:00
Matthieu Gautier 84eea4a7ed Package all libzim dependencies on wasm.
Fix #552
2022-11-30 11:07:21 +01:00
Matthieu Gautier 23c9ecdbed
Merge pull request #551 from kiwix/fix_wrong_upload 2022-11-24 17:29:41 +01:00
Matthieu Gautier c27348bde3 Publish the CI only if we are on a dev branch.
If we try to publish all the time, we will conflict with `Release&Nigthly`
workflow as we would pulbish in nigthly directory.

Fix #550
2022-11-23 16:06:35 +01:00
Matthieu Gautier 75ca8dcf2a
Merge pull request #548 from kiwix/wasm 2022-11-22 13:49:41 +01:00
Matthieu Gautier a44531bb8a Upload generated packages on `tmp/ci` when building on branches.
We need to be able to test our generated artefacts before we merge the
branches.
2022-11-16 16:37:05 +01:00
Matthieu Gautier ab421848c5 Use glob instead of specifying the lib_prefix.
There is no need to be specific here, we are already in INSTALL_DIR which
contains only things specific to our platform.
2022-11-16 16:37:05 +01:00
Matthieu Gautier 9881571047 Add packaging of libzim.a
Wasm build is creating a static library.
2022-11-16 16:37:05 +01:00
Matthieu Gautier 16fc490ae7 Add build of libzim on wasm in the CI 2022-11-16 16:37:05 +01:00
Matthieu Gautier 9695737ca1 Update meta_version to trigger a build on the CI 2022-11-16 16:37:05 +01:00
Matthieu Gautier fd8044ba76 Reduce base dependencies to ony what needed on wasm. 2022-11-16 16:37:05 +01:00
Matthieu Gautier 6f8b82ad7d Fallback to lzma-5.2.6
Version 5.2.7 include this commit
https://git.tukaani.org/?p=xz.git;a=commit;h=31d80c6b261b24220776dfaeb8a04f80f80e0a24

With this change, compiling libzim mixed (libzim dynamic and dependencies,
so lzma, statically) fails at libzim linking with a
`src/libzim.so.8.0.1: version node not found for symbol lzma_get_progress@XZ_5.2.2`
error message.

This can be "workaround" by passing `--disable-symbol-versions` to
configure script but then, it is the compilation of kiwix-desktop in
native_dyn which falling with

```
/usr/bin/ld: /usr/lib64/libsystemd.so.0: undefined reference to `lzma_code@XZ_5.0'
/usr/bin/ld: /usr/lib64/libsystemd.so.0: undefined reference to `lzma_end@XZ_5.0'
/usr/bin/ld: /usr/lib64/libsystemd.so.0: undefined reference to `lzma_stream_decoder@XZ_5.0'
/usr/bin/ld: /usr/lib64/libxml2.so.2: undefined reference to `lzma_auto_decoder@XZ_5.0'
/usr/bin/ld: /usr/lib64/libxml2.so.2: undefined reference to `lzma_properties_decode@XZ_5.0'
```

Probably because some native dependencies (Qt ?) use versionned symbols.

This have to be fixed somehow but until then, let's go back to 5.2.6
2022-11-16 16:37:05 +01:00
Matthieu Gautier 180fb249f6 Add a support to compile libzim for wasm.
`icu4c_wasm.patch` is build by :
 - Copying config.sub from liblzma source as new version of config.sub there
   knows about wasm architecture.
 - Copying `mh-linux` on `mh-unknown` as specified in (origin) `mh-unknown`.
   This is because icu4c configure doesn't detect `emscripten` platform and
   "fallback" to `mh-unknown`.
2022-11-16 16:37:05 +01:00
Matthieu Gautier b8c120b179 Pass the path of the patch in the command line instead of as stdin.
This way, we can see the applied patch in the log.
2022-11-16 10:46:06 +01:00
Matthieu Gautier a7809b33fc Update lzma version to 5.2.7
On top of using a more recent version (which is good it itself),
version 5.2.7 use a autotools version which knows about wasm.
2022-11-16 10:46:06 +01:00
Matthieu Gautier ce82860b85 Introduce configure and make wrapper.
This way, we can use small wrapper tools from sdk to run configure and
make.
2022-11-16 10:45:57 +01:00
Matthieu Gautier 3c445389be
Merge pull request #547 from kiwix/update_android_ndk 2022-10-13 10:46:38 +02:00
Matthieu Gautier 3847844c54 Update android_ndk to version r21e
To do this, we need to update the android api to 24.
We lost all users using a android under api 24.
2022-09-29 09:45:15 +02:00
Matthieu Gautier 3c7c6048c9
Merge pull request #546 from kiwix/fix_release_detection
Fix release detection
2022-09-28 17:39:35 +02:00
Matthieu Gautier dc814c626d Upload read-only archive.
By uploading read-only archive, we prevent potential (implicit) re-upload.

A re-upload will always be possible if we remove the archive and rerun
the workflow. But it will be clearly explicit in this case.
2022-09-28 16:08:42 +02:00
Matthieu Gautier f7706428a2 Make release only if we are running the workflow on a `r_xx` tag.
Also check that we are not a scheduled workflow
(But it is more a double check. This shloud not happen)
2022-09-28 15:09:53 +02:00
Matthieu Gautier 754b716a23
Merge pull request #545 from kiwix/build_dir_option
Add an option to set the build directory of kiwix-build.
2022-09-23 12:00:43 +02:00
Matthieu Gautier e21cb8971a Add an option to set the build directory of kiwix-build. 2022-09-21 16:15:14 +02:00
Matthieu Gautier 6d4aa756b5 New versions of zim-tools (3.1.2) and kiwix-desktop (2.3.0) 2022-09-07 18:53:14 +02:00
Matthieu Gautier 27bdda0bcf New version 8.0.1 of libzim.
This is the minor fix for debian packaging.
No need to rebuild other projects.
2022-09-07 18:53:14 +02:00
Matthieu Gautier a943388b41
Merge pull request #541 from kiwix/notarytool
Use notarytool to notarize on macOS
2022-09-07 17:40:46 +02:00
renaud gaudin fe92fc5080 Use notarytool to notarize on macOS
altool has been deprecated in favor of notarytool
2022-09-06 14:52:15 +00:00
Matthieu Gautier a8c769ddff
Merge pull request #539 from kiwix/update_certificate
Update Windows certificate for kiwix-desktop on appveyor.
2022-08-31 11:03:10 +02:00
Matthieu Gautier b260b6e5ca Update Windows certificate for kiwix-desktop on appveyor. 2022-08-31 10:24:03 +02:00
Matthieu Gautier 3ebf005cbb New version 8.0.0 of libzim 2022-08-11 17:28:02 +02:00
Matthieu Gautier c548a09f25
Merge pull request #536 from kiwix/ci_for_alpine 2022-07-11 16:19:39 +02:00
Veloman Yunkan 1755044333 Added CI image for Alpine 2022-07-11 17:38:07 +04:00
Matthieu Gautier fce112d4b1
Merge pull request #535 from kiwix/libzim_android 2022-06-28 14:24:24 +02:00
Matthieu Gautier 33c2ec2c4d Build and release libzim for android on the CI 2022-06-28 12:24:06 +02:00
Matthieu Gautier bcbb164d49 Build libzim dynamically on android. 2022-06-28 12:23:35 +02:00
Matthieu Gautier 3764fde97e We don't need jdk anymore to build on android 2022-06-28 12:23:04 +02:00
Matthieu Gautier 5939865e7c New version 2.2.2 of kiwix-desktop 2022-06-22 16:08:55 +02:00
Matthieu Gautier 75e9571474
Merge pull request #533 from kiwix/flatpak_version 2022-06-21 17:53:19 +02:00
Matthieu Gautier a04b989ed5 Update kde and qtwebengine to last Platform version. 2022-06-21 16:47:07 +02:00
Matthieu Gautier 72023a9a09 New version of libkiwix and kiwix-tools
Do not rebuild kiwix-desktop has current version is not compatible
with new version of libkiwix. We will do a release of kiwix-desktop soon.
2022-06-15 14:29:36 +02:00
Matthieu Gautier 6a3d3047e0 Do not try to package kiwix-search as it as been removed from kiwix-tools 2022-06-15 14:28:32 +02:00
Matthieu Gautier 2f1418949a
Merge pull request #529 from kiwix/url_fixes 2022-06-15 12:01:11 +02:00
Emmanuel Engelhart f5ec8018dd Fix various small things 2022-06-15 11:19:37 +02:00
Matthieu Gautier 4fd45bfe0f
Merge pull request #532 from kiwix/release_android_fix 2022-06-14 18:44:43 +02:00
Matthieu Gautier dba45ced36 Build android lib in the correct directory 2022-06-14 17:48:51 +02:00
Matthieu Gautier bd1064cb3a Fix url of downloaded dependencies.
We now store the dependencies in kiwix-build subfolder
2022-06-14 17:48:26 +02:00
Matthieu Gautier 17c8c92dba
Merge pull request #531 from kiwix/release_android_fix 2022-06-10 16:18:59 +02:00
Matthieu Gautier 9c220866ac Build and release each libkiwix android builds independently.
While it is ok to build all libkiwix android builds in one step,
the "release system" upload only one archive per platform.
So we need 4 platforms to do 4 uploads.

As we don't build on "android" platform now, we can clean up our scripts.
2022-06-10 10:26:24 +02:00
Matthieu Gautier 7086009a0a We don't need to upload to bintray now. 2022-06-10 10:11:01 +02:00
Matthieu Gautier ed7e628182
Merge pull request #530 from kiwix/libkiwix_no_wrapper 2022-06-09 15:18:26 +02:00
Matthieu Gautier 51ff5e58bb Be able to make the release of libkiwix on android. 2022-06-09 10:31:09 +02:00
Matthieu Gautier aa4250dd41 Build libkiwix with the right new option on android 2022-06-09 10:30:37 +02:00
Matthieu Gautier 72c271a74c Remove LibkiwixApp
The project was used to assemble all android compilation in one
multiplatform java archive.

This allow use to remove android_sdk and Gradle builder
2022-06-09 10:28:59 +02:00
Matthieu Gautier 9c4f359170 New version of libzim 7.2.2 2022-05-18 08:59:38 +02:00
Matthieu Gautier d36d91e3be
Merge pull request #527 from kiwix/issue-519 2022-05-17 18:37:55 +02:00
Matthieu Gautier 733a730877 Do not notarize macos build on CI.
We still sign macos build on nigthly and release.
2022-05-17 18:05:43 +02:00
renaud gaudin f103cddd77 Trust codesign using the certificate
When build_release_nightly calls codesign to sign libzim.7.dylib, it appears to be
hanging forever.
What's most likely happening is that Keychain Access is prompting a password request
without any possibility to answer, given this is running on the CI.

It's unclear whether Keychain Access wants to confirm codesign can access the certificate
or if it is trying to unlock another (System) keychain to find the certificate or key.

This addresses the former.
2022-05-12 14:58:46 +00:00
Matthieu Gautier 32a6e5b588 New version of libzim 7.2.1 and zim-tools 3.1.1 2022-05-06 14:51:16 +02:00
Matthieu Gautier c5662d4d7b New version of libkiwix 10.1.1
As the base dependencies changed, we also need to rebuild all our projects.
2022-04-12 11:04:49 +02:00
Matthieu Gautier 39b4077338
Merge pull request #525 from kiwix/zlib-1.2.12 2022-04-12 11:01:50 +02:00
Matthieu Gautier 0709fd20a5 Remove appveyor/applay_patch.sh
We don't have any patch to apply anymore.
2022-04-11 18:14:21 +02:00
Matthieu Gautier 5d967b3b26 Don't apply xapians patch on windows
The patch doesn't exist...
2022-04-11 18:13:53 +02:00
Matthieu Gautier b7a3187b45 Update version of zstd.
No need to update base_deps_meta_version as it is already updated in
this same PR.
2022-04-11 18:08:08 +02:00
Matthieu Gautier 5a6af5f5ab Use the last version of zlib on Windows.
The `zlib-1.2.12.meson.zip` is the composition of the official
`zlib.1.2.12.zip` archive and the meson wrabdb "patch"
https://wrapdb.mesonbuild.com/v2/zlib_1.2.12-1/get_patch as described
in https://wrapdb.mesonbuild.com/v2/zlib_1.2.12-1/zlib.wrap
2022-04-11 17:47:56 +02:00
Emmanuel Engelhart 500d3bec86 Use zlib 1.2.12 2022-04-11 17:47:56 +02:00
Matthieu Gautier 71ac307916
Merge pull request #524 from kiwix/dropbox 2022-04-04 16:39:51 +02:00
renaud gaudin 8ec2cd9a11 Using sftp for mkdir step
As there is no shell, use SFTP's mkdir command to create the folders up to final path.
2022-04-04 13:53:20 +00:00
renaud gaudin 1351fc7f8b Target uploads to new dropbox address
SSH server which was used to receive file uploads (CI, nightly and release) has been
migrated to a new one on a different address.
Username, Key and paths are unchanged.
Most notable changes are the use of `master.download.kiwix.org` as the target in
replacement of `mirror.download.kiwix.org` (although it would still work) and the
Port to which SSH is listening on (30022 instead of 22)
2022-03-30 22:10:06 +00:00
Matthieu Gautier 4158d75d7a Rebuild kiwix-tools release
As we've fixed the github workflow triggering, we need to redo the
release process for kiwix-tools.
2022-03-28 11:10:02 +02:00
Matthieu Gautier 12824f93af
Merge pull request #523 from kiwix/fix_workflow_trigger 2022-03-28 11:08:47 +02:00
Matthieu Gautier 90c2705b0e Fix workflow triggering in releaseNigthly workflow.
GITHUB_PAT is needed (and not needed for flatpak)
2022-03-28 10:49:14 +02:00
Matthieu Gautier 845ee43e47 New version of libkiwix 10.1.0 2022-03-24 19:01:34 +01:00
Matthieu Gautier 6273177210 New version of kiwix-desktop 2.2.1 2022-03-11 17:19:00 +01:00
Matthieu Gautier 077be3b035
Merge pull request #522 from kiwix/fix_ci 2022-03-11 16:57:11 +01:00
Matthieu Gautier d420b53f74 Do not use `-unsupported-allow-new-glibc` option when building appimage.
As we now build appimage on bionic and last version of linuxdeployqt
allow building from bionic (which is the older LTS) we can remove
the option.
2022-03-11 15:05:25 +01:00
Matthieu Gautier f1ac1b0121 Build everything using bionic instead of xenial 2022-03-11 15:05:25 +01:00
Matthieu Gautier 32f1bfdab3 Do not force a specific version of meson.
We were forcing a spcefic version has a workaround to meson issue.
We don't need now, and recent version is needed to compile on armhf.
2022-03-11 15:04:17 +01:00
Matthieu Gautier 64ea01e445 [CI] Do not build zim-tools on armhf
zim-tools depends of docopt which need a recent enough version of gcc (4.9)
But we are using gcc 4.8.3 to cross compile on armhf.
2022-03-10 18:16:39 +01:00
Matthieu Gautier 6505e82c37 [CI] Do not build zim-tools on macOS cross-compilation target.
We still build zim-tools on macOs with native build.
2022-03-10 16:57:56 +01:00
Matthieu Gautier 8b9b74d577 Better flatpak command options.
This mainly add the option `--nointeractive` when installing the sdk.
2022-03-10 16:21:14 +01:00
Matthieu Gautier af3cff6aeb Build flatpak in CI 2022-03-10 16:21:14 +01:00
Matthieu Gautier cdf4dab0a5 Cross compile windows on fedora 35. 2022-03-10 15:19:51 +01:00
Matthieu Gautier 01e8f92348 Build the projects in the CI.
We used to build only the base dependencies in the CI
(and build the projects in nightly&Release workflow).
Now always build the projects.
2022-03-10 15:19:51 +01:00
Matthieu Gautier 4f458e5954 New version of kiwix-desktop 2.2.0 2022-03-04 17:31:25 +01:00
Matthieu Gautier 8b01891644
Merge pull request #520 from kiwix/fix_appimage 2022-03-03 10:47:07 +01:00
Matthieu Gautier 7dd017627f Do not include low level std lib in appimage package
We have added those libraries to fix kiwix/kiwix-destop#14,
ie allow appimage build on recent system to run on older ones by packaging
the libc and libstdc++ library in the appimage.

But by packaging libstdc++, we force kiwix-desktop to use the packaged one.
On some recent system, the mesa drivers need a recent version of libstdc++ and,
as we are force to use the packaged one, we may use a "old" one.

The workaround forcing a driver was bypassing the problem by forcing a driver
not using a recent libstdc++. But with time, it is more and more difficult
to find one.

This commit means that new appimage generated will works only on equal or
more recent system that the one on which it has been generated.
For now we generate the appimage on Ubuntu bionic (18.04 LTS).

This reverts commit 05c0a691ec.
2022-03-02 18:47:40 +01:00
Matthieu Gautier 4db3daf243
Merge pull request #517 from kiwix/package_openssl 2022-02-16 15:20:30 +01:00
Matthieu Gautier 8edac14dcf Package OpenSSL libraries.
They are not packaged with windeployqt. We have to package them ourselves.

Until now, we were probably using dll installed by other applications.
2022-02-16 11:57:11 +01:00
Matthieu Gautier c079d04e2c
Merge pull request #516 from kiwix/fix_win_debug_build 2022-02-14 15:39:05 +01:00
Matthieu Gautier c6579233ca Fix nightly build to compile it with console on Windows.
Non printable characters was presents.
2022-02-14 15:01:23 +01:00
Matthieu Gautier 93f8e83274 New version of libkiwix 10.0.1
Rebuild kiwix-desktop and kiwix-tools.
2022-02-02 16:11:12 +01:00
Matthieu Gautier 0fb7dc63a7 Correctly detect if project is openzim or kiwix organization 2022-02-02 16:10:28 +01:00
Matthieu Gautier 5db6f0b76e
Merge pull request #515 from kiwix/macos_python38 2022-02-02 15:58:53 +01:00
Matthieu Gautier 5e6f68a3ef Use python 3.8 on macOS CI
Python 3.6 is not available anymore.
2022-02-02 15:18:20 +01:00
Matthieu Gautier 83190a669b
Merge pull request #514 from kiwix/new_versions 2022-01-20 15:18:10 +01:00
Matthieu Gautier bc8829ef0d Build new release of all our projects.
- libzim 7.2.0
- libkiwix 10.0.0
- kiwix-tools 3.2.0
- zim-tools 3.1.0
- kiwix-desktop 2.1.0
2022-01-19 15:39:17 +01:00
Matthieu Gautier 0f3e25024e
Merge pull request #513 from kiwix/android_no_werror 2022-01-18 13:23:12 +01:00
Matthieu Gautier fe74ad7aff Do not compile libkiwix on android with werror
The java wrapper is using deprecated methods,
so we cannot compile with `werror`.
2022-01-18 11:42:16 +01:00
Matthieu Gautier d1941aa5af Update version of libzim.
We can rebuild only zim-tools.
Other tools depend of libkiwix we cannot release now.
2022-01-03 11:16:43 +01:00
Matthieu Gautier 67788c63f0
Merge pull request #510 from kiwix/aria2-1.36.9 2021-12-25 18:37:40 +01:00
Matthieu Gautier 462538f4a5 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.
2021-12-24 13:08:29 +01:00
Matthieu Gautier 612efaad7c Update aria2c version on windows and appimage 2021-12-23 18:50:50 +01:00
Matthieu Gautier ea7fa1f207 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.
2021-12-23 18:50:50 +01:00
Emmanuel Engelhart 71b1c2799a Update aria2c to 1.36.0 2021-12-23 18:50:50 +01:00
Matthieu Gautier 276343c6af Add missing dependency `aria2` to "all" dependencies.
`AllBaseDependencies` is used as a dummy target to build all base
dependencies in the CI.
2021-12-23 18:50:50 +01:00
Matthieu Gautier 4ee28541cd Remove unnecessary zstd patch. 2021-12-23 18:50:48 +01:00
Emmanuel Engelhart 1a3df6fa3b Use recent zstdlib 1.5.1 2021-12-22 16:04:27 +01:00
Kelson 7dbaff90f8
Merge pull request #499 from kiwix/macOS_builds 2021-12-22 15:54:43 +01:00
ChrisLi 1374e01c7a Make the CI build the new on the new MacOS archs. 2021-12-22 15:26:01 +01:00
ChrisLi 82569620f2 Add MacOs arch
On top of the native platform (which may still use to compile for macos on macos)
we add a specific MacOs arch.
2021-12-22 15:24:45 +01:00
Matthieu Gautier c36fe74c81
Merge pull request #507 from kiwix/fix_appimage_script 2021-11-26 12:19:21 +01:00
Matthieu Gautier dc99315830 Fix setting of `SYSTEMLIBDIR` in the appimage creation script.
If it is the first time the script is run, $APPDIR doesn't exist, so,
by definition, `$APPDIR/lib` doesn't exists neither.

We must check the library dir in `$INSTALLDIR` which is the "source"
directory for script.
2021-11-23 16:50:32 +01:00
Matthieu Gautier 7c813c4002
Merge pull request #505 from kiwix/fix-appimage-on-Fedora34x64 2021-11-22 14:17:19 +01:00
Alexander Sashnov b48b97ca37 Fix AppImage creation script for Fedora34x64
* use appropriate value for SYSTEMLIBDIR automatically
* do not stop on absence of lib/libmagic.so*
* do not download AppImage tools again on further script runs
2021-11-20 22:03:53 +07:00
Matthieu Gautier da011c1f37
Merge pull request #502 from kiwix/curldeps 2021-10-27 10:42:15 +02:00
renaud gaudin a3f662a3de Fixed #501: disable extra libcurl dependencies 2021-10-26 18:13:15 +02:00
Matthieu Gautier 5c03f4a0be
Merge pull request #500 from kiwix/update_ci 2021-10-19 17:46:04 +02:00
Matthieu Gautier c78d5bbc72 Force version of python's module on xenial.
Xenial's python is 3.5 and recent versions of used python modules are
not supporting python 3.5 anymore.
We have to force specific versions for gcovr and its dependencies.
2021-10-19 11:28:26 +02:00
Matthieu Gautier c1205fc87d New release of libzim and zim-tools.
We don't rebuild other project as they are not ready for last version
of libzim.
2021-10-07 18:19:19 +02:00
Matthieu Gautier c3a0a27361
Merge pull request #496 from kiwix/specify_signtool_algorithm 2021-10-06 10:17:19 +02:00
Matthieu Gautier 2301647659 [WINDOWS][CI] Be explicit about the algorithm used by signtools.
Recent version of signtools need us to be explicit about the used
algorithm.
This is recommended to use the SHA256 algorithm even if the default
(previous) one was SHA1.
2021-10-05 17:10:24 +02:00
Matthieu Gautier a95106be0d
Merge pull request #495 from kiwix/appveyor_certificate
[Appveyor] Update certificate.
2021-08-04 11:00:57 +02:00
Matthieu Gautier 7c334dde2b [Appveyor] Update certificate. 2021-08-04 10:03:25 +02:00
Matthieu Gautier a9f7b5887e
Merge pull request #494 from kiwix/icu_with_lang_info 2021-07-27 18:00:28 +02:00
Matthieu Gautier 9c04df4fb2 [CI] Install automake and autoconf on macos. 2021-07-27 16:45:04 +02:00
Veloman Yunkan 41a411c667 Language data is packaged into ICU
With language data not put into icu, `icu::Locale::getDisplayLanguage()`
doesn't work correctly.
2021-07-27 16:45:04 +02:00
Matthieu Gautier ee093b4dfa
Merge pull request #493 from kiwix/various_fix 2021-07-06 10:39:40 +02:00
Matthieu Gautier 274aec60d2 Copy the right directory on libkiwix android.
The sub-directory `android-kiwix-lib-publisher` has not been renamed.
We plan to move this code in another repository anyway.
It is better for now to use the existing name instead of change the
directory.
2021-07-02 11:19:18 +02:00
Matthieu Gautier 11fc5a0a9c Use correct name for the qtwebengine class.
Wrong copy/paste.
This is not important as we reference dependencies by their name
attribute, not by the class name.
But it is better to have a correct name.
2021-07-02 11:16:02 +02:00
Matthieu Gautier c7ea2a31cb Correctly detect qmake command.
qmake may be named qmake-qt5 on some distribution.
2021-07-02 11:14:13 +02:00
Matthieu Gautier 0e6ed1384c Introduce a intermediate method to detect binaries. 2021-07-02 11:14:13 +02:00
Matthieu Gautier b995976c8a Fix packages name on fedora. 2021-07-02 11:14:13 +02:00
Matthieu Gautier c244e5b779 Link with ssp on win32.
Recent version of mingw need projects using `-D_FORTIFY_SOURCE` to link
with `ssp`.

See https://github.com/msys2/MINGW-packages/issues/5868#issuecomment-544107564
2021-07-02 11:14:13 +02:00
Matthieu Gautier 16214edbcf
Merge pull request #490 from kiwix/libkiwix
Rename kiwix-lib to libkiwix.
2021-06-30 17:15:17 +02:00
Matthieu Gautier aa349a18e7 Rename kiwix-lib to libkiwix.
The new name of kiwix-lib is libkiwix. Let kiwix-build adopt the name.
2021-06-30 16:45:54 +02:00
Matthieu Gautier f16fb8f228
Merge pull request #492 from kiwix/fix_qt515 2021-06-29 18:14:25 +02:00
Matthieu Gautier 43024859b1 Directly set the env variable in the docker file.
When running from the CI, .bashrc is not sourced so we must set the
env variable at docker file level.
2021-06-29 16:06:53 +02:00
Matthieu Gautier b8160de652 Correctly install io.qt.qtwebengine.BaseApp for flatpak build. 2021-06-29 16:06:53 +02:00
Matthieu Gautier d5e488333f Correctly package qt 5.15 on appveyor. 2021-06-29 16:06:53 +02:00
Matthieu Gautier 2e1986a0af
Merge pull request #489 from kiwix/lastQt 2021-06-24 13:59:25 +02:00
Matthieu Gautier afd17b2986 Make kiwix-desktop flatpak use last version of Qt (5.15).
Adapt flatpack_builder to generate the same manifest than PR
flathub/org.kiwix.desktop#6
2021-06-23 17:59:25 +02:00
Matthieu Gautier adf0c52f6c Use Qt 5.15 on Appveyor. 2021-06-23 17:59:25 +02:00
Matthieu Gautier ed999d61af [CI] Do not try to install packages in the CI.
On the CI, packages should be already installed.
Don't try to install with kiwix-build.
2021-06-23 17:27:52 +02:00
Matthieu Gautier 73e0cec0aa Update bionic docker image to use qt 5.15 instead of default qt version. 2021-06-23 17:27:52 +02:00
Matthieu Gautier f1dfa32a8d Use the correct archive for zim-testing-suite 0.3 2021-06-23 14:57:24 +02:00
Matthieu Gautier 96d4f3b93f Move to zim-testing-suite 0.3 2021-06-23 14:22:09 +02:00
Matthieu Gautier c445db171b Package zimrecreate in zim-tools. 2021-06-10 14:25:54 +02:00
Matthieu Gautier f9b7687ba7
Merge pull request #485 from kiwix/fix_mix_flatpak_build 2021-05-05 16:09:59 +02:00
Matthieu Gautier 7dcf57e32b Do not download zim-testing-suite when building in flatpak. 2021-05-05 15:07:29 +02:00
Matthieu Gautier 1cafcbf412 Get the "source" `zim-testing-suite` step.
The source step (install source) always exists.
The `plaformInfo.name` step may not exists
(On mixed target, we build all deps static and the last project dyn)
So the `native_dyn` doesn't exists for `zim-testing-suite`.
2021-05-05 15:06:35 +02:00
Matthieu Gautier 4de03ba776
Merge pull request #484 from kiwix/add_testing_suite_base_deps
Add all files of zim-testing-suite to the generated base_deps archive.
2021-05-04 15:06:13 +02:00
Matthieu Gautier 1845879825 Add all files of zim-testing-suite to the generated base_deps archive. 2021-05-04 14:36:15 +02:00
Matthieu Gautier 52e5c1053c
Merge pull request #483 from kiwix/libzim_testing_suite 2021-05-04 11:34:25 +02:00
Matthieu Gautier 9d90568204 Make libzim use the test data dire downloaded with zim-testing-tool. 2021-04-28 16:26:43 +02:00
Matthieu Gautier 2d3c5ed4c7 Add zim-testing-suite dependency. 2021-04-28 16:26:43 +02:00
Matthieu Gautier 11a7ec4020 Use the full_name as for the skip file marker.
This way we are sure to download the last archive all the time.
2021-04-28 16:26:43 +02:00
Matthieu Gautier dca64eb5d5 Allow builder to set a build environment for projects using it. 2021-04-12 18:14:23 +02:00
Matthieu Gautier b286be1207 Introduce new method `get_env` to create the env. 2021-04-12 18:11:05 +02:00
Matthieu Gautier 76aa746f84 Add the `dont_skip` attribute on dependency.
Instead of explicitly add the target associated to the toolchain
if we use `build_nodeps` option let add an attribute base ourself on it
to know if we need to add it or not.

This way, we may have other dependency we must not skip.
2021-04-12 18:09:52 +02:00
Kelson c16a4f5111
Merge pull request #482 from kiwix/appveyor_signing_timestamp
Use correct timestamp server for signing/dating kiwix-desktop.
2021-04-06 16:35:24 +02:00
Matthieu Gautier 10b85c0ee4 Use correct timestamp server for signing/dating kiwix-desktop.
The verisign timestamp server has been deprecated
(see https://stackoverflow.com/questions/65541786/is-the-verisign-timestamp-server-down)

Let's use the new digicert server as told in
https://docs.microsoft.com/en-us/windows/win32/seccrypto/using-signtool-to-sign-a-file
2021-04-06 14:30:32 +02:00
Kelson b068b277f1
Merge pull request #480 from kiwix/timeserver
Change time server in workflow
2021-03-23 15:52:28 +01:00
renaud gaudin 079e03473b Change time server in workflow
For the past week, the Release&Nightly workflow failed on macOS native_mixed
(but not on native_dyn) when calling ntp to sync clock before signing.
Calling time.apple.com resulted in a DNS error, leading to an error in ntp call

Why this fails on native_mixed is unknown. Maybe because it's being called twice
from the same (I guess) host in a short interleave?

This attempts to fix this by:
- using google's time server instead of Apple's
- correctly setting the timeout param before the server name (although not relevant
for this dns-based error)
- Ignore failures to sync time. We're doing it to minimize chances of unsynched clocks
to fail the signature but this is not absolutely required all the time.
2021-03-23 12:46:20 +00:00
Kelson b5ff96b53c
Merge pull request #479 from kiwix/kiwix-lib_requires_xapian
Added xapian as a dependency of kiwix-lib
2021-03-17 20:59:23 +01:00
Veloman Yunkan 4498eb2885 Added xapian as a dependency of kiwix-lib 2021-03-10 18:01:21 +04:00
Matthieu Gautier 20eb70a432
Merge pull request #478 from kiwix/xapian-1.4.18 2021-03-08 11:00:57 +01:00
Emmanuel Engelhart 3d8578ce8e Remove outdated Xapian remote patch 2021-03-07 15:00:58 +01:00
Emmanuel Engelhart 3e1446f2dd Upstream includes <cerrno>, not necessary anymore 2021-03-07 14:55:45 +01:00
Emmanuel Engelhart 54b47fea9e Remove xapian_sys_types.patch applied upstream 2021-03-07 14:50:56 +01:00
Emmanuel Engelhart aad2243c81 Bump-up Xapian to version 1.4.18 2021-03-07 14:41:33 +01:00
Kelson 871d257a36
Merge pull request #477 from kiwix/xapian_with_inmemory_backend
Enable inmemory backend in xapian
2021-03-07 14:21:50 +01:00
Veloman Yunkan d0db3efdce Enable inmemory backend in xapian 2021-03-07 13:14:11 +04:00
Kelson b5ae88a097
Merge pull request #475 from kiwix/macos-sign-fix3
allow more time for ntp server to respond
2021-02-16 18:09:07 +01:00
renaud gaudin 0de55705cf allow more time for ntp server to respond 2021-02-16 12:18:09 +00:00
Kelson 60f3efb5d7
Merge pull request #474 from kiwix/macos-sign-fix2
time update requires sudo
2021-02-15 17:03:49 +01:00
renaud gaudin b3f66e0ac0 time update requires sudo 2021-02-15 09:42:50 +00:00
Kelson af0a69046b
Merge pull request #472 from kiwix/macos-sign-fix
fixed syntax for macOS signing
2021-02-11 09:19:03 +01:00
renaud gaudin fd590a5b4b fixed syntax for macOS signing 2021-02-11 08:06:06 +00:00
Kelson 2d3138a84a
Merge pull request #470 from kiwix/zim-tools-mustache
zim-tools needs newly Mustache
2021-02-10 15:03:46 +01:00
Emmanuel Engelhart f6074a7408 zim-tools needs newly Mustache 2021-02-10 14:49:16 +01:00
Kelson cca9033c69
Merge pull request #471 from kiwix/macos-sign
Notarizing libzim release for macOS
2021-02-09 18:06:06 +01:00
renaud gaudin ea55cac32d Fixed #469: Notarizing libzim release for macOS
This adds the notarization (see #469) of the libzim binary for macOS during the build.
It it not dependent on RELEASE so it benefits all builds.

It basically does two things:
- sign the build with our Developer ID certificate from Apple.
- Request notarization from Apple for the binary.
At the moment, it concerns only libzim. Might expand that to libkiwix and the zim/kiwix tools
once we start releasing those.

Github Actions prepare the certificate and environment, and signing+request is done in `notarize_macos_build()` (common.py)

It required the following new secrets:

| secret | value |
|---|---|
| `APPLE_SIGNING_CERTIFICATE` | base64 of the P12 certificate |
| `APPLE_SIGNING_P12_PASSWORD` | password for the P12 certificate (we chose that when exporting to P12. Apple doesnt provide P12) |
| `APPLE_SIGNING_IDENTITY`| Common name of our certificate. Not a private info but seems better suited there than in the CI |
| `APPLE_SIGNING_TEAM`| Apple Developer Team ID (mentionned in the signing identity) |
| `APPLE_SIGNING_ALTOOL_PASSWORD`| app-specific password created to request notarization |
| `APPLE_SIGNING_ALTOOL_USERNAME`| username associated with the app-specific password. Must be an Apple ID with perms on the Certificate. Currently mine. |
2021-02-09 13:30:24 +00:00
Matthieu Gautier b635daae68 Change version of libzim.
Libzim changes its version.
But we are not ready for release now.
2021-02-09 14:13:46 +01:00
ChrisLi 41071d7c9b
use brew list --formula (#468) 2021-01-15 10:07:00 +01:00
Matthieu Gautier f033da0efa
Merge pull request #467 from kiwix/trigger-docker 2021-01-13 17:42:02 +01:00
renaud gaudin ff66a96980 Fixed #465: trigger docker publish on release
This triggers a `workflow_dispatch` event on the `docker.yml` workflow or the matching
repository for both `zim-tools` and `kiwix-tools` targets that supports it.
2021-01-13 15:58:33 +00:00
Kelson 9597662be8
Bump-up libmicrohttpd to 0.9.72 (#464) 2020-12-30 10:44:48 +01:00
Matthieu Gautier 0d6b143122 Download archives on mirrors of `download.kiwix.org`. 2020-12-15 15:33:10 +01:00
Matthieu Gautier 0ff5d0d173 kiwix-desktop icon has changed name. 2020-12-08 13:26:14 +01:00
Matthieu Gautier 31816879ca New release of libzim, kiwix-lib, zim-tools and kiwix-desktop. 2020-11-17 16:54:18 +01:00
Matthieu Gautier 2ef8e14509 Update dependency of kiwix-desktop.
Now that kiwix-desktop use kiwix-lib to start the server, we don't need
kiwix-tools dependency.
2020-11-17 16:49:26 +01:00
Matthieu Gautier 7162b6ff2b Update dependency of libzim. 2020-11-17 16:43:27 +01:00
Matthieu Gautier 70d31e9405
Merge pull request #462 from kiwix/fix_macos_ci_install
[CI] Fix macos brew install packages (release&Nightly)
2020-10-28 17:37:53 +01:00
Matthieu Gautier 6434150da9 [CI] Fix macos brew install packages (release&Nightly) 2020-10-28 16:40:02 +01:00
Matthieu Gautier 471895897e
Merge pull request #461 from kiwix/fix_macos_ci_install
Fix macos brew install packages.
2020-10-27 15:09:49 +01:00
Matthieu Gautier 8846acc8cf Fix macos brew install packages.
Directly use brew instead of `get-package` action.
`get-package` seems to be broken with some invalid git command.
2020-10-27 14:20:57 +01:00
Matthieu Gautier 8bd1c36721
Merge pull request #460 from kiwix/fix_ci_appveyor 2020-10-16 17:38:44 +02:00
Matthieu Gautier c7baa60896 fix install_libmicrohttpd 2020-10-16 15:08:47 +02:00
Matthieu Gautier 3b3e9d227f Compile on VS studio 2019 2020-10-16 14:32:36 +02:00
Matthieu Gautier a64cd9f790 New release of libzim 6.2.2 2020-09-02 18:25:00 +02:00
Matthieu Gautier b23cf13caa New release of libzim 6.2.1.
This is just a fix for windows compilation.
We don't need to trigger build for others projects,
only for kiwix-desktop because it is build on windows.
2020-09-01 09:55:43 +02:00
Kelson 7a1ca16b72
Merge pull request #453 from kiwix/catalyst_abi
Catalyst abi
2020-08-31 07:56:21 +02:00
ChrisLi 674d6bf6df CI 2020-08-28 14:16:25 -04:00
ChrisLi 0e20dc90e6 gitignore 2020-08-28 14:16:25 -04:00
Chris Li 149ed01f12 Add Mac catalyst as a new target 2020-08-28 14:16:25 -04:00
Matthieu Gautier ea78ba37df New release of kiwix-lib 9.4.0 2020-08-28 16:59:59 +02:00
Matthieu Gautier 1dde278ad6 Correctly set the extra postfix for android kiwix-lib. 2020-08-27 19:20:05 +02:00
Matthieu Gautier bbb81438b6 New version of libzim 6.2.0 2020-08-27 17:53:19 +02:00
Matthieu Gautier 97554c04f4 Rebuild kiwix-tools with the release fix. 2020-07-23 14:34:06 +02:00
Matthieu Gautier 045099f5f9
Merge pull request #457 from kiwix/fix_no_file_to_publish
Do not fail if there is no file to publish.
2020-07-20 10:26:45 +02:00
Matthieu Gautier a3038253e8 Do not fail if there is no file to publish. 2020-07-15 17:42:32 +02:00
Matthieu Gautier b9245b4b86 New release of libzim, kiwix-lib, zim-tools and kiwix-desktop 2020-07-15 16:51:38 +02:00
Matthieu Gautier e81a2e7006 Merge tag 'r_10' 2020-07-15 16:20:16 +02:00
Matthieu Gautier 962835b33a
Merge pull request #451 from kiwix/integrate-zimwriterfs-into-zim-tools 2020-07-15 16:11:57 +02:00
Matthieu Gautier 39a93b07b3 Fix dependency detection for zim-tools. 2020-07-15 15:51:09 +02:00
Alexander Sashnov da31dd428e remove 'zimwriterfs' project from build and CI configuration
'zimwriterfs' is now a part of zim-tools (openzim/zim-tools/#92)
2020-07-08 16:54:14 +02:00
Matthieu Gautier 0910e3bc7d
Merge pull request #452 from kiwix/libmicrohttpd-0.0.71
Upgrade libmicrohttpd to 0.9.71
2020-07-08 15:26:50 +02:00
Kelson 3de886f805 Upgrade libmicrohttpd to 0.9.71 2020-07-08 14:57:38 +02:00
Matthieu Gautier 206ed166e0 New release of kiwix-tools. 2020-07-02 15:38:52 +02:00
Matthieu Gautier 2d1e8d0202 Also do the kiwix-lib release (for source publication) 2020-07-02 15:38:24 +02:00
Matthieu Gautier 7f39755ea0 New release kiwix-lib and kiwix-tools. 2020-07-02 15:22:58 +02:00
Matthieu Gautier 907bd61f59 Add BINTRAY secrets to env variables. 2020-07-01 16:32:03 +02:00
Matthieu Gautier 2ec9f10687 New release of kiwix-lib 9.2.3
The fix is only about compilation, no need to recompile other dependencies.
2020-07-01 11:36:54 +02:00
Matthieu Gautier ef7843633e Set the Qt version to use on fedora.
The default Qt version on fedora is Qt 4. We must force the use of Qt 5.
2020-07-01 11:32:43 +02:00
Matthieu Gautier da62250d83 Build kiwix-desktop without console only if we are doing a release.
`KIWIX_DESKTOP_RELEASE` is not enough to test as it will be not change
until the next commit. And we want nightly to build with console output.
2020-07-01 11:31:51 +02:00
Matthieu Gautier 7afa3f6a52 Correctly build release of kiwix-lib on android.
The name of the target is `kiwix-lib-app` on android but the key
in the version directory is `kiwix-lib`.
2020-07-01 11:30:26 +02:00
Matthieu Gautier 0419cf5f4d New release of kiwix-desktop. 2020-06-30 17:47:15 +02:00
Matthieu Gautier 66bf0d2a0e New release of libzim 6.1.7 2020-06-30 17:35:25 +02:00
Matthieu Gautier ab6ea66e31 New release of libzim 2020-06-24 15:36:54 +02:00
Miguel Rocha 728caca741
Force compilation of docoptcpp (#449)
- Docopt commit id was updated and therefore we need to force a new build in order to get the latest change (docoptcpp.pc) into the deps2 archive (needed by zim-tools)
2020-06-17 16:03:27 +02:00
Matthieu Gautier 10439b230a
Merge pull request #445 from kiwix/macos-dist
Release libzim for macOS in the CI
2020-06-17 11:35:24 +02:00
renaud gaudin 8478d65c90 enable compilation of native_mixed on macos
Issue #349 requires a native_mixed for macOS.
native_mixed is working for libzim so we whitelist it.

On the release CI, we fix the macos dylib rpath so it doesn't include the
full build-install step path which is probematic for a distributed file.

We build native_mixed for OSX in both CI and release mode
2020-06-17 09:04:10 +00:00
Matthieu Gautier 077a410086
Merge pull request #446 from kiwix/build_base_deps_bionics 2020-06-10 15:21:53 +02:00
Matthieu Gautier 2243ca9d91 Deactivate static build on bionic.
See #447
2020-06-10 14:26:11 +02:00
Matthieu Gautier 4bdbc5ac53 Build the base deps on bionics also.
This will allow other project to have their CI running on bionics.
2020-06-09 11:37:56 +02:00
Matthieu Gautier 39ca099248 New version of libzim.
No need to rebuild other project as there is code change.
2020-06-03 15:49:47 +02:00
Matthieu Gautier 15a23fcf23 New version of kiwix-lib 2020-06-03 10:49:22 +02:00
Matthieu Gautier 80c59b246f Change kiwixbot email address to the new one. 2020-06-03 10:48:41 +02:00
Matthieu Gautier f384cd23e7 New version of kiwix-lib 2020-06-02 10:20:43 +02:00
Matthieu Gautier 3b38364939
Merge pull request #424 from kiwix/kiwix-desktop-console 2020-05-25 15:24:38 +02:00
luddens e6fed66927 display windows console for non release builds 2020-05-25 14:22:03 +02:00
Matthieu Gautier 497967236e Publish release source archive on "native_mixed" platform.
`libzim` is build on "native_mixed", not "native_dyn".
2020-05-25 13:08:57 +02:00
Matthieu Gautier 22da0f3b6d Fix postfix generation to not include the `0`. 2020-05-25 12:21:10 +02:00
Matthieu Gautier 925943a5ee Fix checkout of code.
Correctly handle tag ref.
2020-05-25 12:21:10 +02:00
Matthieu Gautier 040171129a Fix release tag format.
The release tag format change to a classic tag triplet format `\d.\d.\d`
to a custom one `r_\d`.
2020-05-25 12:21:10 +02:00
Matthieu Gautier ae8a9febb9 New release of libzim.
Rebuild only projects depending of the writing part.
2020-05-25 12:21:10 +02:00
Matthieu Gautier acf66e36af
Merge pull request #440 from kiwix/add_docoptcpp_dep 2020-05-25 11:35:23 +02:00
MiguelRocha e72589a850 Added a flag to force kiwix build to not do fast_clone
- Docopt cannot do fast_clone cause it is getting a
    specific commit id. This will be changed when a new
    release is available.
2020-05-25 10:57:22 +02:00
MiguelRocha 69c33da0bc Now kiwix-build retrives docopt from a commit that has pkgconfig support. 2020-05-25 10:57:04 +02:00
Matthieu Gautier f632ef8fcc
Merge pull request #444 from kiwix/use_distro 2020-05-25 10:54:49 +02:00
Matthieu Gautier e27fd7b83d Use distro module to detect the distribution name.
`platform.linux_distribution` is deprecated.

This is a recommit of 0fe69e3 now that we moved every thing on github
actions.
2020-05-21 19:55:40 +02:00
Matthieu Gautier 257e4a4987
Merge pull request #443 from kiwix/release_github 2020-05-21 19:31:34 +02:00
Matthieu Gautier cf5b54c58b Remove travis CI. 2020-05-21 12:18:28 +02:00
Matthieu Gautier e020eb35ac [WIP] Move the release process to github actions. 2020-05-21 12:13:36 +02:00
Matthieu Gautier 763fe1432d New release of zim-tools.
Also build kiwix-tools.
2020-05-18 15:54:23 +02:00
Matthieu Gautier 59b0318193 New version of libzim, zim-tools, kiwix-lib, kiwix-tools. 2020-05-18 15:25:45 +02:00
Matthieu Gautier b68236526d Revert "Use distro module to detect the distribution name."
This reverts commit 0fe69e3991.

This break installation of kiwix-build in travis' docker image.
2020-05-18 13:46:19 +02:00
Matthieu Gautier df2491a6a4
Merge pull request #439 from kiwix/use_distro_module 2020-05-17 18:42:46 +02:00
Matthieu Gautier 0fe69e3991 Use distro module to detect the distribution name.
`platform.linux_distribution` is deprecated.

Fix #415
2020-05-17 17:57:24 +02:00
Matthieu Gautier 46bcb17761 New version of libzim and zimwriterfs.
Only rebuild zim-tools and not all other project as the libzim release
is only about writer issues.
2020-05-11 16:38:48 +02:00
Matthieu Gautier 77b57761dc
Merge pull request #441 from kiwix/iOS_remove_32bit_builds 2020-05-11 12:02:41 +02:00
ChrisLi d0677492d1 remove from CI 2020-05-10 19:55:45 -04:00
Chris Li 23a682c52d remove platform info 2020-05-09 09:11:20 -04:00
Matthieu Gautier d3466f32fe
Merge pull request #437 from kiwix/add_docoptcpp_dep 2020-04-27 14:13:23 +02:00
MiguelRocha 3e2df9a8e8 Added docopt cpp dependency to zimtools. It will be needed to the new version of zimdump
Do not build docopt on android and iOS.
2020-04-27 13:39:40 +02:00
Chris Li edc606aed0 remove platform options 2020-04-24 22:20:37 -04:00
Chris Li ddc73181db higher iOS and macOS compatibility version 2020-04-24 22:20:37 -04:00
Matthieu Gautier ce329b6a79
Merge pull request #434 from kiwix/last-moustache-version 2020-04-21 16:31:42 +02:00
Kelson 7f6a8856b7 Remove deprecated Mustache patch 2020-04-21 09:31:21 +02:00
Kelson 5d1f5bda1f Update to Mustache v4.1 2020-04-21 09:31:21 +02:00
Matthieu Gautier 6d47055c89 Add the zstd patches to the flathub git repository. 2020-04-20 17:44:11 +02:00
Matthieu Gautier 6888794ec8 New version of kiwix-lib.
Rebuild kiwix-tools and kiwix-desktop.
2020-04-20 15:43:37 +02:00
Matthieu Gautier c5c4a316b0
Merge pull request #435 from kiwix/flatpak_zstd 2020-04-20 15:37:38 +02:00
Matthieu Gautier 99226e0c6a Build zstd in flatpak.
Revert 10c767e8ce
2020-04-20 15:14:31 +02:00
Matthieu Gautier 161c018702 [WINDOWS CI] Fix version of kiwix-tools 2020-04-20 13:23:24 +02:00
Matthieu Gautier 4b080dd975 New version of kiwix-desktop. 2020-04-20 10:10:45 +02:00
Matthieu Gautier 60e3e755e1 New build of libzim, kiwix-lib and zim-tools.
Do not build kiwix-desktop yet as we will do a new release just after.
2020-04-17 17:46:28 +02:00
Matthieu Gautier 069aab9a35 Do not fail if there is nothing to commit of flathub repository. 2020-04-10 11:35:21 +02:00
Matthieu Gautier af55ffed6d Fix patch of kiwix-desktop makefile for zstd.
- Copy the python script in kiwix-build repository instead of getting i
  from kymeria.fr
- Patch the makefile to change the lib for zstd.
2020-04-10 11:35:00 +02:00
Matthieu Gautier 39771c6481 [CI] Build on windows for all branches/tags.
- We need to build for tags to build the releases.
- Build on other branches is useful to build test version of kiwix-desktop.
2020-04-10 09:42:16 +02:00
Matthieu Gautier ffdee634f4 Do not force a reconfigure of meson projects.
If meson.build changes, the ninja command will rebuild it.
And its avoid us to delete the build directory.
2020-04-10 00:38:47 +02:00
Matthieu Gautier 384b7d6a00 [CI] Export dist archive before building other project.
With the commit fb07b58 we are not skiping the compile/build process
of meson project. As meson projects first remove the build directory
before configuring, we remove dist archives that could have been generated
before.

Copy the dist archive in the export so we are ok.
2020-04-10 00:38:47 +02:00
Matthieu Gautier 62f48f2836 Better log of what is deployed. 2020-04-10 00:38:47 +02:00
Matthieu Gautier 3d08278a85 New version of kiwix-desktop. 2020-04-08 20:42:11 +02:00
Matthieu Gautier bd546fe33e New version of libzim, zim-tools, zimwriterfs, kiwix-lib and kiwix-tools. 2020-04-08 18:12:01 +02:00
Matthieu Gautier 10c767e8ce Do not compile zstd on flatpak.
The meson.build file of meson is not in the main directory.
We have to update kiwix-build to handle this.

For now, compile flatpak without zstd.
We will need to do a new build on flatpak with zstd soon.
2020-04-08 18:09:39 +02:00
Kelson 3c8a9ffbfe
Use standard name for CI (#433) 2020-04-07 18:17:38 +02:00
Matthieu Gautier c4931925a3
Merge pull request #423 from kiwix/zstd
Added zstd dependency (fixes #422)
2020-04-07 15:16:09 +02:00
Veloman Yunkan 3cbcac2e30 Applying xapian_remote.patch in appveyor build
Failing to do so in PR#384 secretly broke the appveyor build (no real
failures were observed since the appveyor builds ran in USE_CACHE=1
mode, without rebuilding the base dependencies to which xapian belongs).
2020-04-07 16:41:31 +04:00
Veloman Yunkan 25d9e18e3d Temporary fix for facebook/zstd#2073 2020-04-07 14:12:17 +04:00
Veloman Yunkan a2aac46da9 Moved C:\Python36\Scripts to the begging of PATH
Otherwise in the appveyor Windows build meson installed under
"C:\Program Files" is used.
2020-04-06 23:54:00 +04:00
Veloman Yunkan 3a03e9a8aa Added appveyor/install_zstd.cmd 2020-04-06 23:03:39 +04:00
Veloman Yunkan ece4df3721 Added zstd dependency 2020-04-06 20:17:09 +02:00
Kelson 9be35a4dc0
Fix qt-everywhere-src-5.10.1.tar.xz URL (#431) 2020-04-06 20:16:01 +02:00
Matthieu Gautier d073c6d1dc
Merge pull request #432 from kiwix/donot_recompile
Fix recompilation of the CI of meson project.
2020-04-06 19:31:37 +02:00
Matthieu Gautier fb07b58812 Fix recompilation of the CI of meson project.
We were assuming that meson project correspond to our projects and so we
were always building them, even if they were already compiled.
(This way, a simple `kiwix-build` is enough to recompile the WIP code of
our project).

However, on the CI, we do not archive the source code/build directory in
the base deps archive. So when we try to compile, the compile step of
meson projects fails because the source are not here.
We have a small workaround for pugixml but as zstd is also meson, it is
time to do something correct.

By default, all projects now try to skip if a build is already present.
Our projects are marked as `force_build` and so, they do not try to skip.
2020-04-06 19:15:40 +02:00
Kelson 3ea1bfd38e
Proper Github Actions CI badge 2020-04-06 16:29:46 +02:00
Matthieu Gautier 20394d341f
Merge pull request #420 from kiwix/O3_compilation
Build all make based dependency using -O3 option.
2020-03-24 17:21:11 +01:00
Matthieu Gautier 4fa5f34125 Build all make based dependency using -O3 option.
This will build all Make, CMake, QMake dependency being build with -O3.
So all our dependencies will be build with -O3.

Our project (meson) are already build in release when needed.
kiwix-desktop should be build optimized in case of release but we need
to handle it correctly. At least not build in O3 per default as it may
break debug.
2020-03-24 16:50:38 +01:00
Matthieu Gautier aa277a925a
Merge pull request #417 from kiwix/lzma_asm
Use correct base version
2020-03-18 22:27:16 +01:00
Matthieu Gautier b910803fbe Use correct base version 2020-03-18 21:47:09 +01:00
Matthieu Gautier b932dbd35e
Merge pull request #416 from kiwix/lzma_asm
Build lzma with assembler optimization.
2020-03-18 21:42:08 +01:00
Matthieu Gautier 71c46d984a Build lzma with assembler optimization. 2020-03-18 21:03:48 +01:00
Kelson d8707d8ad1 Release kiwix-tools 3.0.3 2020-03-01 15:52:50 +01:00
Matthieu Gautier 56cbf4985c fix typos in compile_all.py (build of android app) 2020-02-27 15:41:10 +01:00
Matthieu Gautier 8cecb1c759 Rebuild kiwix-lib (for android) 2020-02-26 18:32:00 +01:00
Matthieu Gautier bf405d105c Revert 82617f6b94 2020-02-26 18:30:24 +01:00
Matthieu Gautier ad24eaab4b
Merge pull request #414 from kiwix/fix_cross_file
Always write the cross_file using the same name.
2020-02-25 17:17:19 +01:00
Matthieu Gautier 6093c011ab Always write the cross_file using the same name.
Even if we use different template for different platform, we must
always use the same cross_file name.
2020-02-25 16:36:56 +01:00
Matthieu Gautier d30ec7219e
Merge pull request #413 from kiwix/no_git_update
No git update
2020-02-25 16:34:53 +01:00
Matthieu Gautier 08ed650c78 [CI] Clone git repository with a depth of 1 in the CI. 2020-02-25 15:53:23 +01:00
Matthieu Gautier 40b5013279 Add some colors in the terminal. 2020-02-25 15:48:20 +01:00
Matthieu Gautier f504cf54e1 Do not reset the source directory if there is modification.
We simply do a `git merge --ff-only` instead of a `git reset`. This way:

- No change on the local repository
    => update to `remote/master`
- If you switch branch and local branch is behind `remote/master`
    => fast forward to `remote/master`
- If you switch branch and branches diverge
    => No update of the directory
- On branch master (or a branch behind `origin/master`) with compatible
  change in the working tree.
    =>  update of the directory
- On branch master (or a branch behind `origin/master`) but incompatible
  change in the working tree.
    =>  No update.

This way, sources are keep up-to-date as far as possible.
2020-02-25 15:46:09 +01:00
Matthieu Gautier 3f50b1b069
Merge pull request #412 from kiwix/fix_android_ci
Fix android ci
2020-02-24 20:51:09 +01:00
Matthieu Gautier 94c98261c7 Fix compilation on different platform in the same time.
If we modify the dependency's configure_env, we may change
the dictionary with value of the first platform. Then, when
we use it for the second platform, the previous values are used.

Do not modify the dep_conf_env dictionary and then we are good.
2020-02-24 18:24:07 +01:00
Matthieu Gautier 32e3b5b5c4 Fix compilation of kiwix-lib-app.
- We should not try to set the cross compilation flags when we use
  gradle.
- Fix anyway the setting of tho cross compilation flags for android sdk
  platform (the default implementation use the `static` attributes that
  doesn't exist for android)
2020-02-24 15:30:31 +01:00
Matthieu Gautier 8bca6ea8dc
Merge pull request #411 from kiwix/action_ios2
Action ios2
2020-02-21 18:48:20 +01:00
Matthieu Gautier 661eb95df0 Use a specific cross_file on iOS cross compilation.
We need to set the property `needs_exe_wrapper` to true for
x86_64 cross compilation.

Else, meson will try to detect if we could run the cross
compiled executable, and because it is the same arch, it will
assume we can. So it will try to sanity check and execute the
cross compiled binary. Then fails.
2020-02-21 16:29:23 +01:00
Matthieu Gautier 7b6c79482a Make the dependency responsible to set the compilation env.
Instead of having the run_command function setting the
env from the buildEnv, this is the dependency that create the
env and then pass it to the run_command function.

This way, each dependency will be able to set a specific env.
2020-02-21 16:29:23 +01:00
Matthieu Gautier e27ede80cc Use correct arch_full name. 2020-02-21 15:12:17 +01:00
Matthieu Gautier 36366b2dd3 Better define of value in ios platform.
No real change, just better code to define it.
2020-02-21 15:12:17 +01:00
Matthieu Gautier 7d742f807f Fix setting of environment using env from dependency.
If `self.configure_env` is a (computed) property, the previous code
never format the value of the env.
2020-02-21 15:12:17 +01:00
Matthieu Gautier 2c14c1a705 Build base for all iOS architectures. 2020-02-21 15:12:17 +01:00
Matthieu Gautier c4295b1644 Do not set a specific compiler for ios 2020-02-21 15:12:17 +01:00
Matthieu Gautier 79bb23504b Update version of kiwix-lib to 9.0.1
Do not rebuild dependencies as the change is only about the android
wrapper.
2020-02-21 15:00:26 +01:00
Matthieu Gautier 14d6aae4b1 Update version of kiwix-tools. 2020-02-13 11:46:20 +01:00
Matthieu Gautier 5d9730423a Update version of kiwix-lib.
Do not make a new build of kiwix-tools right now as we will do a
new release of it once kiwix-lib release is published.
2020-02-12 15:27:27 +01:00
Matthieu Gautier a88706e78e
Merge pull request #407 from kiwix/rgaudin/libmicrohttp
switch to older version of libmicrohttpd
2020-02-12 14:44:14 +01:00
Matthieu Gautier b790c00187 [action] Correctly fetch the right branch in the CI 2020-02-12 11:25:03 +01:00
renaud gaudin 3569c277a9 switch to older version of libmicrohttpd
libmicrohttpd 0.9.69 is not working properly on macOS (catalina)
2020-02-12 11:09:46 +01:00
renaud gaudin 5af0a8bfe7 fixed crash in xapian-core configure
use a copy of configure_env to prevent edits on what's being iterated
2020-02-11 13:10:21 +00:00
Kelson 29956ee6be Release zimwriterfs 1.3.8 2020-02-10 14:36:11 +01:00
Matthieu Gautier a912b890e0 Run base build every day at 1h 2020-02-05 12:11:40 +01:00
Matthieu Gautier b6e5912075 Run schedule every 20 minutes (test) 2020-02-05 11:53:46 +01:00
Matthieu Gautier fde12d47f6
Merge pull request #405 from kiwix/schedule
Schedule a base build everyday.
2020-02-05 11:41:41 +01:00
Matthieu Gautier 3326cda7e3 Schedule a base build everyday. 2020-02-05 11:25:18 +01:00
Kelson 4b3178ea12
Github Kiwix Sponsoring page link 2020-02-01 17:55:53 +01:00
Matthieu Gautier e90766fe60
Change args given to kiwix-lib meson for android. (#401)
Change args given to kiwix-lib meson for android.
2020-01-31 11:10:32 +01:00
Matthieu Gautier 0a37c8a573 Change args given to kiwix-lib meson for android. 2020-01-28 15:49:52 +01:00
Matthieu Gautier f8dae7e972
Merge pull request #404 from kiwix/flathub_update
Do not update flathub repository if no release.
2020-01-28 15:47:30 +01:00
Matthieu Gautier b06d93b06d Do not update flathub repository if no release.
Fix #385
2020-01-28 12:05:13 +01:00
Matthieu Gautier b94cf5e0e1
Use github action to build base deps of kiwix-build. (#400)
Use github action to build base deps of kiwix-build.
2020-01-21 16:37:49 +01:00
Matthieu Gautier 70b3ed0c76 Update docker images 2020-01-21 15:01:05 +01:00
Matthieu Gautier 1b7a2c812e Add missing platforms.
No iOs for now.
2020-01-21 13:49:12 +01:00
Matthieu Gautier f73e0b2abf Build base deps on macos. 2020-01-21 13:49:12 +01:00
Matthieu Gautier 1d84266751 Build all base dependencies.
Use a custom script for this.
Set `SKIP_BIG_MEMORY_TEST` to avoid launching big test on libzim.
2020-01-21 13:49:12 +01:00
Matthieu Gautier c178c6ea35 Upload an archive of the build directory in case of failure. 2020-01-21 13:49:12 +01:00
Matthieu Gautier d37acc2cbe Build basedeps archives on GithubAction.
Use a specific script to download/build the base deps.

Mainly based on script in travis/compile_all.py
2020-01-21 13:49:12 +01:00
Matthieu Gautier ce45966d40 Add a GithubAction CI to build the docker images.
No really useful for now. But will be in next commit.
2020-01-21 13:49:12 +01:00
Matthieu Gautier 2f151df63c Update version of meson.
We should not force a specific version as it is a environment problem,
but for now, set it.
2020-01-21 13:49:12 +01:00
Matthieu Gautier 2774967e6d Set the pkg-config for cross-compiling.
This is needed for win32 on fedora.
It is better to use a specific pkg-config than setting a PKG_CONFIG_LIBDIR.
This avoid other CI (libzim/...) to set a env var specific to win32 build.
2020-01-20 22:55:50 +01:00
Matthieu Gautier 82617f6b94 Do not set `march` for android build.
We already build to the right architecture by using the arch_full triplet
gcc/g++/...
We don't need to set march when building android.
2020-01-20 22:55:21 +01:00
Justin Biggs 2e05257737 Update Readme.MD, correct spelling error (#397)
"Prerequisite"
2019-12-26 16:28:11 +01:00
Kelson b92a111fcc
Upgrade libmicrohttpd to 0.9.69 (#394) 2019-12-16 16:57:59 +01:00
Kelson 2d7b96c997
Add Ubuntu 2020-04 focal to the CI (#393) 2019-12-16 13:24:32 +01:00
Kelson d23a9dbebe
Remove old deploy python script (#392) 2019-12-14 15:25:50 +01:00
Kelson 40dc15057c Fix small typo 2019-12-14 15:21:16 +01:00
Kelson eb0df06bb0 Create dedicated troubleshooting section 2019-12-14 15:19:51 +01:00
Kelson 5737ad21a5 Add a few information about license 2019-12-14 15:15:36 +01:00
Kelson 49cec493c4 Add configs for two Github bots 2019-12-14 15:12:31 +01:00
Kelson 2ffca7990a
Merge pull request #391 from kiwix/better-readme
Improved README
2019-12-14 14:58:05 +01:00
Kelson 283c0a8e9d Improved README 2019-12-14 14:54:10 +01:00
Kelson f93dd11bfe
Merge pull request #390 from kiwix/stop-multiple-builds
Avoid duplicates CI builds
2019-12-09 10:19:05 +01:00
Kelson 0020784c89 Avoid duplicates CI builds 2019-12-09 09:10:06 +01:00
Kelson 2862532dff
Merge pull request #384 from kiwix/xapian-1.4.14
Bump-up Xapian to 1.4.14 (#382)
2019-12-09 01:21:38 +01:00
Kelson 8420dcb474 Bump-up Xapian to 1.4.14 (#382) 2019-12-09 01:12:48 +01:00
Kelson 3f9592a6a8
Merge pull request #389 from kiwix/TechnologyClassroom-add-target
Added another target and more target-platforms
2019-12-09 01:09:41 +01:00
TechnologyClassroom 315f63f8b9 Added another target and more target-platforms 2019-12-09 01:00:07 +01:00
Kelson e18e5c8565 Fix typo in README 2019-12-08 14:25:40 +01:00
Kelson 1a6b9b00ec Release kiwix-lib 8.2.2 2019-12-08 12:17:48 +01:00
Kelson 97bcc3e991
Merge pull request #351 from kiwix/no_android
No android
2019-12-05 14:25:47 +01:00
Matthieu Gautier 95138d207b Remove an unwanted print. 2019-12-05 12:32:13 +01:00
Matthieu Gautier d2e6b2a916 Remove scripts to compile android custom app. 2019-12-05 12:32:13 +01:00
Matthieu Gautier d4b2642eed Update README to compile kiwix-lib-app. 2019-12-05 12:32:13 +01:00
Matthieu Gautier a82d6430dc Remove support of kiwix-android and kiwix-custom-app. 2019-12-05 12:30:10 +01:00
Matthieu Gautier b6bbf9b098 Do not install gradle. Use gradlew script. 2019-12-05 12:30:10 +01:00
Kelson e602897e6b
Newest version of libcurl (#387) 2019-12-05 06:29:00 -05:00
Kelson 1eaa137af6 Try to redo kiwix-lib 8.2.1 for Bintray 2019-11-27 15:11:45 +01:00
Kelson ca929b6312 Try a new release of kiwix lib 2019-11-27 13:36:01 +01:00
Kelson d2be359632 New releases of kiwix-lib, kiwix-tools and kiwix-desktop 2019-11-26 11:56:34 +01:00
Kelson 8524dfab87 Release Kiwix Desktop 2.0 rc4 2019-11-26 11:15:28 +01:00
Kelson 07483c72a2 Fix a problem with kiwix-tools 2019-11-26 07:19:13 +01:00
Kelson be9ca6c639 Rebuild kiwix-tools based on new kiwix-lib 2019-11-26 05:44:50 +01:00
Kelson a753860c2c
travis-ci.org -> travis-ci.com 2019-11-26 02:41:17 +01:00
Kelson 0085a5c565 Revert "Bump-up Xapian to 1.4.14 (#382)"
This reverts commit f4f9f6f833.
2019-11-25 03:34:41 +01:00
Kelson f4f9f6f833
Bump-up Xapian to 1.4.14 (#382) 2019-11-24 07:37:39 -05:00
Kelson 5885673bca Bump-up kiwix-lib version to 8.2.0 2019-11-20 13:10:18 +01:00
Matthieu Gautier 26a7545b43 Rebuild kiwix-desktop. 2019-09-26 17:20:11 +02:00
Matthieu Gautier 4306103998 Package kiwix-desktop with QT 5.12 as we build it with 5.12 2019-09-26 17:19:11 +02:00
Matthieu Gautier a0b4c2b209 New version of libzim, kiwix-lib and kiwix-desktop. 2019-09-26 16:15:46 +02:00
Matthieu Gautier 874d0d50b6 Use version 6 of linuxdeployqt instead of continuous.
We know that version 6 works, use it instead of the continuous release as
we want to be sure to always compile the appimage.
2019-09-26 16:15:19 +02:00
Kelson ad78ae48c6
Move Kiwix Desktop to Qt 5.12 on Windows (#376) 2019-09-25 20:29:54 +03:00
Matthieu Gautier 9d5d62e96c
Fix exe_wrapper. (#372)
Fix exe_wrapper.
2019-09-19 18:55:00 +02:00
Matthieu Gautier 29be31ec03 Fix exe_wrapper.
This should be `exe_wrapper` not `exec_wrapper`.
2019-09-19 18:18:41 +02:00
Matthieu Gautier 18deca2230 New version of kiwix-lib 8.0.1 2019-09-17 16:30:20 +02:00
Matthieu Gautier 7480bc80d7 Fix appimage script. 2019-09-17 14:37:30 +02:00
Matthieu Gautier 97b6b8f792
Appimage fix (#371)
Appimage fix
2019-09-17 12:18:41 +02:00
Matthieu Gautier fe3e147d08 New release of kiwix-lib 2019-09-17 11:49:38 +02:00
Matthieu Gautier 813c6f8038 Fix rpath of kiwix-serve. 2019-09-17 11:43:22 +02:00
Matthieu Gautier 0d132ab6e3 Make create appimage script working on other system than debian/ubuntu.
Not all distro use `lib/x86_64-linux-gnu`
2019-09-17 11:43:06 +02:00
Matthieu Gautier c3cb4ab0c0 New release of kiwix-lib and kiwix-desktop. 2019-09-11 17:50:06 +02:00
Matthieu Gautier e221d0ea23 Fix installation of kiwix-tools in windows. 2019-09-11 17:45:02 +02:00
Matthieu Gautier 1e56864e4a New version of libzim and kiwix-lib. 2019-09-10 17:29:26 +02:00
Kelson 6b43f5ad48
Update libmicrohttpd to 0.9.66 (#365)
* Update libmicrohttpd to 0.9.66

* Proper Bash syntax highlighting
2019-09-06 15:54:44 +02:00
Matthieu Gautier deff7fe50e
Merge pull request #367 from kiwix/win32_fedora
Use fedora 30 to cross compile kiwix-tools.
2019-09-06 14:11:23 +02:00
Matthieu Gautier 00aced4649 Use fedora 30 to cross compile kiwix-tools. 2019-09-06 12:25:51 +02:00
Matthieu Gautier 4ef0327271
Build new version of dependencies (with new compilation option). (#366)
Build new version of dependencies (with new compilation option).
2019-09-05 15:15:32 +02:00
Matthieu Gautier 3a8151d841 Compile kiwix-tools for windows with a recent mingw. 2019-09-05 14:32:54 +02:00
Matthieu Gautier 766b2b532c Build new version of dependencies (with new compilation option). 2019-09-05 10:16:57 +02:00
Matthieu Gautier cb77de12ec
Win32 build (#309)
Win32 build
2019-09-04 21:02:14 +02:00
Matthieu Gautier cf9bd7ae11 Add few trace in travis/compile_all.py 2019-09-04 18:55:20 +02:00
Matthieu Gautier f2369c6819 Build project in debug by default instead of debugoptimized. 2019-09-04 17:10:44 +02:00
Matthieu Gautier ab1ade53e3 Do not copy kiwix-build in docker at creation but mount it at run.
As we mount the kiwix-build (source) directory at run, the docker images
are independent of the source. This will greatly reduce the number of
docker images we have to create.
2019-09-04 17:10:44 +02:00
Matthieu Gautier d86bf75315 Add a cause message to the StopBuild exception. 2019-09-04 17:00:29 +02:00
Matthieu Gautier 0f13d99159 Remove unnecessary win32 libs.
It seems that those libraries are not needed (anymore ?).
Even more, `msvcr100` makes `kiwix-serve` crash when printing messages
on stdout/stderr.

`msvcr100` lib is necessary for ICU, because the default mingw's `msvcr`
doesn't provide `_free_locale` and `_create_locale`.

Most recent versions of mingw fix this and we do not need them.
On debian (travis CI) we use a old version of mingw and we need to force
the use of `msvcr100`.
2019-09-04 17:00:29 +02:00
Matthieu Gautier bffce48861 New release of zimwriterfs.
Also build kiwix-lib 6.0.3.
2019-09-04 11:15:41 +02:00
Matthieu Gautier 563bd28197 Set KIWIXLIB_BUILDVERSION to generate the pom with the correct version. 2019-09-04 11:15:08 +02:00
Matthieu Gautier a7d15bbdb1 Merge tag '0.0.39' 2019-09-04 11:08:33 +02:00
Matthieu Gautier 8288da5d20 Smaller xenial docker image 2019-09-04 11:06:37 +02:00
Kelson c2cbbccebb Smaller Docker base image 2019-09-04 10:00:15 +02:00
Kelson 460f350c21 New kiwix-tools package with libkiwix 6.0.3 2019-09-04 07:58:21 +02:00
Matthieu Gautier 77da4821d3 New version. 2019-09-03 18:46:58 +02:00
Matthieu Gautier cde257e028
Use a build version to publish the windows release of kiwix-desk… (#364)
Use a build version to publish the windows release of kiwix-desktop.
2019-09-03 18:33:12 +02:00
Matthieu Gautier d63684975f Use a build version to publish the windows release of kiwix-desktop. 2019-09-02 18:13:08 +02:00
Matthieu Gautier 78187e9752 Merge tag '0.0.37' 2019-08-22 17:35:23 +02:00
Kelson 6b3a5657db Release kiwix-tools 3.0.1 2019-08-22 17:30:57 +02:00
Matthieu Gautier c2c715802d New version of libzim and kiwix-lib. 2019-08-22 16:07:38 +02:00
Matthieu Gautier 05be522ef4 Print response content in case we cannot upload artifact to bintray. 2019-08-22 14:32:18 +02:00
Matthieu Gautier 6bebdf89fc Use correct path to look for pom.xml 2019-08-22 11:02:32 +02:00
Matthieu Gautier ecb3befd23 Fix copy of android archive for upload. 2019-08-21 17:56:57 +02:00
Matthieu Gautier 7508846808 New version 6.0.1 of kiwix-lib
Rebuild only kiwix-lib, the change is only about android publication.
2019-08-21 15:53:21 +02:00
Matthieu Gautier a1ae713457
Do not generate the pom file in kiwix-build. (#362)
Do not generate the pom file in kiwix-build.
2019-08-21 15:43:25 +02:00
Matthieu Gautier 2e347b2b33 Do not generate the pom file in kiwix-build.
Now we generate the pom file in kiwix-lib side, we don't need to generate
it ourselves.
2019-08-21 14:27:24 +02:00
Matthieu Gautier 96785aa68a New versions of libzim, kiwix-lib and kiwix-tools. 2019-08-20 14:34:51 +02:00
Matthieu Gautier 20b47df244
Merge pull request #361 from kiwix/nowrapdownload_flatpak
Do not download gtest in flatpak.
2019-08-20 14:23:54 +02:00
Matthieu Gautier f80afdecbc Move to last version of libmicrohttpd.
Again.. 0dcaa28 move back to a previous version (probably a wrong rebase)
2019-08-19 18:42:01 +02:00
Matthieu Gautier bd43b9cb10 Do not download gtest in flatpak. 2019-08-19 17:02:44 +02:00
Emmanuel Engelhart b814b39c38 Release zimwriterfs 1.3.5 2019-08-16 10:13:48 +02:00
Emmanuel Engelhart 21f6ef557e Have to re-publish zimwriterfs 1.3.4 2019-08-12 16:02:32 +02:00
Matthieu Gautier 0f3d2b73b9
Merge pull request #360 from kiwix/new_dep
libmicrohttp is now a dependency of kiwix-lib, not kiwix-tools.
2019-08-10 21:32:55 +02:00
Matthieu Gautier 0dcaa28e35 libmicrohttpd is now a dependency of kiwix-lib, not kiwix-tools.
And we have to install libmicrohttpd on windows.
2019-08-10 19:44:10 +02:00
Emmanuel Engelhart 2e653428d3 Release zim-tools 1.0.4 2019-08-10 15:59:25 +02:00
Matthieu Gautier e2346a5f23 Build of new release of zimwriterfs. 2019-08-05 17:31:02 +02:00
Matthieu Gautier 64886b6a48 Merge tag '0.0.30' 2019-08-05 17:29:05 +02:00
Matthieu Gautier fc22437d84 Fix publication of kiwix-lib-app. 2019-08-05 16:33:29 +02:00
Emmanuel Engelhart 2f102c7450 Bump-up zimwriterfs to 1.3.4 2019-08-01 21:18:20 +02:00
Matthieu Gautier 4802629eea Force the build of kiwix-lib to republish the kiwix-lib-app. 2019-08-01 17:27:49 +02:00
Matthieu Gautier 85f3f17950
Merge pull request #358 from kiwix/fix_kiwix-lib-app
Use the name "kiwix-lib" for the source of "kiwix-lib-app".
2019-08-01 15:47:50 +02:00
Matthieu Gautier 07f8150eb6 Use the name "kiwix-lib" for the source of "kiwix-lib-app". 2019-08-01 14:57:06 +02:00
Matthieu Gautier f23a5a465b
Merge pull request #357 from kiwix/new_version
New version of kiwix-desktop
2019-08-01 14:23:40 +02:00
Matthieu Gautier 068f928dac New version of kiwix-desktop 2019-08-01 13:28:04 +02:00
Matthieu Gautier 67a5985324
Merge pull request #356 from kiwix/new_version
New version of kiwix-lib and kiwix-tools.
2019-07-31 17:11:02 +02:00
Matthieu Gautier 7c2527c38f Do not try to download subproject for libzim in flatpak. 2019-07-31 16:36:31 +02:00
Matthieu Gautier 3c1864c724 New version of kiwix-lib and kiwix-tools.
Also build libzim and zim-tools because build fails the last time.
2019-07-31 10:24:13 +02:00
Matthieu Gautier 750d60435f
Merge pull request #355 from kiwix/fix_deploy_bintray
We have to correctly search for information to deploy.
2019-07-30 17:31:18 +02:00
Matthieu Gautier 10448e5706 We have to correctly search for information to deploy.
- Define BINTRAY_ARCHIVES_DIR variable
- Correctly use find.
2019-07-30 16:33:47 +02:00
Matthieu Gautier c2c8b678eb
Merge pull request #352 from kiwix/new_version
Update version of libzim and zim-tools.
2019-07-30 10:49:08 +02:00
Matthieu Gautier 75865cf942 Update version of libzim and zim-tools. 2019-07-29 18:27:42 +02:00
Matthieu Gautier 8fe06e5442
Merge pull request #350 from kiwix/kiwix-serve_windows
Package kiwix-serve within kiwix-desktop.
2019-07-24 15:10:31 +02:00
Matthieu Gautier 7d659baa37 Package kiwix-serve within kiwix-desktop.
Now that kiwix-desktop use kiwix-serve to serve the content, we need to
compile and package kiwix-serve (kiwix-tools).
2019-07-24 11:17:39 +02:00
Matthieu Gautier 2994384d3a
Merge pull request #343 from kiwix/kiwix-lib_app
Kiwix lib app
2019-07-24 11:16:38 +02:00
Matthieu Gautier 9bbc3930ae Print the duration of each steps. 2019-07-24 10:25:52 +02:00
Matthieu Gautier daf93f2e2f Build kiwix-lib-app in the CI and publish the release version. 2019-07-24 10:25:52 +02:00
Matthieu Gautier 3a1cd6ddb2 Build the kiwix-lib android "application" in kiwix-build.
This is not a real application as it is dependency for kiwix-android.
But it a app in the sens that it is packaged for android build system.
2019-07-24 10:25:52 +02:00
Kelson 4c342c5b9d
Update libmicrohttpd to 0.9.65 (#347) 2019-07-23 14:55:34 +02:00
Matthieu Gautier 2cc58360f0
Merge pull request #338 from kiwix/ci_speed
Cache the flapak state dir to speed the build.
2019-06-27 19:01:35 +02:00
Matthieu Gautier 327b08206b Do not build the android apk in the CI.
Android apk will be build on the android ci.
2019-06-27 17:36:26 +02:00
Matthieu Gautier 2e204a0abe Cache the flapak state dir to speed the build. 2019-06-26 17:17:48 +02:00
Chris Li 50ba90e67c fix macOS cross build 2019-06-24 19:30:18 +02:00
Kelson 15eeb0bac8
Create FUNDING.yml 2019-06-22 07:56:57 +02:00
Matthieu Gautier af21b91fbd
Merge pull request #337 from kiwix/new_arch
New arch armv7a
2019-06-14 16:13:15 +02:00
Matthieu Gautier 4810b0240c Flush the log file.
This is to avoid mangling between the kiwix-build log (env variables, ...)
and the command log.
2019-06-14 14:13:18 +02:00
Matthieu Gautier 4868128551 Build for armeabi-v7a.
The main thing is to add the `-march` option when needed.
Ie, '-march=armv7-a` for arm.
Other compiler (arm64, x86, ...) don't support the march option so
we must not provide it.
2019-06-14 14:13:18 +02:00
Matthieu Gautier ef9755eff5 Remove android mips platforms
Also correctly rename Android classes.
2019-06-14 14:13:18 +02:00
Matthieu Gautier 92679b72a0 Fix typos in deploy.sh 2019-06-14 11:40:41 +02:00
Kelson d3b0d76726 Revert "update android sdk tools to 26.1.1"
This reverts commit 51029fe820.
2019-06-12 15:50:18 +02:00
Matthieu Gautier a85296d38b
Merge pull request #335 from kiwix/fix_git
Fix git
2019-06-12 15:24:58 +02:00
Matthieu Gautier e0eb5c4a38 Set the versions to rebuild kiwix-desktop release. 2019-06-12 13:55:06 +02:00
Matthieu Gautier 388ac6fdb9 Fix git clone
Clone using https (without ssh key) in the docker.
Push using git (with ssh key) in the travis host.
2019-06-12 13:55:06 +02:00
Kelson c76f2e7c51
Merge pull request #306 from kiwix/mhutti1/gradlew-upgrade
Gradle upgrade to 5.2
2019-06-03 07:40:11 +02:00
Isaac Hutt 06da96f85f Update gradle to 5.2 2019-06-03 06:26:28 +02:00
Kelson 12d087a1b9
Merge pull request #334 from kiwix/disable_xapian_backend_remote
Disable Xapian remote backend
2019-06-02 23:16:35 +02:00
Kelson 456537e188 Disable Xapian remote backend 2019-06-02 17:15:26 +02:00
Kelson 55cff4ef83
Merge pull request #333 from kiwix/soloturn/sdk-update
update android sdk tools to 26.1.1
2019-06-02 16:18:03 +02:00
soloturn 51029fe820 update android sdk tools to 26.1.1 2019-06-02 15:08:17 +02:00
Matthieu Gautier 750c6aada9
Merge pull request #330 from kiwix/fix_deploy
Fix deploy
2019-05-31 00:16:47 +02:00
Matthieu Gautier 629fccb327 Fix deploy
- Also deploy when we have DESKTOP_ONLY (because docker image doesn't
deploy anymore)
- Correctly get the list of git directory to push.
2019-05-30 18:13:22 +02:00
Matthieu Gautier b90f32e9bf
Merge pull request #329 from kiwix/new_versions
New version of zimwriterfs.
2019-05-30 16:23:51 +02:00
Matthieu Gautier cea7a83ba1 New version of zimwriterfs.
We also rebuild kiwix-desktop because last build's deployment fails.
2019-05-30 15:30:17 +02:00
Matthieu Gautier 854a21367a
Merge pull request #328 from kiwix/fix_git_deploy
Fix deployement of git repositories.
2019-05-29 15:18:31 +02:00
Matthieu Gautier 27e92724e7 Fix deployement of git repositories.
The git repositories to upload are in the $EXPORT_DIR/GIT.
So we need to move there before try to push them.
2019-05-29 14:08:33 +02:00
Matthieu Gautier a731cf43a3
Merge pull request #327 from kiwix/new_versions
Update to new versions.
2019-05-29 13:03:31 +02:00
Matthieu Gautier e64a12207d Update to new versions. 2019-05-29 12:15:02 +02:00
Matthieu Gautier ffcc784751
Merge pull request #326 from kiwix/appimage_less_verbose
Make the appimage creation less verbose.
2019-05-29 12:10:40 +02:00
Matthieu Gautier 3c4da32054 Make the appimage creation less verbose.
`verbose=3` is too verbose for travis. Travis kill our job because the log
is too long.
2019-05-29 10:25:59 +02:00
Matthieu Gautier b22734c8a9
Merge pull request #325 from kiwix/fix_appimage
Use `-unsupported-allow-new-glibc` option to package on bionic.
2019-05-28 18:21:29 +02:00
Matthieu Gautier 6e8c8fafb4 Use `-unsupported-allow-new-glibc` option to package on bionic. 2019-05-28 11:16:06 +02:00
Matthieu Gautier df9e269bc1
Merge pull request #324 from kiwix/fix_deploy
WIP add debug on deploy.
2019-05-28 09:56:04 +02:00
Matthieu Gautier def0163dfe Fix deployement of archive.
The user name in docker is `ci_builder` not `builder`.
2019-05-27 16:46:36 +02:00
Matthieu Gautier 83fa604613
Merge pull request #322 from kiwix/merge_dockerfiles
As appimage and flatpak use same ubuntu version, merge dockerfiles.
2019-05-13 19:24:54 +02:00
Matthieu Gautier 6306a4d31b As appimage and flatpak use same ubuntu version, merge dockerfiles.
- Use the same structure than xenial dockerfile.
- Do not try to deploy in the docker image as the deployement is made on
  the host.
- Use user `ci_builder` instead of `builder` as it make flatpak fail.
2019-05-13 17:02:39 +02:00
Matthieu Gautier 1ce4c11ec4
Merge pull request #321 from kiwix/artful_to_bionic
Move from artful to bionic.
2019-05-07 17:25:38 +02:00
Matthieu Gautier 5a0b7e0998 Move from artful to bionic.
EOL for artful is july 2018.
It seems that now, apt repository has been shutdown for artful.
It is time to move to a more recent ubuntu version.

Bionic is the oldest release for which QtWebEngine has been packaged.
2019-05-07 13:36:57 +02:00
Matthieu Gautier bc5f0a5050
Merge pull request #320 from kiwix/fix_deploy_build_docker
Do not try to deploy things when we are building docker images.
2019-05-07 13:18:46 +02:00
Matthieu Gautier bf5e378963 Do not try to deploy things when we are building docker images. 2019-05-06 18:32:41 +02:00
Matthieu Gautier 8fe54b9f96
Merge pull request #319 from kiwix/fix_deploy
Fix deployment of release and nightly.
2019-05-06 15:31:08 +02:00
Matthieu Gautier e031eced7c Fix deployment of release and nightly.
Docker image need to copy archive to deploy in the correct directory.
2019-05-06 14:34:25 +02:00
Matthieu Gautier 6eb4c5a8b6
Merge pull request #318 from kiwix/podman
Docker
2019-05-03 17:05:06 +02:00
Matthieu Gautier 0142dc94d4 [CI] Start to build flatpak first in the CI
The flatpak build is the longer job. By starting it in the first jobs,
we reduce a bit the total build time.
2019-05-03 10:52:14 +02:00
Matthieu Gautier 2b2dd9f118 Do not build the multi arch android app on pullrequest.
We already build on all android arch on specific job.
So no need to check recompile the same thing.
2019-05-03 10:52:14 +02:00
Matthieu Gautier 556095f893 Build android after all other build.
Because we need the android_<arch> build to be done before.
2019-05-03 10:52:14 +02:00
Matthieu Gautier 39d05d1b03 Do not build the base archive for android platform.
We already have a base archive per android_<arch> platform.
We don't need to create another archive that will mainly include the
content of the other archives.
2019-05-03 10:44:19 +02:00
Matthieu Gautier 19ac17a637 Build the docker images in a separated stage.
Images are push to kiwix/kiwix-build_ci
2019-05-03 10:43:50 +02:00
Matthieu Gautier 281adbd768 Build everything in a container.
Docker containers don't have the SSH_KEY so we need to copy
archives and git repo in a directory on the host and
launch deploy.sh script from there.
2019-05-02 17:44:56 +02:00
Matthieu Gautier f9d5e0aa21 Use an already made archive for the armhf toolchains instead of git clone.
First, we don't need to clone all the git repository, we only need a
sub-directory.
Secondly, as we the base_deps archives only archive the sub-directory,
subsequent run of kiwix-build in the ci will try to do a git update on
a non git repository.

By making ourselves a tar archive, we simplify the process.

The archive on download.kiwix.org has been made with :
`tar czf raspberrypy-tools.tar.gz raspberrypi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64`
`raspberrypi-tools` being a clone of `https://github.com/raspberrypi/tools`
commit sha is 5caa7046982f0539cf5380f94da04b31129ed521
2019-05-02 17:43:11 +02:00
Matthieu Gautier 318c524f4c Use our own server to store libmagic. 2019-04-30 15:28:21 +02:00
Matthieu Gautier d8288a94d5 Build on travis using xenial. 2019-04-16 17:16:36 +02:00
Matthieu Gautier 88bb9231ea
Merge pull request #314 from kiwix/new_release
New release of kiwix-tools
2019-04-16 14:39:09 +02:00
Matthieu Gautier 470d46cc00 New release of kiwix-tools 2019-04-16 14:32:44 +02:00
Matthieu Gautier ae32109f48
Merge pull request #312 from kiwix/new_releases
New release of projects
2019-04-15 19:09:40 +02:00
Matthieu Gautier 7306c02c5a New release of projects 2019-04-15 17:16:17 +02:00
Matthieu Gautier d8b780978b
Merge pull request #310 from kiwix/unordered-flatpak-manifest
fix unordered flatpak's manifest
2019-04-15 14:44:43 +02:00
luddens f090551d13 fix unordered flatpak's manifest
dictionnaries aren't ordered with python 3.5, OrderDict() fixes that.
2019-04-09 17:03:33 +02:00
Matthieu Gautier e7a8583d9e
Merge pull request #308 from kiwix/qt_build
Qt build
2019-04-02 13:44:27 +02:00
Matthieu Gautier 3022361d7e Add a list of package to install on fedora for qt. 2019-04-02 12:05:52 +02:00
Matthieu Gautier a282bd8ce3 Allow a list of packages to install to be set `True` to skip installation.
This can allow a dependency to be marked as installed even if there is
nothing to install.
2019-04-02 12:05:52 +02:00
Matthieu Gautier 9cd8fae632
Merge pull request #307 from kiwix/fix_win32_archive
Fix creation of win32 archives.
2019-04-02 10:23:44 +02:00
Matthieu Gautier 23a26ff8fc Fix creation of win32 archives.
The win platform starts with `win32_`, not `win-`.
2019-04-01 18:03:41 +02:00
Matthieu Gautier 250c20ced6
Merge pull request #304 from kiwix/new_release
New release
2019-03-19 18:48:51 +01:00
Matthieu Gautier 714eeb3bb9 New releases of projects. 2019-03-19 18:01:05 +01:00
Matthieu Gautier 5a3ccd287f Look for the correct SSH_KEY in the docker environment. 2019-03-19 17:18:17 +01:00
Matthieu Gautier 0a768a2aac
Merge pull request #298 from kiwix/flatpak_release
Flatpak release
2019-03-19 16:26:37 +01:00
Matthieu Gautier 4ac7fb1ed0 Notify by mail if build fails 2019-03-19 15:25:11 +01:00
Matthieu Gautier da30e11f6a Fix publication of release kiwix-desktop on windows. 2019-03-19 15:25:11 +01:00
Matthieu Gautier 74210ece52 Update flathub repository.
Push new flathub manifest and patches at each new release.
2019-03-19 15:25:11 +01:00
Matthieu Gautier 6200239bba Correctly use TRAVIS_BUILD_DIR in docker.
TRAVIS_BUILD_DIR is the directory of kiwix-build.
So we must correctly set it in docker as the directory is not the
same.
We don't need the TRAVISCI_SSH_KEY now as we are looking in the right
directory.
2019-03-19 15:25:11 +01:00
Matthieu Gautier 3b91babe2f Use a new constant variable KBUILD_SOURCE_DIR 2019-03-19 15:25:11 +01:00
Matthieu Gautier 9f77ddd6ee
Merge pull request #303 from kiwix/meson_0.49.2
Force the use of meson 0.49.2
2019-03-19 15:24:22 +01:00
Matthieu Gautier 49ee0ee92b Workaround for mesonbuild/meson#5097
Force the use of meson 0.49.2
2019-03-19 10:33:47 +01:00
Matthieu Gautier 44ae7ab4d9
Merge pull request #302 from kiwix/fix_release
Fix release
2019-03-06 19:12:55 +01:00
Matthieu Gautier 2970a2d445 Update to new version of lzma and get it from kiwix.org server.
It seems that the downloading of the archive stored on sourceforge
fails sometime.

Use the archive stored in our server (download.kiwix.org) instead.
And also move to the last version of lzma.
2019-03-06 10:24:09 +01:00
Matthieu Gautier b4d0e627c5 Add armhf toolschain in base_deps_archive. 2019-03-06 10:24:09 +01:00
Matthieu Gautier b130b85066 Add tmp.kiwix.org to known hosts. 2019-03-06 10:14:02 +01:00
Matthieu Gautier e04dd76ee0 Use specific release base deps archive when build release.
Base deps are not compiled the same between a release and debug build.
2019-03-06 10:14:02 +01:00
Matthieu Gautier 1341c8b401 Do not strip libraries in release_mode.
Meson use gcc's `-s` option to create the archive.
This option should make gcc meemic `ar` tool but in some version of gcc,
it seems there is a bug and the `-s` option is not taken into account.

See https://github.com/mesonbuild/meson/issues/4138

So, do not try to strip libraries. We will strip the final binaries anyway.
2019-03-04 13:53:26 +01:00
Matthieu Gautier d31d9985c7
Merge pull request #300 from kiwix/new_release
New release
2019-02-22 11:51:44 +01:00
Matthieu Gautier 70fff445c0 Update version of kiwix-lib and kiwix-tools.
Rebuild also libzim as we were wrongly packaging the archive.
2019-02-22 11:21:50 +01:00
Matthieu Gautier c2bb79941a Update to last version of linuxdeployqt.
linuxdeployqt now try to get the version of the appimage and include it
in the appimage name.

Let's specify the version and use the correct (new) appimage name.
2019-02-22 10:57:08 +01:00
Matthieu Gautier 40b8bd0d19 Include subdirectory in the libzim release archive.
Header are in the `include/zim` directory but also in `include/zim/creator`
2019-02-22 10:43:46 +01:00
Matthieu Gautier 884c9368fb
Merge pull request #299 from kiwix/update_version
Update to new version 4.0.5 of libzim.
2019-02-21 16:54:35 +01:00
Matthieu Gautier 0940a17596 Update to new version 4.0.5 of libzim. 2019-02-21 15:51:55 +01:00
Matthieu Gautier 63844cc13c
Merge pull request #297 from kiwix/appimage_fix
Fix creation of appimage.
2019-02-20 11:31:37 +01:00
Matthieu Gautier c8285a371d Fix creation of appimage.
Now that issue probonopd/linuxdeployqt#340 is fixed with a new option
`-unsupported-allow-new-glibc`, we can revert commit 4329629f
2019-02-20 09:47:45 +01:00
Matthieu Gautier f296f59a68
Merge pull request #296 from kiwix/release_build
Build in release mode.
2019-02-20 09:39:47 +01:00
Matthieu Gautier 03c2c26089 Add LOGS dir to the dependencies archives.
This will help to debug.
2019-02-19 17:23:14 +01:00
Matthieu Gautier 505961be4c Build in release mode.
- Dependency are installed "striped".
- Our project are build "debugoptimized" by default and "release" when
  building release instead of "debug"

We need to update the `base_deps_meta_version` as we are changing how
dependencies are compiled.
2019-02-19 17:23:14 +01:00
Matthieu Gautier b43bf31c3c
Merge pull request #295 from kiwix/new_xapian
Use xapian 1.4.10 insteal of 1.4.7
2019-02-19 10:03:46 +01:00
Matthieu Gautier f2c3a8a4f6 Add a patch to allow compilation of xapian on android. 2019-02-18 17:02:13 +01:00
Matthieu Gautier 5a404438f7 Fix creation of deps archive. 2019-02-18 15:17:34 +01:00
Matthieu Gautier 6a1fdb8620 Use xapian 1.4.10 insteal of 1.4.7
Fix #264
2019-02-18 14:32:45 +01:00
Matthieu Gautier f107fa2eb1
Merge pull request #294 from kiwix/better_file_export
Better of export of file (release and nightly)
2019-02-18 14:28:49 +01:00
Matthieu Gautier f3ba9346ac Also create the archive in PR.
This way we are testing that archives are well done in the PR, not
after the merge.
2019-02-18 11:29:42 +01:00
Matthieu Gautier 4230ece400 Better of export of file (release and nightly)
As we are exporting libzim, we also need to export header files.
So now, we are using glob to get the list of file to add to the archive.

Fix openzim/libzim#199
2019-02-18 10:29:38 +01:00
Matthieu Gautier a3d7d9950c
Merge pull request #292 from kiwix/deps_archive_xz
[TRAVIS] Use xz compression to create the deps archives.
2019-02-07 11:30:27 +01:00
Matthieu Gautier 77fc6704ef Do not save the `tools` directory of the toolchains.
This directory came from the source and is only used to install the
sdk. As the sdk is already installed, we don't need it (and we can save
400Mo)
2019-02-06 16:51:42 +01:00
Matthieu Gautier ffc9c1b640 [TRAVIS] Use xz compression to create the deps archives. 2019-02-06 15:28:25 +01:00
Matthieu Gautier 1d81de88ce
Merge pull request #291 from kiwix/fix_libzim_deploy
We need to deploy the real lib, not the symlink to it.
2019-02-06 11:40:00 +01:00
Matthieu Gautier fa3343dd97 We need to deploy the real lib, not the symlink to it.
`libzim.so` is a symlink to `libzim.so.4`, who is also a symlink to
`libzim.so.4.0.4`.
2019-02-06 10:24:22 +01:00
Matthieu Gautier 14a65ae6e8
Merge pull request #290 from kiwix/mhutti1/dep-update
Increase dependency version number
2019-02-06 10:23:42 +01:00
Matthieu Gautier 6fd7d77ff1 [TRAVIS] Print progress while we are downloading base_dep archives. 2019-02-05 19:01:32 +01:00
Matthieu Gautier 72b1f5c2ef [TRAVIS] Android build cannot fail anymore. 2019-02-05 16:23:36 +01:00
Matthieu Gautier 8d13ef673a Update the list of android packages to install. 2019-02-05 16:22:09 +01:00
Isaac Hutt f73187f7c9 Update gradle dependency 2019-02-05 16:22:09 +01:00
Isaac Hutt 4ca0a43325 Increase dependency version number 2019-02-05 16:22:09 +01:00
Matthieu Gautier 44cda40358
Merge pull request #289 from kiwix/mix_platform
Mix platform
2019-02-04 17:48:27 +01:00
Matthieu Gautier 68902b5642 Build libzim in native_mixed platform on travis. 2019-02-04 17:01:28 +01:00
Matthieu Gautier 0ad24e9656 Do not use system's static zlib.
The system's static zlib is compiled without `-fPIC` but we need it
to build the mixed libzim.
2019-02-04 17:01:28 +01:00
Matthieu Gautier 4eb95fd4cc Pass correct option `-Dstatic_linkage` to libzim in native_mixed platform.
In native_mixed, we want to build a shared lib but we need to compile
with the static lib of the dependencies.
2019-02-04 17:01:28 +01:00
Matthieu Gautier 466dc8b64a Fix `-fPIC` CXXFLAGS. 2019-02-04 17:01:28 +01:00
Matthieu Gautier c9210bb0e0 Allow kiwix-build to build shared libs linked statically with deps.
We need to be able to build libzim as shared lib while using all
other dependencies statically (to not have libxapian.so, ... to distribute)

This add a new platform (static=False) that make all dependencies being
build in a static platform.
2019-02-04 17:01:28 +01:00
Matthieu Gautier 1b2b3efb54 Allow the platform itself to set on which platform we need to build the dep
For some complex build, we may want to build a dependency on another
platform that the target platform.
2019-02-04 17:01:28 +01:00
Kelson ef4cf7ada7
Merge pull request #288 from kiwix/mhutti1/gradle-update-1
Update Gradle Version
2019-02-04 06:57:51 +01:00
Isaac Hutt 90460e8100
Update Gradle Version 2019-02-03 23:46:55 +00:00
Matthieu Gautier 2aee71075e
Merge pull request #286 from kiwix/fix_flatpak
Fix flatpak
2019-01-29 16:55:30 +01:00
Matthieu Gautier b985becf4b Update versions 2019-01-29 14:18:15 +01:00
Matthieu Gautier c61570fc08 [flatpak] Add the exact commit sha in the manifest.
As requested here
https://github.com/flathub/flathub/pull/768#discussion_r245727043

See flathub/flathub#768
2019-01-23 18:25:22 +01:00
Matthieu Gautier 50167460dc Move the version of org.kde in the versions.py file. 2019-01-23 16:04:02 +01:00
Matthieu Gautier 4dfcd4aefb
Merge pull request #213 from kiwix/last_meson
Use last version of meson.
2019-01-23 14:25:25 +01:00
Matthieu Gautier b2d2e489bf [iOS] Use the correct option `b_bitcode` for libzim and kiwix-lib. 2019-01-17 16:50:49 +01:00
Matthieu Gautier 8ffbac9734 [Travis] Install the last version of meson. 2019-01-17 15:36:32 +01:00
Matthieu Gautier 681c5b4ec2 [Travis] Use python3.5 instead of default python3.4
Python3.5 add functionnality we need in kiwix-build.
And recent versions of meson need python3.5.
2019-01-17 15:36:32 +01:00
Matthieu Gautier 2ab9f2679b
Merge pull request #285 from kiwix/fix_travis
Fix travis
2019-01-15 17:09:36 +01:00
Matthieu Gautier 4160673c3a Correctly raise StopBuild in case of error when building flatpak. 2019-01-15 14:50:06 +01:00
Matthieu Gautier c4a3da03c3 Correctly install mustache in flatpak.
We need a simple buildsystem to "build" mustache" as we simply need to
copy the header.
2019-01-15 14:44:02 +01:00
Matthieu Gautier 961076bb87 [ANDROID] Build only the apk, not everything.
It seems that build everything on android side is a bit too expensive.
Let's do as is done on android CI, build only the apk.
2019-01-15 11:26:11 +01:00
Matthieu Gautier 4329629f97 [Travis] Allow the desktop appimage build to fail.
`linuxqtdeploy` recently add a test on the running system (libc version)
and refuse to run if the libc is too recent.
So we would need to run `linuxqtdeploy` only on ubuntu 14.04.
However, we also need `qtwebengine5-dev` package whom is available only
since ubuntu 18.04.

While we find a solution (see comments in the linuxdeployqt issue), we
have to allow the appimage build to fail.

See probonopd/linuxdeployqt#340
2019-01-15 11:16:48 +01:00
Matthieu Gautier 12614facce
Merge pull request #284 from kiwix/add_missing_import_i586
Add missing import of pj in i586 platform
2019-01-11 13:44:05 +01:00
Matthieu Gautier f844832c87 [Appveyor]Add include directory for mustache in kiwix-lib. 2019-01-11 11:28:41 +01:00
Matthieu Gautier 4f2786a031 Add missing import of pj in i586 platform 2019-01-10 16:50:47 +01:00
Matthieu Gautier e7860f986d
Merge pull request #283 from kiwix/cross_compile_include_dir
Add the include dir in the meson_cross_file.
2019-01-10 10:57:15 +01:00
Matthieu Gautier 1d881d0612 Add the include dir in the meson_cross_file.
This is needed to have kiwix-lib find the `mustache.hpp` include when
cross compiling.
2019-01-09 18:29:58 +01:00
Matthieu Gautier 17c6b68a62
Merge pull request #282 from kiwix/mustache
Remove ctpp2 dependency.
2019-01-09 15:04:20 +01:00
Matthieu Gautier 879a7294b9 Create the directory containing the skip_file if needed. 2019-01-09 11:46:16 +01:00
Matthieu Gautier 1a0e0ad717 Update to last version of libmagic (5.35) 2019-01-09 11:17:41 +01:00
Matthieu Gautier 8005aff6c0 Remove ctpp2 dependency.
kiwix-lib doesn't use ctpp2 anymore but mustache.
So remove ctpp2 dependency and add mustache.
2019-01-09 11:17:41 +01:00
Matthieu Gautier c12988a811
Merge pull request #280 from kiwix/fix_desktop_file_name
Fix desktop file name
2018-12-21 15:39:46 +01:00
Matthieu Gautier b6833eddac Force rebuild of kiwix-desktop release to have the appimage. 2018-12-21 14:32:33 +01:00
Matthieu Gautier 8f5df26a68 The name of the desktop file is now `org.kiwix.desktop.desktop` 2018-12-21 14:30:36 +01:00
Kelson 15b9b15e3c
Merge pull request #277 from kiwix/update_request_module
Update Python request to 2.20.0
2018-12-15 15:59:13 +01:00
Kelson 214a38d27f Update Python request to 2.20.0 2018-12-15 13:44:30 +01:00
Matthieu Gautier e78681dbbd
Merge pull request #276 from kiwix/update_flatpak
Update flatpak and new versions
2018-12-15 13:31:00 +01:00
Matthieu Gautier c776ca9a80 Udpate versions. 2018-12-14 17:00:39 +01:00
Matthieu Gautier 2980075ce0 Update flatpak_builder to new version of kiwix-desktop
- app-id is now ork.kiwix.desktop
- No need to rename the desktop-file
- `--filesystem=xdg-data` is useless.
2018-12-14 17:00:39 +01:00
Matthieu Gautier c0c907bb92
Merge pull request #275 from kiwix/fix_flatpak
Fix flatpak
2018-12-13 18:05:18 +01:00
Matthieu Gautier f9610ce3b3 Move the `sources` at the end of the modules.
It is the usage to have `sources` attribute at the end of the module
definition in flatpak manifest. Let's follow it.
2018-12-12 11:31:50 +01:00
Matthieu Gautier ac0685877b Do not keep "empty" modules (without sources).
`org.kde` dependency has no source. It used by kiwix-build to install the
correct sdk/platform.
2018-12-12 11:30:04 +01:00
Matthieu Gautier abf0e639e1 The manifest file must be named as the app-id. 2018-12-12 11:28:08 +01:00
Matthieu Gautier e11247c18a `builddir` is already default to True for meson. 2018-12-12 11:25:02 +01:00
Matthieu Gautier 6b5df23b03 `no-autogen` is already default to false.
We don't need to add it by default.
2018-12-12 11:24:40 +01:00
Matthieu Gautier 17a786092a Do not set unused configure options in flatpak. 2018-12-12 11:19:07 +01:00
Matthieu Gautier 4574a1cfed
Merge pull request #273 from kiwix/new_versions
New versions
2018-12-03 13:30:12 +01:00
Matthieu Gautier 71e31c54e5 update version of kiwix-lib and kiwix-desktop 2018-12-03 11:23:37 +01:00
Matthieu Gautier c0daff60bd Include zimcheck in the zim-tools archives
Fix openzim/zim-tools#26
2018-12-03 11:19:36 +01:00
Matthieu Gautier 62eb6acd85
Merge pull request #270 from kiwix/flatpak
Flatpak bis
2018-11-30 13:28:18 +01:00
Matthieu Gautier 9679c01254 Run docker with all privileges. 2018-11-30 11:37:23 +01:00
Matthieu Gautier 92d637ad99 Better flatpak build.
- Print the name of the module instead of the builder.
- Do not try to build the kiwix-desktop dependencies in the flatpak.
- Correct the path of the created flatpak.
2018-11-30 11:37:23 +01:00
Matthieu Gautier f96ae19c88 Disable websocket support in aria2.
We don't need it. It could speed up a bit the compilation.
2018-11-30 11:37:23 +01:00
Matthieu Gautier 703cac1f70 Do not compile libcurl in flatpak. 2018-11-30 11:37:23 +01:00
Matthieu Gautier 5d7972f037
Merge pull request #271 from kiwix/new_server
Update upload script to new server user "ci".
2018-11-30 11:36:55 +01:00
Matthieu Gautier 827c963895 Update upload script to new server user "ci".
On new server, the user `nightlybot` as been renamed to `ci`.
The path of the data used by the download server has also changed.
2018-11-30 11:08:33 +01:00
Matthieu Gautier b2a6ca7950
Merge pull request #269 from kiwix/flatpak
Flatpak
2018-11-27 18:03:20 +01:00
Matthieu Gautier f41a0dccdb Get base dependencies only if we are not building a flatpak. 2018-11-27 17:22:47 +01:00
Matthieu Gautier ce540ca280 Update creation of appImage to the new location of kiwix-desktop.desktop. 2018-11-27 17:22:47 +01:00
Matthieu Gautier ecf3b8b1ff Add an option `--asume-packages-installed` to not try to install packages.
This is different than `--dont-install-packages` that will try to
compile the dependencies.

`--asumme-packages-installed` will no try to install packages, but will
not try either to compile dependencies.
2018-11-27 17:22:47 +01:00
Matthieu Gautier 086361b432 Build the flatpak in travis.
Use docker to have the last version of ubuntu (and flatpak)
2018-11-27 17:22:47 +01:00
Matthieu Gautier a3ce2e0126 Fix the flatpak manifest.
- Rename the .desktop file and the icons for desktop integration.
- Fix finish-args for the right permissions
- Remove curl binary, not aria2c.
2018-11-27 17:22:47 +01:00
Matthieu Gautier a18c28b168 Build the flatpak as user, not system. 2018-11-27 17:22:47 +01:00
Matthieu Gautier feec272d1f Use the correct key `app-id` instead of `id`. 2018-11-27 17:22:47 +01:00
Matthieu Gautier 833c5844a1 Use the right option to build kiwix_desktop and pugixml on flatpak. 2018-11-27 17:22:47 +01:00
Matthieu Gautier ed63ffe24c Add aria2 dependency.
kiwix-desktop needs the aria2 binary to download content.
kiwix-desktop will use aria2 throw lib-kiwix so it is somehow a kiwix-lib
dependency, but it is used only by kiwix-desktop.

And we know to install it only on platforms where we are supporting
kiwix-destkop.
2018-11-27 17:22:47 +01:00
Matthieu Gautier d375cc06bc Do not try to compiled dependencies already in the org.kde.Platform. 2018-11-27 10:11:08 +01:00
birros 8d58d8d7cb First version of a flatpak builder.
This commit add a first version code to build a flatpak of kiwix-desktop.
It is mainly based on the PR #254 of @birros (hence he is the author of this commit)

However there is some differences :
- I (@mgautier) create a new builder to run the flatpak build instead of using a new
  dependency.
- Use the flatpak platform to install org.kde.Platform and org.kde.Sdk

This code version doesn't correctly work but I wanted to commit the birros' code
without too many modification (even if there is a lot).
2018-11-27 09:43:52 +01:00
Matthieu Gautier 0b9f13a2f0 Create a property in the remotefile to get the correct url. 2018-11-14 11:08:44 +01:00
Matthieu Gautier 22f1693335 Merge remote-tracking branch 'origin/master'
I forget to fetch before pushing the 0.0.14 tag :/
2018-11-14 10:59:11 +01:00
Matthieu Gautier 054f7802d0 Update version of kiwix-lib and kiwix-tools. 2018-11-12 16:54:44 +01:00
Kelson f080c750b6
Merge pull request #268 from kiwix/new_tmp_server
New tmp.kiwix.org server
2018-11-07 16:16:37 +01:00
Kelson 70301d4723 New tmp.kiwix.org server 2018-11-07 03:51:13 +01:00
Kelson e5be404697
Merge pull request #266 from kiwix/new_download_zim_server
New Travis config for new openzim download server
2018-11-03 17:23:04 +01:00
Kelson d9ef792172 Update Travis for new download server 2018-11-03 14:38:46 +01:00
Matthieu Gautier 500e2c1e02 update version of kiwix-lib and kiwix-desktop 2018-11-03 12:35:12 +01:00
Matthieu Gautier 1b7a40ea97 Fix create appimage 2018-11-02 17:58:18 +01:00
Matthieu Gautier 85f0d4ccb1 Update version of kiwix-lib and kiwix-desktop. 2018-11-02 17:37:02 +01:00
Matthieu Gautier e0de6e90d0
Merge pull request #265 from kiwix/package_aria2_linux
Add aria2 in the appimage.
2018-11-02 17:11:02 +01:00
Matthieu Gautier f4ff820eda Add aria2 in the appimage. 2018-11-02 11:56:00 +01:00
Matthieu Gautier 1440dd8b25 Update version of kiwix-lib, kiwix-tools and kiwix-desktop. 2018-10-31 17:20:24 +01:00
Matthieu Gautier 237e4d860d
Merge pull request #262 from kiwix/build_libcurl
Force the build of libcurl instead of using system one.
2018-10-31 17:19:50 +01:00
Matthieu Gautier c47bad8c74 Try to cache appveyor dependencies. 2018-10-31 15:42:15 +01:00
Matthieu Gautier 00b7e0f1f8 [AppVeyor] Add Aria2. 2018-10-31 15:40:53 +01:00
Matthieu Gautier 845cdffdba [AppVeyor] Compile kiwix-desktop using static lib when possible. 2018-10-31 15:38:32 +01:00
Matthieu Gautier 97f6c076c4 [AppVeyor] Build curl in appveyor. 2018-10-31 15:37:24 +01:00
Matthieu Gautier 0600be96ac Force the build of libcurl instead of using system one.
On ubuntu, the libcurl package is compiled with libkrb (kerberos).
However, no libkrb5.a is provided and so, we cannot link statically.

As we are not using kerberos, we can (and must) compile ourselves libcurl.
2018-10-31 15:33:12 +01:00
Matthieu Gautier 5a97ec28ca
Merge pull request #253 from kiwix/libcurl
Add libcurl dependency.
2018-10-23 15:41:19 +02:00
Matthieu Gautier 7963fd464a [AppVeyor] Update to last version of meson
Last version of meson (0.48.0) install meson a differently on Windows.
Now, a `meson.exe` is installed, so, we must launch `meson` instead of `meson.py`.
2018-10-23 14:30:24 +02:00
Matthieu Gautier 1e67a6b50f Add libcurl dependency.
This is needed for new kiwix-lib version.
We also remove libaria as kiwix-lib use aria2 binary directly.
2018-10-23 11:57:58 +02:00
Matthieu Gautier b3a3d0399f Last version of travis osx already have a python 3.6 installed. 2018-10-23 11:57:58 +02:00
Kelson 3a05f8e35b
Merge pull request #255 from kiwix/xapian_1.4.7
Move to Xapian 1.4.7
2018-09-22 10:52:23 +02:00
Kelson e9ae0da048 Move to Xapian 1.4.7 2018-09-20 18:27:30 +02:00
Kelson 401e01b953
Merge pull request #256 from SzymonPajzert/patch-1
Update README.md to use HTTPS in git clone
2018-09-17 12:25:22 +02:00
Szymon Pajzert 44b8ebdfde
Update README.md to use HTTPS in git clone 2018-09-17 09:38:40 +02:00
Matthieu Gautier 683582b5e4
Merge pull request #252 from kiwix/version_no_release
Do not set version for main project if we are not making release.
2018-09-06 20:33:38 +02:00
Matthieu Gautier 1569068332 Do not set version for main project if we are not making release. 2018-09-06 16:10:43 +02:00
Matthieu Gautier 691dab52be
Merge pull request #251 from kiwix/fix_deploy
Fix deploy
2018-09-05 20:44:58 +02:00
Matthieu Gautier ecc6927de8 Use git archive to create dist source archive.
qmake seems to generate wrong "dist" rules for "make".
It try to copy the translation files as if it was in current directory
instead of looking the source dir.

dist archive is usefull with autotools where we want to run autogen before.
Or with meson when meson run tests before making the archive.

With qmake, it seems useless, let's simply archive what is git.
2018-09-05 19:38:58 +02:00
Matthieu Gautier df0b684869 Correctly find the version of a dependency.
We have separated the version in two separated dicts since a long time :/
2018-09-05 19:31:38 +02:00
Matthieu Gautier a91d85fa41
Merge pull request #250 from kiwix/new_version
Update version of libzim and kiwix-desktop.
2018-09-05 18:06:54 +02:00
Matthieu Gautier e988165282 Update version of libzim and kiwix-desktop. 2018-09-05 16:56:46 +02:00
Matthieu Gautier 2686d74a78
Merge pull request #248 from kiwix/extra_build_version
Do not overwrite release build archives.
2018-09-04 18:34:39 +02:00
Matthieu Gautier 07e8b36efb Do not overwrite release build archives.
We new release of a project is made, projects dependending of it are
rebuild and republish to keep the binaries up-to-date.

To avoid overwrite the already build archives and silent the fact that
new archives are available, we need to have a extra build version.

`release_versions[project]` has to be set each time a dependency of
`project` is bump but the project version has not changed.

If the `project` version changes, the `release_versions[project]`
has to be cleared.

If we don't want to release this version again, remove project from
`release_versions`.

See kiwix/kiwix-tools#222
2018-09-04 17:56:01 +02:00
Matthieu Gautier d4b393727e
Merge pull request #247 from kiwix/update_versions
Update version of kiwix-tools to 0.6.1.
2018-08-30 16:56:24 +02:00
Matthieu Gautier aed1194570 Update version of kiwix-tools to 0.6.1. 2018-08-30 16:04:28 +02:00
Matthieu Gautier 67033ae060
Merge pull request #246 from kiwix/msvcr100
Use the more recent msvcr100 instead of msvcr90.
2018-08-28 18:33:18 +02:00
Matthieu Gautier 095eec303a Use the more recent msvcr100 instead of msvcr90. 2018-08-28 16:42:06 +02:00
Matthieu Gautier e77747a564
Merge pull request #245 from kiwix/win_zip_deflated
Use the ZIP_DEFLATED compression when creating zip archive.
2018-08-28 16:28:44 +02:00
Matthieu Gautier b16213b1c0 Use the ZIP_DEFLATED compression when creating zip archive.
The building Windows zip decompressor handles only DEFLATED.
2018-08-28 14:56:56 +02:00
Matthieu Gautier c75fd9b85c
Merge pull request #242 from kiwix/new_version
Update versions of libzim and kiwix-desktop.
2018-08-24 16:11:11 +02:00
Matthieu Gautier 91f282d8f2 Update versions of libzim and kiwix-desktop. 2018-08-24 15:35:01 +02:00
Matthieu Gautier b00429b701
Merge pull request #243 from kiwix/no_mips
Do not build for mips and mips64 by default.
2018-08-22 17:18:55 +02:00
Matthieu Gautier 3b483f9011 Do not build for mips and mips64 by default. 2018-08-22 16:44:53 +02:00
Matthieu Gautier bd33238d60
Merge pull request #241 from kiwix/default_platform_custom_app
Default platform custom app
2018-08-20 17:53:48 +02:00
Matthieu Gautier 6f291b1c86 Set the default platform to `android` for `kiwix-android-custom` project.
Fix #206
2018-08-20 11:18:01 +02:00
Matthieu Gautier 81612c2f2c Set the default option in the method parsing arguments, not in the builder. 2018-08-20 11:16:33 +02:00
Matthieu Gautier 54458ccb0a
Merge pull request #238 from kiwix/fix_src_path
Fix the src path of kiwix-desktop when doing release.
2018-08-06 11:31:03 +02:00
Matthieu Gautier 22a580d070 Fix the src path of kiwix-desktop when doing release.
kiwix-build add `_release` postfix, not the version number.
2018-08-06 10:49:53 +02:00
Matthieu Gautier 1948b109e2
Merge pull request #236 from kiwix/correct_src_path
Use the correct source path of kiwix-desktop when doing release.
2018-08-06 10:04:00 +02:00
Matthieu Gautier cad38f8a53 Use the correct source path of kiwix-desktop when doing release. 2018-08-06 09:24:29 +02:00
Matthieu Gautier 58ca125d32
Merge pull request #235 from kiwix/export_env_in_docker
Export TRAVIS_TAG env var in docker
2018-08-05 22:55:18 +02:00
Matthieu Gautier d91f40b467 Export TRAVIS_TAG env var in docker 2018-08-05 20:00:14 +02:00
Matthieu Gautier 02712cc9e4
Merge pull request #234 from kiwix/release_desktop
[Travis] Also build kiwix-desktop when building for release.
2018-08-05 19:08:34 +02:00
Matthieu Gautier f51204d424 [Travis] Also build kiwix-desktop when building for release. 2018-08-04 09:06:38 +02:00
Matthieu Gautier 0a6adf762b
Merge pull request #233 from kiwix/new_version
New version
2018-08-03 23:44:33 +02:00
Matthieu Gautier a64fd8cd20 New versions. 2018-08-03 19:34:50 +02:00
Matthieu Gautier b910a7b720 [AppVeyor] No more windows branch for kiwix-lib. 2018-08-03 19:34:50 +02:00
Matthieu Gautier 05290ec859
Merge pull request #232 from kiwix/fix_appimage
Fix appimage
2018-08-03 16:34:57 +02:00
Matthieu Gautier 05c0a691ec Insert lowlevel libraries in the appimage.
May fix kiwix/kiwix-desktop#14
2018-08-03 15:53:13 +02:00
Matthieu Gautier c256857e01 Create the app image using the ".appimage" extension.
Fix kiwix/kiwix-desktop#19
2018-08-03 15:53:13 +02:00
Matthieu Gautier afc6bf0907 Add svg icon support into the appimage
- Add missing packages in Dockerfile to support svg icons.
- Include needed plugins in the appimage.
2018-08-03 15:53:13 +02:00
Matthieu Gautier 0d3ea8eaa5 Use the kiwix.desktop file and the icon in the kiwix-desktop sources.
No need anymore to generate one or take a random image.
2018-08-03 15:52:50 +02:00
Matthieu Gautier 2024dae4c8
Merge pull request #231 from kiwix/android_no_header_mmap
Do not use buffered header on android.
2018-08-01 19:33:03 +02:00
Matthieu Gautier e22ceab92a Do not use buffered header on android.
Android devices are low memory devices, use last libzim compilation option
to avoid copy/mmap index header in memory.
2018-08-01 18:07:13 +02:00
Matthieu Gautier 66c79e2aac
Merge pull request #229 from kiwix/no_libzim_windows_branch
`libzim`'s branch window has been merged in master.
2018-07-31 09:10:51 +02:00
Matthieu Gautier 9d7e1af17f `libzim`'s branch window has been merged in master. 2018-07-30 20:54:06 +02:00
Matthieu Gautier b9479e8506
Merge pull request #228 from kiwix/appveyor_xapian_1.4.7
xapian 1.4.7
2018-07-27 14:09:05 +02:00
Matthieu Gautier de6ae772d4 Update to last vresion of xapian. 2018-07-27 10:46:00 +02:00
Matthieu Gautier b2bd19f484 Use last version of xapian instead of prerelease 2018-07-27 10:22:53 +02:00
Matthieu Gautier ec273f7b0e
Merge pull request #227 from kiwix/fix_sign
Sign the application after windeployqt.
2018-07-27 09:29:36 +02:00
Matthieu Gautier 6e396360a8 Sign the application after windeployqt.
windeployqt modify the executable, so we must sign it after.
2018-07-26 19:37:38 +02:00
Matthieu Gautier 013c3bd3ec
Merge pull request #226 from kiwix/sign_windows_app
Sign windows application in AppVeyor
2018-07-26 16:01:02 +02:00
Matthieu Gautier a4bdec74b4 Sign windows application in AppVeyor 2018-07-26 15:10:25 +02:00
Matthieu Gautier 81d9a96229
Merge pull request #225 from kiwix/fix_qt_version
Fix the path of AppVeyor Qt to be minor version independent.
2018-07-26 11:18:32 +02:00
Matthieu Gautier 968c6ecc44 Fix the path of AppVeyor Qt to be minor version independent.
AppVeyor may update minor version of Qt and change `5.11.0` to `5.11.1`.
If we use the path with the full version, it will break in the futur.

AppVeyor install a link `5.11` pointing to the last version, so let's use
it.
2018-07-26 10:28:21 +02:00
Matthieu Gautier 5876adbb69
Merge pull request #224 from kiwix/kiwix-custom-app
Fix compilation of kiwix-custom-app.
2018-07-19 17:02:58 +02:00
Matthieu Gautier 5c83ba9d10 Fix compilation of kiwix-custom-app.
This is forgotten dependency. Not updated when we moved to multi-arch
build.
Now, it is fixed.
2018-07-19 16:19:55 +02:00
Matthieu Gautier 3283bbe565
Merge pull request #222 from kiwix/no_window_branch_desktop
[AppVeyor] No windows branch for kiwix-desktop.
2018-07-17 17:35:28 +02:00
Matthieu Gautier 3e3513731e [AppVeyor] No windows branch for kiwix-desktop.
The `windows` branch has been merge. We should directly use `master` now.
2018-07-17 16:50:49 +02:00
Matthieu Gautier 1693a542ed
Merge pull request #221 from kiwix/app_veyor
Add basic kiwix-desktop build on AppVeyor.
2018-07-17 13:11:25 +02:00
Matthieu Gautier 2743f64ef8 Add basic kiwix-desktop build on AppVeyor.
This is somehow a side build system base on cmd scripts.
We should merge it in kiwix-build but... no time for now :/
2018-07-17 11:23:09 +02:00
Matthieu Gautier a17cdeba49
Merge pull request #220 from kiwix/travis_no_dep_archive_android
[TRAVIS] Do not make a deps archive when PLATFORM is android.
2018-07-16 19:27:49 +02:00
Matthieu Gautier 25af2cfa6c [TRAVIS] Do not make a deps archive when PLATFORM is android.
We never use the android platform in other project. We always an arch
specific android platform (android_arm).

So, do not try to do any dependencies archives there.
Especially if travis kill the job because it takes too long to create
the archive.
2018-07-16 18:31:50 +02:00
Matthieu Gautier eed1ddce4e
Merge pull request #219 from kiwix/readme_android_typos
[README] Fix typos in android section in the readme.
2018-07-16 18:23:35 +02:00
Matthieu Gautier 20994fa048 [README] Fix typos in android section in the readme. 2018-07-16 11:46:34 +02:00
Matthieu Gautier c4bd748d2c
Merge pull request #201 from kiwix/svn_export
Use faster svn export instead of svn checkout
2018-07-16 11:45:38 +02:00
Emmanuel Engelhart 79a08e001b Use faster svn export instead of svn checkout 2018-07-16 10:15:28 +02:00
Matthieu Gautier 87ef2b99f4
Merge pull request #218 from kiwix/archive_home_root
[TRAVIS] Allways use $HOME as relative path in dependencies archives.
2018-07-16 10:11:31 +02:00
Matthieu Gautier 56d897d8d8 [TRAVIS] Allways use $HOME as relative path in dependencies archives.
As we now move to multi-arch build, we may have things compiled natively
or "neutral" (as toolchains). So we cannot use the BASE_DIR as
relative_path because BASE_DIR is arch dependent.
2018-07-16 09:42:46 +02:00
Matthieu Gautier 9ab64220a3
Merge pull request #215 from kiwix/android_cache
[TRAVIS] Try to use arch specific base_deps when build android multi arch.
2018-07-13 14:43:12 +02:00
Matthieu Gautier bae484f7ae [TRAVIS] Print a '.' every 50 files added to an archive.
It will avoid travis-ci to kill the job because of the absence of output.
2018-07-13 11:51:00 +02:00
Matthieu Gautier 1a4267a887 Print a '.' every 30 seconds when running a command.
It will avoid travis-ci to kill the job because of the absence of output.
2018-07-13 10:39:18 +02:00
Matthieu Gautier 7391b54edf [TRAVIS] Try to use arch specific base_deps when build android multi arch.
Compiling all dependencies for all archs takes a too long time for travis.
By downloading the cache of specific android arch, we avoid to recompile
them.

Android will need kiwix-lib builder to build, so we cannot make the
target_only.
2018-07-13 10:39:18 +02:00
Matthieu Gautier e577efd612
Merge pull request #216 from kiwix/correct_decrypt_key
[TRAVIS] Correctly decrypt the ssh key
2018-07-11 17:15:15 +02:00
Matthieu Gautier cd0d075def Do not try to decrypt the ssh_key if we cannot.
If we are building a PR comming from a fork, the secret key will not
be available and we cannot decrypt the ssh key.

And if the ssh key cannot be decrypted, we should not try to use it to
upload base dependencies.

`cron` and deployement are made only on "secured environment" so we don't
need to test for existance of the key because we are sure that we have
been able to decrypt it.
2018-07-11 15:55:11 +02:00
Matthieu Gautier f5fdc70e84 Revert "Try to decrypt the secret key only if we will do a deployement."
`travis/compile_all.py` may need the secret key to upload dependencies
cache to our server.

So, just decrypt the key before the upload is not good enough (and breaks
PR building new version of base dependencies)

This reverts commit 74efad49e2.
2018-07-11 15:19:23 +02:00
Matthieu Gautier b846ae52a4
Merge pull request #212 from kiwix/allow_ext_PR
Try to decrypt the secret key only if we will do a deployement.
2018-07-11 14:35:37 +02:00
Matthieu Gautier 74efad49e2 Try to decrypt the secret key only if we will do a deployement.
Is a contributor do a PR from its own repository, we will try do decrypt
the key but fail because secret env var are not available.

We need the secret key only if we do a deployement and the deployement is
done only for a tag or a cron job.
2018-07-11 14:06:18 +02:00
Matthieu Gautier 362b70622f
Merge pull request #214 from kiwix/icu_tar_gz
Get icu sources from an archive instead of svn.
2018-07-11 14:04:10 +02:00
Matthieu Gautier 0f389f7cc9 Get icu sources from an archive instead of svn.
SVN checkout can be pretty long to do (especially if icu serveur is pretty
slow).

By downloading an archive on our own server, we avoid a spending too many
time downloading.

The archive is a simple targz of the SVN checkout.
2018-07-11 11:00:55 +02:00
Kelson edc200095e
Merge pull request #210 from kiwix/mhutti1/android-logging-link
Build with android logging library
2018-06-29 16:04:33 +02:00
mhutti1 20ac697d43 Build with android logging library 2018-06-29 15:26:54 +02:00
Kelson e6be76b7fc
Merge pull request #202 from kiwix/xapian_without_chert
Remove support of old Xapian chert backend
2018-06-24 22:10:16 +02:00
Emmanuel Engelhart ef2e95b42e Bump-up deps meta version to 9 2018-06-24 20:51:31 +02:00
Emmanuel Engelhart e90ff48ec9 Remove support of old Xapian chert backend 2018-06-24 20:51:31 +02:00
Kelson 8a15091a45
Merge pull request #205 from kiwix/app_image_cat
Categories=Education;
2018-06-24 13:26:35 +02:00
probonopd 3916b14aee Categories=Education;
Fixes https://github.com/kiwix/kiwix-build/issues/192#issuecomment-397818904
2018-06-24 11:44:24 +02:00
Matthieu Gautier 0eb8fd1ebb
Merge pull request #200 from kiwix/fix_deploy
Fix deploy
2018-06-20 15:47:50 +02:00
Matthieu Gautier 1ca7ab6a86 Do not try to deploy if we are running a Docker build.
The deploy will be made in the docker itself.
2018-06-20 15:13:39 +02:00
Matthieu Gautier 8b5715acff Revert "Do not deploy on native_dyn linux platform."
This reverts commit 8db9def67d.
2018-06-20 15:11:27 +02:00
Matthieu Gautier d0ecf70284
Merge pull request #196 from kiwix/fix_release_build_bis
[TRAVIS] Fix release dist.
2018-06-19 11:46:54 +02:00
Matthieu Gautier d5b81294ca [TRAVIS] Fix release dist.
- Correctly make dist.
- zimwriterfs is now using meson, we don't need a special case.
2018-06-19 10:39:07 +02:00
Matthieu Gautier aeffb90f1f
Merge pull request #195 from kiwix/fix_release_build
Fix release build
2018-06-18 19:25:23 +02:00
Matthieu Gautier d076c6b8d7 Do not set zimwriterfs version directly in the dependency.
The version is tracked in `kiwixbuild/versions.py`, so we must no set
it in `kiwixbuild/dependencies/zimwriterfs.py`.
2018-06-18 17:56:13 +02:00
Matthieu Gautier 37e2b709f8 [TRAVIS] Use target_only only if we are building in a cron.
The deps will be build only if we are in a cron.
In this case, we can directly build only the target.

But in other case, we have to build the target and its dependencies.
2018-06-18 17:54:44 +02:00
Matthieu Gautier c3cacb387f
Merge pull request #194 from kiwix/fix_typos_release
Fix a small typo breaking the release build process.
2018-06-18 16:32:06 +02:00
Matthieu Gautier fbb84f8df2 Fix a small typo breaking the release build process. 2018-06-18 14:17:06 +02:00
Matthieu Gautier 14f2de9664
Merge pull request #189 from kiwix/update_versions
Update to new versions of libzim, kiwix-lib, kiwix-tools, zim-tools, …
2018-06-15 22:09:46 +02:00
Matthieu Gautier d53f1aad4a Update to new versions of libzim, kiwix-lib, kiwix-tools, zim-tools, zimwriterfs. 2018-06-15 19:39:45 +02:00
Matthieu Gautier 1ad0b35987
Merge pull request #187 from kiwix/no_kiwix-desktop_travis_trusty
Do not try to compile kiwix-desktop on travis trusty
2018-06-15 17:07:35 +02:00
Matthieu Gautier c9c7d86ca8 Do not try to compile kiwix-desktop on travis trusty 2018-06-15 16:39:14 +02:00
Matthieu Gautier 9decfa6226
Merge pull request #186 from kiwix/docker_only_for_qt
Use Docker to build kiwix-desktop only.
2018-06-15 16:28:57 +02:00
Matthieu Gautier 37ebcf83ae Use Docker to build kiwix-desktop only.
Keep default travis env for everything else.
2018-06-15 15:57:57 +02:00
Matthieu Gautier 829ad7ca61
Merge pull request #185 from kiwix/fix_buildnodeps_crosscompile
Add toolchains steps even if we are building with `--build-nodeps`.
2018-06-14 23:28:39 +02:00
Matthieu Gautier b3d9ff5a6b Add toolchains steps even if we are building with `--build-nodeps`.
Toolchains are not really a deps, they have to be build everytime.
2018-06-14 22:58:43 +02:00
Matthieu Gautier 428fe7efa0
Merge pull request #184 from kiwix/native_gcc4.8
Native gcc4.8
2018-06-14 20:07:08 +02:00
Matthieu Gautier b090353001 Do not use the system ctpp2 in native_dyn debian.
The CI is using ubuntu artful and the deb package is compiled with another
compiler that gcc-4.8 (used in other project CI).

As we compile everything with gcc-4.8, we must compile our own ctpp2.
2018-06-14 18:18:46 +02:00
Matthieu Gautier 9ad07fe550 Travis, do not try to compile deps if not needed. 2018-06-14 18:18:46 +02:00
Matthieu Gautier 1cbfcef9ce Fix kiwix-desktop dependencies. 2018-06-14 18:18:45 +02:00
Matthieu Gautier eed80c1ff9 Correctly associate the source with the builder. 2018-06-14 18:18:45 +02:00
Matthieu Gautier 8506cdeffd Correctly pass CMAKE_* to qmake.
qmake doesn't use the env variables, we must pass the variables in the
command line.
2018-06-14 18:18:45 +02:00
Matthieu Gautier 4047ec20dd Add xapian patch to correctly include sys types. 2018-06-14 18:18:45 +02:00
Matthieu Gautier e441b847b5 Use gcc-4.8 to compile in Docker.
Other travis-CI will use the default gcc version of ubuntu trusty.
We must compile with the same compiler to ensure that we don't break ABI.
2018-06-14 14:53:16 +02:00
Matthieu Gautier 8b8d24d662
Merge pull request #183 from kiwix/no_kiwix-desktop_static
Do not try to compile kiwix-desktop on native_static.
2018-06-13 18:44:14 +02:00
Matthieu Gautier d74cd1d50a Do not try to compile kiwix-desktop on native_static.
QtWebEngine is not compatible with static compilation so we should not
try to compile kiwix-desktop on native_static.
2018-06-13 17:39:06 +02:00
Matthieu Gautier 5ba66db13d
Merge pull request #182 from kiwix/no_gcc
Do not build with gcc-5.
2018-06-13 12:34:49 +02:00
Matthieu Gautier 2a18f74786 Do not build with gcc-5.
We build with gcc-5 because of zimSplit using ofstream.swap method.
Latest version of zimSplit doesn't use it anymore so let's compile
everything with default gcc.

See openzim/zim-tools@a959609839

We also explicitly set the list of package to install per job, so
less packages are installed.
2018-06-13 10:57:32 +02:00
Matthieu Gautier 2f058d239b
Merge pull request #181 from kiwix/no_travis_deploy
Do not deploy on native_dyn linux platform.
2018-06-12 19:19:30 +02:00
Matthieu Gautier 8db9def67d Do not deploy on native_dyn linux platform.
The deployement is already made in the Docker.
"Classic" deploy will fail because there will be no archive to deploy.
2018-06-12 18:03:28 +02:00
Matthieu Gautier 69fce5923a
Merge pull request #176 from kiwix/desktop
Desktop
2018-06-12 18:02:53 +02:00
Matthieu Gautier 269e2b39a6 Build the kiwix-desktop app image in Travis. 2018-06-12 16:31:57 +02:00
Matthieu Gautier 894ab4ba06 Add a script to package kiwix-desktop in a AppImage.
AppImage is a tools to create application running in all linux.
See https://appimage.org/
2018-06-12 16:29:00 +02:00
Matthieu Gautier 8c3a8be65d Build kiwix-desktop in travis. 2018-06-12 16:29:00 +02:00
Matthieu Gautier 398f77f9f3 Add kiwix-desktop dependency. 2018-06-12 16:12:31 +02:00
Matthieu Gautier cf8f303362 Add qt(webengine) dependency.
Add qt dependency and QMakeBuilder.
2018-06-12 16:12:15 +02:00
Matthieu Gautier 63003d5bce Correctly extract platform from the dependency.
If the `dep` is a two char string (as "qt"), the `platform, name = dep`
will split the string and search for 't' dependency in 'q' platform.

So, we have to be sure that the dep is a tuple before splitting it.
2018-06-12 16:12:15 +02:00
Matthieu Gautier fc61fbab3d
Merge pull request #180 from kiwix/icu_namespace
Better compilation of icu4c.
2018-06-11 21:12:13 +02:00
Matthieu Gautier 1109b6b155 Better compilation of icu4c.
- Disable icuio and layoutex.
- Hardcode UTF8 as charset (we always use utf8 and hardcoding him improve
  performances)
- Do not include default utf headers
- Do not use `using namespace icu`

See http://source.icu-project.org/repos/icu/trunk/icu4c/readme.html#RecBuild
for more information about options.

Increment base dependencies version as we are compiling icu differently.
2018-06-11 18:05:10 +02:00
Matthieu Gautier 007e78607e
Merge pull request #177 from kiwix/docker
Docker
2018-06-11 17:54:34 +02:00
Matthieu Gautier ded38889cf Use docker to build native_dyn.
As we want to use qt and packages are available only since ubuntu artful, we
need to use docker because travis-ci is ubuntu trusty.

We could also build qt, but it takes too many time and travis timeout.
2018-06-11 16:50:44 +02:00
Matthieu Gautier 312e734678
Merge pull request #175 from kiwix/multi-arch
Multi arch
2018-06-08 14:33:15 +02:00
Matthieu Gautier 4dea44d305 Fix travis CI 2018-06-08 10:29:26 +02:00
Matthieu Gautier daefadecc9 Better gradle option.
Enable `--no-daemon` : Using the daemon make gradle keep "configuration"
(like plugin path). If gradle installation path change, it will break
kiwix-android build.

Enable `--build-cache` : This is not the case by default :/
This should greatly improve compilation speed.
2018-06-07 10:50:30 +02:00
Matthieu Gautier 369b805e59 Add ios_multi_arch fatlib.
Fix #113
2018-06-06 17:41:12 +02:00
Matthieu Gautier cfdf03c854 Select the default platform depending of the target.
Default platform `android` is better for `kiwix-android`
(because `kiwix-android` can build only on `android` platform).
2018-06-06 17:41:12 +02:00
Matthieu Gautier 5f5fbfe082 Rename `targets` option to `target`. 2018-06-06 17:41:12 +02:00
Matthieu Gautier db82455f03 Be able to build multi-arch android apk.
By building kiwix-android on the `android` platform, we can now build
`kiwix-lib` on all `android_<arch>` platforms, and so have all
architectures in the same apk.

Fix #108
2018-06-06 17:41:12 +02:00
Matthieu Gautier 9b85791705 Gradle is a dependency of the android platform, not of other dependencies. 2018-06-06 17:41:11 +02:00
Matthieu Gautier 6de2cc80b6 Add an android metaPlatformInfo to build all android architecture. 2018-05-31 11:30:26 +02:00
Matthieu Gautier 74ba5885a0 Add a MetaPlatformInfo.
A metaplatform allow to regroup sereval platform together.
When a target is added to the platform, the target is dispatched/add to
all sub platforms.

As the step (metaplatformName, target) is not really added, we have to
track which steps are really added, so `add_targets` need to return the
list of added targets.
2018-05-31 11:30:26 +02:00
Matthieu Gautier 3eae47240b Make the platform responsible to add the targets. 2018-05-31 11:30:26 +02:00
Matthieu Gautier c8c0192675 Simplify cross-compilation
Now we can make reference to build step in another target platform, we can
simplify cross-compilation fo libmagic and icu4c.
2018-05-31 11:30:26 +02:00
Matthieu Gautier a87ba06bf3 Do not infinit loop when ordering steps 2018-05-31 11:30:26 +02:00
Matthieu Gautier 7e8ed1a623 Correctly install packages. 2018-05-31 11:30:26 +02:00
Matthieu Gautier 4d6b6994bc Merge toolchain and dependencies.
Toolchain now became "simple" dependencies.
They are referenced by Platform.

Platform are now created at demande and a neutralPlatform now exists.
2018-05-31 11:30:25 +02:00
Matthieu Gautier 9496ffb86c Clean android_ndk 2018-05-31 11:25:59 +02:00
Matthieu Gautier 211c0f9651 buildEnv doesn't need to know about toolchains.
Having access to the platform is enough.
2018-05-31 11:25:59 +02:00
Matthieu Gautier 41d23b6249 Create the associated platform at demand. 2018-05-31 11:25:59 +02:00
Matthieu Gautier daad1c98c6 Make the options global. 2018-05-31 11:25:59 +02:00
Matthieu Gautier 041826d0e8 Move from target logic to steps logic.
This is the big change !!!!

Instead of handling target as primary object and prepare/build targets,
we are handling build steps.

A build step may be a source (preparation) or a build (of the source).
Actualy, a step is a tuple (context, Builder or Source).

The context define the context of the step. It can be :
- 'source', for a Source step
- 'neutral' or the name of a platform for Build step.

Target becomes a "Class only" class.
2018-05-31 11:25:59 +02:00
Matthieu Gautier 754df8df1d Make the platform responsible to create the buildenv.
It is now the platform who is responsible to:
- correctly add the toolchains as needed
- setup the cross environment
- create the cross files.
2018-05-31 11:25:54 +02:00
Matthieu Gautier 115fbfa147 Move dependencies declaration of a target into the builder.
This is the builder that depends on other target, not the target itself.
2018-05-31 11:14:31 +02:00
Matthieu Gautier 7e0b403ccc Move `run_command` method out of buildEnv class. 2018-05-31 11:14:31 +02:00
Matthieu Gautier 816e06a512 Make the neutralEnv global.
No need to pass the neutralEnv from instance to instance.
2018-05-31 10:42:37 +02:00
Matthieu Gautier f44042f910
Merge pull request #174 from kiwix/split_files
Split files
2018-05-22 19:14:27 +02:00
Matthieu Gautier a413c5f064 Fix root_path lookup in cmake_cross_file generation.
Sometime the root_path is dependent of the target platform and sometime
not. But sometime dependent of the build arch :/

[TODO] We should move the cross_file generation to the PlatformInfo class.
2018-05-22 17:47:21 +02:00
Matthieu Gautier 98ebba65f6 fix imports 2018-05-22 16:58:40 +02:00
Matthieu Gautier b950feb893 Move Builder and BuildEnv in specific module.
Introduce also a "NeutralEnv", a build environment independent of the
targeted platform. All `Source` now build using the neutralEnv.

Most of toolchains are also using neutralEnv except android_ndk who is
specific to a platform.

As toolchain are neutral, platform specific environment variables are now
set by the platformInfo directly instead of the toolchain.
2018-05-22 16:58:39 +02:00
Matthieu Gautier ac83dec674 Move ios sdk in toolchains module. 2018-05-22 16:58:06 +02:00
Matthieu Gautier 363bdf74ed Move target informations into a platforms module.
`TargetInfo`s are information about the target platform.
Let's rename them into PlatformInfo and move them in a specific module.
2018-05-22 16:58:02 +02:00
Matthieu Gautier f1d1fc654c Better MakeBuilder configure system.
`all_configure_option` should be ALL configure option.
2018-05-22 16:43:37 +02:00
Matthieu Gautier 53585b838a Split the dependencies.py file into several parts. 2018-05-22 16:43:37 +02:00
Matthieu Gautier fa829e1dec Rename dependency_versions.py to versions.py 2018-05-22 16:39:55 +02:00
Matthieu Gautier b27d1f0e17
Merge pull request #166 from kiwix/fix_ios
Fix ios
2018-05-21 18:43:18 +02:00
Chris Li ad21da6a01 change armv7s to armv7 2018-05-21 16:05:17 +02:00
Matthieu Gautier 93e0f290f8
Merge pull request #171 from kiwix/no_kiwix_install
Last version of kiwix-tools doesn't have a kiwix-install binary.
2018-05-21 16:02:29 +02:00
Matthieu Gautier 355ef551d3 Last version of kiwix-tools doesn't have a kiwix-install binary.
See commit https://github.com/kiwix/kiwix-tools/commit/7c254544
2018-05-21 14:51:05 +02:00
Matthieu Gautier 52669c12de
Merge pull request #170 from kiwix/libtool
Make kiwix-build install libtool.
2018-05-21 11:34:18 +02:00
Matthieu Gautier c745e325c6 Make kiwix-build install libtool.
Fix #169.
2018-05-21 10:52:52 +02:00
Kelson b445d6dd2d
Merge pull request #164 from kiwix/remove_darwin_warning
Remove Darwin warning, Darwin is now supported.
2018-05-17 07:58:33 +02:00
Pseudo 66cad23bcc Remove Darwin warning, Darwin is now supported. 2018-05-17 07:57:20 +02:00
Matthieu Gautier 8c6c01e278
Merge pull request #168 from kiwix/travis_create_dir
Create "date" directory when deploying nightly build.
2018-05-15 13:19:19 +02:00
Matthieu Gautier e6c5624127 Create "date" directory when deploying nightly build.
The directory is create by simply copying the full directory instead of
individual files.
2018-05-14 22:10:40 +02:00
Matthieu Gautier 31133f936f
Merge pull request #167 from kiwix/zimwriterfs_meson
Zimwriterfs meson
2018-05-14 19:07:05 +02:00
Emmanuel Engelhart d001372a8b Use alternative (HTTPS) file source tarball URL 2018-05-14 15:46:57 +02:00
Matthieu Gautier ee5a8eda96 Build zimwriterfs using meson. 2018-05-14 15:46:57 +02:00
Matthieu Gautier dac4fcd1f8 Also try to cross-compile zim-tools in travis cron. 2018-05-14 15:46:57 +02:00
Matthieu Gautier a417b044f8 Add libmagic dependency. 2018-05-14 15:46:57 +02:00
Matthieu Gautier a888602f77
Merge pull request #161 from kiwix/travis_ios
Travis ios
2018-04-24 19:36:43 +02:00
Matthieu Gautier b4f8d2cc7b Build kiwix-lib for iOS on travis CI. 2018-04-24 15:02:28 +02:00
Matthieu Gautier cc5cfd1901 Update MACOS_DEPLOYMENT_TARGET to 10.7
This is needed to cross-compile to iOS using C++11.
2018-04-24 14:58:14 +02:00
Matthieu Gautier a9818d18c4 Move ios cross file templates in the right directory. 2018-04-24 14:57:23 +02:00
Matthieu Gautier 8467cca46a
Merge pull request #160 from kiwix/update_version
Update to new versions of libzim, kiwix-lib, kiwix-tools.
2018-04-23 21:37:58 +02:00
Matthieu Gautier f0c45c7b42 Update to new versions of libzim, kiwix-lib, kiwix-tools. 2018-04-23 20:52:59 +02:00
Matthieu Gautier ebe9858266
Merge pull request #158 from kiwix/fix_deploy_win
Fix deploy win
2018-04-23 17:07:15 +02:00
Matthieu Gautier 58c5d6d02e Better printing of messages in the travis log. 2018-04-23 16:36:10 +02:00
Matthieu Gautier 25a14e44e7 Fix creation of win nightly archive.
The new name of the platform is "win-i686", not anymore "win32".
2018-04-23 15:07:44 +02:00
Matthieu Gautier 09135cffcb
Merge pull request #154 from kiwix/archive_names
Publish nightly and release archive using the right name.
2018-04-23 14:48:04 +02:00
Matthieu Gautier 989889ca44 Deploy zim nightly on the right server.
zim related projects should be deployed on zim server, not kiwix.

Fix #156.
2018-04-23 14:02:45 +02:00
Matthieu Gautier df99696c85 Publish nightly and release archive using the right name.
The names of archives were inconsistent, rename them to a more consistent
scheme.
2018-04-23 14:02:45 +02:00
Matthieu Gautier b8e00e58c7
Merge pull request #157 from kiwix/missing_win32_lib
Missing win32 lib
2018-04-23 14:01:28 +02:00
Matthieu Gautier 9f877180df Do not compile libaria2 with sqlite3 and libxml2.
Those dependencies are used for bittorent and metalink.
For now, we don't support those features (we should in the future).

However, it seems that if development package are installed on the system,
libaria will try to link with libsqlite3 and libxml3 anyway.

We have to investigate this, but it breaks static build of kiwix-tools.
As we are not using those feature for now, let's just explicitly
compile libaria2 without sqlite3 and libxml2.
2018-04-23 12:08:06 +02:00
Matthieu Gautier 65969f4999 Add missing library in the list of libraries to link with in win32.
Libaria2 use methods in `iphlpapi` on Windows.
2018-04-23 10:45:08 +02:00
Matthieu Gautier f503706914
Merge pull request #155 from kiwix/add_macos_dep_libmagic
Install libmagic in macos for zimwriterfs.
2018-04-19 11:17:31 +02:00
Matthieu Gautier 2270a070d2 Add an option to allways check for needed system packages. 2018-04-19 10:34:24 +02:00
Matthieu Gautier 1773f0fa28 Install libmagic in macos for zimwriterfs. 2018-04-18 17:48:32 +02:00
Matthieu Gautier 28c38695f1
Merge pull request #78 from kiwix/travis_apple
Travis build on osx
2018-04-17 18:22:29 +02:00
Matthieu Gautier 3539a8affe Specify the LIB_SUFFIX for CTPP2. 2018-04-17 17:41:23 +02:00
Matthieu Gautier f536d625a9 Add a patch to icu to correctly set the rpath in zimwriterfs build. 2018-04-17 17:41:23 +02:00
Matthieu Gautier 3ad73093f5 [TRAVISCI] Build kiwix-lib on macOS 2018-04-17 17:41:08 +02:00
Matthieu Gautier 9acd6b3447 Run the xcodebuild command only we actually use iOSTargetInfo. 2018-04-17 17:40:11 +02:00
Matthieu Gautier 72d9e99bf9 except the correct exception URLError when downloading.
`urllib.request.open` can raise a URLError or a HTTPError.
2018-04-17 17:39:13 +02:00
Matthieu Gautier 24c771aaa8 Avoid to make a svn_update at each time. 2018-04-17 17:37:07 +02:00
Matthieu Gautier f94ca108f7 Enable RPATH for Icu. 2018-04-16 19:42:07 +02:00
Matthieu Gautier 6d507651a4 Do not compile icu tools when cross-compiling icu4c.
We do not need tools when cross-compiling icu4c.
And when cross-compiling to iOS, tools are not compiling at all.
2018-04-16 17:45:03 +02:00
Chris Li 5eedb3d96a First version of kiwix cross-compilation to IOS. 2018-04-16 17:45:03 +02:00
Matthieu Gautier fc3cf614a7
Merge pull request #151 from kiwix/reduce_travis_build
Do not do unecessary build.
2018-04-16 17:25:11 +02:00
Matthieu Gautier 1ed8889e26 Do not do unecessary build.
Build only if the travis event is not a push (pull_request, cron, ..)
or we are pushing a tag (to build releases).
2018-04-16 16:13:17 +02:00
Matthieu Gautier a394c4292c
Merge pull request #150 from kiwix/travis_no_mips_nightly
Do not build android mips in travis in case of cron or pull_request.
2018-04-16 15:56:09 +02:00
Matthieu Gautier f983b8431b Do not build android mips in travis in case of cron or pull_request.
Related to #121
2018-04-16 15:07:28 +02:00
Matthieu Gautier acf1083b1f
Merge pull request #149 from kiwix/no_sse
Compile i586 without sse instructions.
2018-04-09 14:16:13 +02:00
Matthieu Gautier 72f3691ba6 Compile i586 without sse instructions.
We need a to compile binaries without sse instructions
(https://github.com/kiwix/kiwix-build/issues/94#issuecomment-376814014)
2018-04-09 12:09:18 +02:00
Matthieu Gautier ee11333249
Merge pull request #145 from kiwix/i586
I586
2018-04-09 11:49:45 +02:00
Matthieu Gautier 83a4841ea2 Do not build ctpp2 with iconv support. 2018-04-06 18:59:15 +02:00
Matthieu Gautier 27bce3cd99 Add missing package for i586 ubuntu in travis. 2018-04-06 18:59:15 +02:00
Matthieu Gautier fd39245c40 Update travis to also compile i586 variants. 2018-04-06 18:59:15 +02:00
Matthieu Gautier 468c3edff9 Add a i586 toolchain.
This will allow to build kiwix-tools for i586 architectures.
2018-04-06 18:59:15 +02:00
Matthieu Gautier 5d08673a52 Correctly stop the build if there is an error during the downloading. 2018-04-05 23:32:46 +02:00
Matthieu Gautier 8f0c6a321b Add an option to not build all dependencies but only the specified target. 2018-04-05 23:32:46 +02:00
Matthieu Gautier 8fc946ab74
Merge pull request #144 from kiwix/gradle-update
Increment gradle wrapper version
2018-04-05 23:31:59 +02:00
mhutti1 c01ca69130 Increment gradle wrapper version 2018-04-05 17:22:08 +02:00
Matthieu Gautier 502f740ca9
Merge pull request #143 from kiwix/fix_MANIFEST.in
Correctly include the patche files.
2018-04-05 17:19:42 +02:00
Matthieu Gautier 372d11e23d Add libaria2 to the list of all base dependencies. 2018-04-05 15:40:04 +02:00
Matthieu Gautier eb75660e48 Do not try to compile xz and xzdec tools.
libaria2 use xz to configure its source.
If we compile the xz tool, libaria2 will use the compiled binary.

However, on cross compilation, xz will be compiled for the target platform
and run on the host platform. And so, it will fails.

As we do not use those tools at all, lets not compile them.
2018-04-05 15:39:26 +02:00
Matthieu Gautier f579d3dc26 Correctly include the patche files.
This is needed to patch the sources.
2018-04-05 11:46:31 +02:00
Matthieu Gautier 70a6fa3860
Merge pull request #142 from kiwix/split_files
Split files
2018-04-04 22:17:41 +02:00
Matthieu Gautier 72002c8f34 Update README.md 2018-04-04 18:06:36 +02:00
Matthieu Gautier 6ebd96c059 Adapte travis to new file architectures.
- kiwix-build is installable, so let's install it in travisCI
- Declare the dependency to meson in the setup.py
- As kiwixbuild is installed, we don't need to change the `sys.path`
2018-04-04 15:43:51 +02:00
Matthieu Gautier 97666b0fc9 Create a real module kiwixbuild and make it installable. Split files.
Make kiwix-build installable using pip.
Module is now called `kiwixbuild` because `kiwix-build` is not a valid
python identifier.

Also split toolchains in separated directory.
2018-04-04 15:43:16 +02:00
Matthieu Gautier 1513204f42
Merge pull request #139 from kiwix/libaria2
Add dependency libaria2.
2018-03-28 14:25:17 +02:00
Matthieu Gautier 7da54c4819 Update to last version of lzma. 2018-03-28 11:45:55 +02:00
Matthieu Gautier 98b2ab5efd Add dependency libaria2.
libaria2 needs a lot of dependencies to handle all protocol.
So this is a basic compilation of libaria2 :
No tls(https), no metalink and no bit-torrent.
2018-03-27 20:38:33 +02:00
Matthieu Gautier 067ac0d832
Merge pull request #138 from kiwix/update_versions
Update to new version of libzim, kiwix-lib and kiwix-tools.
2018-03-27 15:58:41 +02:00
Matthieu Gautier e990b3e93b Update to new version of libzim, kiwix-lib and kiwix-tools. 2018-03-27 12:06:21 +02:00
134 changed files with 38368 additions and 3822 deletions

46
.github/configs/aqt.ini vendored Normal file
View File

@ -0,0 +1,46 @@
[DEFAULTS]
[aqt]
concurrency: 4
baseurl: https://qt.mirror.constant.com/
7zcmd: 7z
print_stacktrace_on_error: False
always_keep_archives: False
archive_download_location: .
min_module_size: 41
[requests]
connection_timeout: 3.5
response_timeout: 30
max_retries_on_connection_error: 5
retry_backoff: 0.1
max_retries_on_checksum_error: 5
max_retries_to_retrieve_hash: 5
hash_algorithm: sha256
INSECURE_NOT_FOR_PRODUCTION_ignore_hash: False
[mirrors]
trusted_mirrors:
https://download.qt.io
https://qt.mirror.constant.com/
https://ftp.fau.de/qtproject/
blacklist:
http://mirrors.ocf.berkeley.edu
http://mirrors.tuna.tsinghua.edu.cn
http://mirrors.geekpie.club
fallbacks:
https://qtproject.mirror.liquidtelecom.com/
https://mirrors.aliyun.com/qt/
https://mirrors.ustc.edu.cn/qtproject/
https://ftp.jaist.ac.jp/pub/qtproject/
https://ftp.yz.yamagata-u.ac.jp/pub/qtproject/
https://qt-mirror.dannhauer.de/
https://ftp.fau.de/qtproject/
https://mirror.netcologne.de/qtproject/
https://mirrors.dotsrc.org/qtproject/
https://www.nic.funet.fi/pub/mirrors/download.qt-project.org/
https://master.qt.io/
https://mirrors.ukfast.co.uk/sites/qt.io/
https://ftp2.nluug.nl/languages/qt/
https://ftp1.nluug.nl/languages/qt/
https://qt.mirror.constant.com/

161
.github/scripts/build_definition.py vendored Normal file
View File

@ -0,0 +1,161 @@
from typing import NamedTuple
import csv, io, re
# Definition of what to build.
# Array is read line by line.
# Empty cells under (OS_NAME, COMPILE_CONFIG) mean "always match" (catch all, or `.*` regex)
# Once a cell doesn't match, skip to the next line.
# Once a line matches, other lines are not read, so put more specific combination first.
# Lines composed of `-` , or `=`, or starting by `#` are ignored.
# 'B' letter means that the project is build in the CI
# 'd' letter means that the project's dependencies are build and published to be used by the project's CI.
# 'P' letter means that (build) project must be publish when we do a release.
# (This is used to avoid two publication of the same archive)
# 'S' letter means that source code must be publish (almost by definition, S should be put only with a P)
# 'D' letter means we trigger the docker forkflow to build the docker image.
# If a cell contains several letters, all are done.
BUILD_DEF = """
| OS_NAME | COMPILE_CONFIG | libzim | libkiwix | zim-tools | kiwix-tools | kiwix-desktop | platform_name | dependency_name |
==============================================================================================================================================
# manylinux is a special case as we need to compile libzim on old arch for python
| manylinux | native_mixed | BP | | | | | linux-x86_64-manylinux | |
| manylinux | aarch64_mixed | BP | | | | | linux-aarch64-manylinux | |
----------------------------------------------------------------------------------------------------------------------------------------------
# On Windows, we build only libzim for now. And only native_mixed as xapian doesn't compile as dll
| windows | native_static | Bd | d | BPd | BPd | | win-x86_64 | win-x86_64-static |
| windows | native_dyn | Bd | | | | | win-x86_64 | win-x86_64-dyn |
| windows | native_mixed | BPd | d | | | BPd | win-x86_64 | win-x86_64-mixed |
----------------------------------------------------------------------------------------------------------------------------------------------
# Osx builds, build binaries on native_dyn and native_static. On anyother things, build only the libraries
| macos | native_dyn | d | d | dB | B | | | macos-x86_64-dyn |
| macos | native_static | | | BP | BP | | macos-x86_64 | |
| macos | native_mixed | BP | BP | | | | macos-x86_64 | |
| macos | iOS_arm64 | dB | dB | | | | | ios-arm64-dyn |
| macos | iOSSimulator_x86_64| dB | dB | | | | | ios-x86_64-dyn |
| macos | iOSSimulator_arm64 | B | B | | | | | |
| macos | macOS_arm64_static | | | BP | BP | | macos-arm64 | |
| macos | macOS_arm64_mixed | dBP | dBP | d | | | macos-arm64 | macos-aarch64-dyn |
| macos | macOS_x86_64 | B | B | | | | | |
| macos | apple_all_static | | BP | | | | xcframework | |
----------------------------------------------------------------------------------------------------------------------------------------------
| focal | flatpak | | | | | BP | | |
| focal | native_static | d | d | dBPSD | dBPSD | | linux-x86_64 | linux-x86_64-static |
| focal | native_mixed | BPS | BPS | | | | linux-x86_64 | |
| focal | native_dyn | d | d | dB | dB | | | linux-x86_64-dyn |
| jammy | native_dyn | | | | | dBPS | | linux-x86_64-dyn |
# libzim CI is building alpine_dyn but not us
| focal | android_arm | dBP | dBP | | | | android-arm | android-arm |
| focal | android_arm64 | dBP | dBP | | | | android-arm64 | android-arm64 |
| focal | android_x86 | BP | BP | | | | android-x86 | |
| focal | android_x86_64 | BP | BP | | | | android-x86_64 | |
| focal | armv6_static | | | BP | BP | | linux-armv6 | |
| focal | armv6_mixed | BP | | | | | linux-armv6 | |
| focal | armv6_dyn | | | B | B | | | |
| focal | armv8_static | | | BP | BP | | linux-armv8 | |
| focal | armv8_mixed | BP | | | | | linux-armv8 | |
| focal | armv8_dyn | | | B | B | | | |
| focal | aarch64_static | | | BP | BP | | linux-aarch64 | |
| focal | aarch64_mixed | BP | | | | | linux-aarch64 | |
| focal | aarch64_dyn | d | | B | B | | | linux-aarch64-dyn |
| focal | aarch64_musl_static| | | BP | BP | | linux-aarch64-musl | |
| focal | aarch64_musl_mixed | BP | | | | | linux-aarch64-musl | |
| focal | aarch64_musl_dyn | d | | B | B | | | linux-aarch64-musl-dyn |
| focal | x86-64_musl_static | | | BP | BP | | linux-x86_64-musl | |
| focal | x86-64_musl_mixed | BP | | | | | linux-x86_64-musl | |
| focal | i586_static | | | BP | BP | | linux-i586 | |
| focal | i586_dyn | | | B | B | | | |
| focal | wasm | dBP | | | | | wasm-emscripten | wasm |
"""
class TableDialect(csv.Dialect):
delimiter = "|"
quoting = csv.QUOTE_NONE
lineterminator = "\n"
def strip_array(array_str):
"""Return a iterable of lines, skiping "decorative lines" and with all values in the line's cells stripped"""
for line in array_str.splitlines():
line = line.strip()
line_set = set(line)
if (
not line
or line.startswith("#")
or (len(line_set) == 1 and line_set.pop() in "-=")
):
continue
yield "|".join(c.strip() for c in line.split("|"))
def selector_match(selector, value):
if not selector:
return True
return re.fullmatch(selector, value) is not None
class Context(NamedTuple):
OS_NAME: str
COMPILE_CONFIG: str
def match(self, row):
for key in ["OS_NAME", "COMPILE_CONFIG"]:
context_value = getattr(self, key)
selector = row[key]
if not selector_match(selector, context_value):
return False
return True
BUILD = "B"
PUBLISH = "P"
SOURCE_PUBLISH = "S"
DEPS = "d"
DOCKER = "D"
def select_build_targets(criteria):
from common import COMPILE_CONFIG, OS_NAME
context = Context(COMPILE_CONFIG=COMPILE_CONFIG, OS_NAME=OS_NAME)
reader = csv.DictReader(strip_array(BUILD_DEF), dialect=TableDialect())
for row in reader:
if context.match(row):
build_order = [
k
for k in (
"libzim",
"libkiwix",
"zim-tools",
"kiwix-tools",
"kiwix-desktop",
)
if criteria in row[k]
]
print(build_order)
return build_order
raise ValueError("No definition match with current context.")
def get_column_value(column_name):
from common import COMPILE_CONFIG, OS_NAME
context = Context(COMPILE_CONFIG=COMPILE_CONFIG, OS_NAME=OS_NAME)
reader = csv.DictReader(strip_array(BUILD_DEF), dialect=TableDialect())
for row in reader:
if context.match(row):
name = row[column_name]
return name or None
raise ValueError("No definition match with current context.")
def get_platform_name():
return get_column_value("platform_name")
def get_dependency_archive_name():
return get_column_value("dependency_name")

24
.github/scripts/build_projects.py vendored Executable file
View File

@ -0,0 +1,24 @@
#!/usr/bin/env python3
from build_definition import select_build_targets, BUILD
from common import (
run_kiwix_build,
make_archive,
create_desktop_image,
fix_macos_rpath,
upload_archive,
OS_NAME,
COMPILE_CONFIG,
DEV_BRANCH,
)
for target in select_build_targets(BUILD):
run_kiwix_build(target, config=COMPILE_CONFIG)
if target == "kiwix-desktop":
archive = create_desktop_image(make_release=False)
else:
if COMPILE_CONFIG == "native_mixed" and OS_NAME == "macos":
fix_macos_rpath(target)
archive = make_archive(target, make_release=False)
if archive and DEV_BRANCH:
upload_archive(archive, target, make_release=False, dev_branch=DEV_BRANCH)

75
.github/scripts/build_release_nightly.py vendored Executable file
View File

@ -0,0 +1,75 @@
#!/usr/bin/env python3
import os
from common import (
run_kiwix_build,
main_project_versions,
release_versions,
make_archive,
create_desktop_image,
update_flathub_git,
upload_archive,
fix_macos_rpath,
BASE_DIR,
OS_NAME,
COMPILE_CONFIG,
MAKE_RELEASE,
notarize_macos_build,
)
from build_definition import select_build_targets, BUILD, PUBLISH, SOURCE_PUBLISH
def release_filter(project):
return release_versions.get(project) is not None
# Filter what to build if we are doing a release.
TARGETS = select_build_targets(PUBLISH)
if MAKE_RELEASE:
TARGETS = tuple(filter(release_filter, TARGETS))
for target in TARGETS:
run_kiwix_build(target, config=COMPILE_CONFIG, make_release=MAKE_RELEASE)
if target == "kiwix-desktop":
archive = create_desktop_image(make_release=MAKE_RELEASE)
else:
if OS_NAME == "macos" and COMPILE_CONFIG.endswith("_mixed"):
fix_macos_rpath(target)
notarize_macos_build(target)
archive = make_archive(target, make_release=MAKE_RELEASE)
if archive:
upload_archive(archive, target, make_release=MAKE_RELEASE)
# We have few more things to do for release:
if MAKE_RELEASE:
# Publish source archives
source_published_targets = select_build_targets(SOURCE_PUBLISH)
for target in TARGETS:
# Looping on TARGETS instead of source_published_targets ensures we are
# publishing sources only for target we are building.
# (source_published_targets must be a subset of TARGETS)
if release_versions.get(target) != 0:
continue
if target not in source_published_targets:
continue
run_kiwix_build(
target, config=COMPILE_CONFIG, make_release=MAKE_RELEASE, make_dist=True
)
full_target_name = "{}-{}".format(target, main_project_versions[target])
if target == "kiwix-desktop":
archive = BASE_DIR / full_target_name / "{}.tar.gz".format(full_target_name)
else:
archive = (
BASE_DIR
/ full_target_name
/ "meson-dist"
/ "{}.tar.xz".format(full_target_name)
)
upload_archive(archive, target, make_release=MAKE_RELEASE)
# Publish flathub
if COMPILE_CONFIG == "flatpak" and "kiwix-desktop" in TARGETS:
update_flathub_git()

771
.github/scripts/common.py vendored Normal file
View File

@ -0,0 +1,771 @@
import os
from os import environ as _environ
from pathlib import Path, PurePosixPath
from datetime import date
import tarfile
import zipfile
import subprocess
import re
import shutil
import platform
import requests
from build_definition import get_platform_name, get_dependency_archive_name
from kiwixbuild.dependencies.apple_xcframework import AppleXCFramework
from kiwixbuild.versions import (
main_project_versions,
release_versions,
base_deps_versions,
)
def get_build_dir(config) -> Path:
command = ["kiwix-build"]
command.extend(["--config", config])
command.append("--get-build-dir")
command.append("--use-target-arch-name")
return Path(
subprocess.run(command, cwd=str(HOME), check=True, stdout=subprocess.PIPE)
.stdout.strip()
.decode("utf8")
)
COMPILE_CONFIG = _environ["COMPILE_CONFIG"]
OS_NAME = _environ["OS_NAME"]
HOME = Path(os.path.expanduser("~"))
BASE_DIR = get_build_dir(COMPILE_CONFIG)
SOURCE_DIR = HOME / "SOURCE"
ARCHIVE_DIR = HOME / "ARCHIVE"
TOOLCHAIN_DIR = BASE_DIR / "TOOLCHAINS"
INSTALL_DIR = BASE_DIR / "INSTALL"
default_tmp_dir = os.getenv("TEMP") if platform.system() == "Windows" else "/tmp"
TMP_DIR = Path(os.getenv("TMP_DIR", default_tmp_dir))
if platform.system() == "Windows":
KBUILD_SOURCE_DIR = Path(_environ["GITHUB_WORKSPACE"])
BIN_EXT = ".exe"
else:
KBUILD_SOURCE_DIR = HOME / "kiwix-build"
BIN_EXT = ""
_ref = _environ.get("GITHUB_REF", "").split("/")[-1]
MAKE_RELEASE = re.fullmatch(r"r_[0-9]+", _ref) is not None
MAKE_RELEASE = MAKE_RELEASE and (_environ.get("GITHUB_EVENT_NAME") != "schedule")
if not MAKE_RELEASE and _ref != "main":
DEV_BRANCH = _ref
else:
DEV_BRANCH = None
FLATPAK_HTTP_GIT_REMOTE = "https://github.com/flathub/org.kiwix.desktop.git"
FLATPAK_GIT_REMOTE = "git@github.com:flathub/org.kiwix.desktop.git"
def major_version(version: str) -> str:
return version.split(".")[0]
# Depending of base distribution, libraries are in "lib64" (redhat base) or "lib/<arch>" (debian base).
# On top of that, when cross-compiling, libraries are always put in `lib/<arch>`.
# As we use this as glob regex to select which files to add to archive, this is not a problem to have both.
def lib_prefix(file):
yield "lib64/" + file
yield "lib/*/" + file
# We have build everything. Now create archives for public deployement.
EXPORT_FILES = {
"kiwix-tools": (
INSTALL_DIR / "bin",
[f + BIN_EXT for f in ("kiwix-manage", "kiwix-search", "kiwix-serve")]
+ ["icu*.dll"],
),
"zim-tools": (
INSTALL_DIR / "bin",
[
f + BIN_EXT
for f in (
"zimbench",
"zimcheck",
"zimdump",
"zimsearch",
"zimdiff",
"zimpatch",
"zimsplit",
"zimwriterfs",
"zimrecreate",
)
]
+ ["icu*.dll"],
),
"libzim": (
INSTALL_DIR,
(
## Linux
# We need to package all dependencies (`*.a`) on wasm
*lib_prefix("libzim.a" if COMPILE_CONFIG != "wasm" else "*.a"),
*lib_prefix("libzim.so"),
*lib_prefix(
"libzim.so.{version}".format(version=main_project_versions["libzim"])
),
*lib_prefix(
"libzim.so.{version}".format(
version=major_version(main_project_versions["libzim"])
)
),
## MacOS
"lib/libzim.{}.dylib".format(
major_version(main_project_versions["libzim"])
),
"lib/libzim.dylib",
"lib/*/libzim.pc",
## Windows
"bin/zim-{version}.dll".format(
version=major_version(main_project_versions["libzim"])
),
"bin/icu*.dll",
"bin/zim-{version}.pdb".format(
version=major_version(main_project_versions["libzim"])
),
"lib/zim.lib",
## Includes and others
"include/zim/**/*.h",
"share/icu/{}/icudt{}l.dat".format(
base_deps_versions["icu4c"], major_version(base_deps_versions["icu4c"])
),
),
),
"libkiwix": (
INSTALL_DIR,
(
"lib/CoreKiwix.xcframework/",
"lib/*/libkiwix.so",
"lib/*/libkiwix.so.{version}".format(
version=main_project_versions["libkiwix"]
),
"lib/*/libkiwix.so.{version}".format(
version=major_version(main_project_versions["libkiwix"])
),
"lib/libkiwix.{}.dylib".format(
major_version(main_project_versions["libkiwix"])
),
"bin/kiwix-{version}.dll".format(
version=major_version(main_project_versions["libkiwix"])
),
"bin/icu*.dll",
"bin/kiwix-{version}.pdb".format(
version=major_version(main_project_versions["libkiwix"])
),
"lib/kiwix.lib",
"lib/libkiwix.dylib",
"lib/*/libkiwix.pc",
"include/kiwix/**/*.h",
"share/icu/{}/icudt{}l.dat".format(
base_deps_versions["icu4c"], major_version(base_deps_versions["icu4c"])
),
),
),
}
DATE = date.today().isoformat()
def print_message(message, *args, **kwargs):
message = message.format(*args, **kwargs)
message = "{0} {1} {0}".format("-" * 3, message)
print(message, flush=True)
MANIFEST_TEMPLATE = """{archive_name}
***************************
Dependencies archive for {target} using config {config}
Generated at {date}
"""
def write_manifest(manifest_file, archive_name, target, config):
with manifest_file.open(mode="w") as f:
f.write(
MANIFEST_TEMPLATE.format(
archive_name=archive_name,
target=target,
config=config,
date=DATE,
)
)
def run_kiwix_build(
target,
config,
build_deps_only=False,
target_only=False,
make_release=False,
make_dist=False,
):
command = ["kiwix-build"]
command.append(target)
command.append("--hide-progress")
command.append("--fast-clone")
command.append("--assume-packages-installed")
command.append("--use-target-arch-name")
command.extend(["--config", config])
if build_deps_only:
command.append("--build-deps-only")
if target_only:
command.append("--build-nodeps")
if make_release:
command.append("--make-release")
if make_dist:
command.append("--make-dist")
print_message(
"Build {} (deps={}, release={}, dist={})",
target,
build_deps_only,
make_release,
make_dist,
)
env = dict(_environ)
env["SKIP_BIG_MEMORY_TEST"] = "1"
subprocess.check_call(command, cwd=str(HOME), env=env)
print_message("Build ended")
try:
import paramiko
def upload(file_to_upload, host, dest_path):
if not file_to_upload.exists():
print_message("No {} to upload!", file_to_upload)
return
if ":" in host:
host, port = host.split(":", 1)
else:
port = "22"
if "@" in host:
user, host = host.split("@", 1)
else:
user = None
from contextlib import contextmanager
@contextmanager
def get_client():
client = paramiko.client.SSHClient()
client.set_missing_host_key_policy(paramiko.client.WarningPolicy)
print_message(f"Connect to {host}:{port}")
client.connect(
host,
port=port,
username=user,
key_filename=_environ.get("SSH_KEY"),
look_for_keys=False,
compress=True,
)
try:
yield client
finally:
client.close()
@contextmanager
def get_sftp():
with get_client() as client:
sftp = client.open_sftp()
try:
yield sftp
finally:
sftp.close()
dest_path = PurePosixPath(dest_path)
remote_file = dest_path.joinpath(file_to_upload.name)
with get_sftp() as sftp:
for part in list(reversed(dest_path.parents)) + [dest_path]:
part = str(part)
try:
sftp.stat(part)
except FileNotFoundError:
sftp.mkdir(part)
print_message(f"Sending archive {file_to_upload} to {remote_file}")
sftp.put(str(file_to_upload), str(remote_file), confirm=True)
except ModuleNotFoundError:
# On old system (bionic) paramiko is really complex to install
# Keep the old implementaion on sush system.
def upload(file_to_upload, host, dest_path):
if not file_to_upload.exists():
print_message("No {} to upload!", file_to_upload)
return
if ":" in host:
host, port = host.split(":", 1)
else:
port = "22"
# Using SFTP to create the directory hierarchy because we can not
# use SSH (no shell for this user); and then scp to upload the file.
#
# Sending SFTP mkdir command to the SFTP interactive mode and not batch (-b) mode
# as the latter would exit on any mkdir error while it is most likely
# the first parts of the destination is already present and thus can't be created
sftp_commands = "\n".join(
[
f"mkdir {part}"
for part in list(reversed(Path(dest_path).parents)) + [dest_path]
]
)
command = [
"sftp",
"-c",
"aes128-ctr",
"-i",
_environ.get("SSH_KEY"),
"-P",
port,
"-o",
"StrictHostKeyChecking=no",
host,
]
print_message("Creating dest path {}", dest_path)
subprocess.run(command, input=sftp_commands.encode("utf-8"), check=True)
command = [
"scp",
"-c",
"aes128-ctr",
"-rp",
"-P",
port,
"-i",
_environ.get("SSH_KEY"),
"-o",
"StrictHostKeyChecking=no",
str(file_to_upload),
"{}:{}".format(host, dest_path),
]
print_message("Sending archive with command {}", command)
subprocess.check_call(command)
def upload_archive(archive, project, make_release, dev_branch=None):
if not archive.exists():
print_message("No archive {} to upload!", archive)
return
if project.startswith("kiwix-") or project in ["libkiwix"]:
host = "ci@master.download.kiwix.org:30022"
dest_path = "/data/download/"
else:
host = "ci@download.openzim.org:30022"
dest_path = "/data/openzim/"
if make_release:
dest_path = dest_path + "release/" + project
else:
dest_path = dest_path + "nightly/" + DATE
if dev_branch:
dest_path = "/data/tmp/ci/dev_preview/" + dev_branch
else:
# Make the archive read only. This way, scp will preserve rights.
# If somehow we try to upload twice the same archive, scp will fails.
archive.chmod(0o444)
upload(archive, host, dest_path)
# This remove "share/doc" and "share/man" from the thing to copy in the deps archive
def filter_install_dir(path):
for dir in path.glob("*"):
if dir.name not in ["share"]:
yield dir
else:
for sub_dir in dir.glob("*"):
if sub_dir.name not in ["doc", "man"]:
yield sub_dir
# Full: True if we are creating a full archive to be used as cache by kiwix-build (base_deps_{os}_{config}_{base_deps_version}.tar.gz)
# Full: False if we are creating a archive to be used as pre-cached dependencies for project's CI (deps_{config}_{target}.tar.gz)
def make_deps_archive(target=None, name=None, full=False):
archive_name = name or "deps_{}_{}.tar.gz".format(
get_dependency_archive_name(), target
)
print_message("Create archive {}.", archive_name)
files_to_archive = list(filter_install_dir(INSTALL_DIR))
files_to_archive += HOME.glob("BUILD_*/LOGS")
if COMPILE_CONFIG == "apple_all_static":
for subconfig in AppleXCFramework.subConfigNames:
base_dir = get_build_dir(subconfig)
files_to_archive += filter_install_dir(base_dir / "INSTALL")
if (base_dir / "meson_cross_file.txt").exists():
files_to_archive.append(base_dir / "meson_cross_file.txt")
if COMPILE_CONFIG.endswith("_mixed"):
static_config = COMPILE_CONFIG.replace("_mixed", "_static")
files_to_archive += filter_install_dir(get_build_dir(static_config) / "INSTALL")
if COMPILE_CONFIG.startswith("android_"):
files_to_archive += filter_install_dir(HOME / "BUILD_neutral" / "INSTALL")
base_dir = get_build_dir(COMPILE_CONFIG)
if (base_dir / "meson_cross_file.txt").exists():
files_to_archive.append(base_dir / "meson_cross_file.txt")
# Copy any toolchain
files_to_archive += [TOOLCHAIN_DIR]
files_to_archive += HOME.glob("BUILD_neutral/TOOLCHAINS/*")
if (BASE_DIR / "meson_cross_file.txt").exists():
files_to_archive.append(BASE_DIR / "meson_cross_file.txt")
manifest_file = BASE_DIR / "manifest.txt"
write_manifest(manifest_file, archive_name, target, COMPILE_CONFIG)
files_to_archive.append(manifest_file)
relative_path = HOME
if full:
files_to_archive += ARCHIVE_DIR.glob(".*_ok")
files_to_archive += BASE_DIR.glob("*/.*_ok")
# Add also static build for mixed target
if COMPILE_CONFIG.endswith("_mixed"):
static_config = COMPILE_CONFIG.replace("_mixed", "_static")
files_to_archive += get_build_dir(static_config).glob("*/.*_ok")
# Native dyn and static is needed for potential cross compilation that use native tools (icu)
files_to_archive += get_build_dir("native_dyn").glob("*/.*_ok")
files_to_archive += get_build_dir("native_static").glob("*/.*_ok")
files_to_archive += HOME.glob("BUILD_*android*/**/.*_ok")
files_to_archive += HOME.glob("BUILD_*apple-macos*/**/.*_ok")
files_to_archive += HOME.glob("BUILD_*apple-ios*/**/.*_ok")
files_to_archive += SOURCE_DIR.glob("*/.*_ok")
files_to_archive += SOURCE_DIR.glob("zim-testing-suite-*/*")
archive_file = TMP_DIR / archive_name
with tarfile.open(str(archive_file), "w:gz") as tar:
for name in set(files_to_archive):
print(".{}".format(name), flush=True)
tar.add(str(name), arcname=str(name.relative_to(relative_path)))
return archive_file
def get_postfix(project):
postfix = main_project_versions[project]
extra = release_versions.get(project)
if extra:
postfix = "{}-{}".format(postfix, extra)
return postfix
def sign_binary(path):
# We assume here that signtool and certificate are properly configured.
# Env var `SIGNTOOL_THUMBPRINT` must contain thumbprint of the certificate to use.
command = [
os.getenv("SIGNTOOL_PATH", "signtool.exe"),
"sign",
"/fd",
"sha256",
"/tr",
"http://ts.ssl.com",
"/td",
"sha256",
"/sha1",
os.environ["SIGNTOOL_THUMBPRINT"],
str(path),
]
subprocess.run(command, check=True)
def make_archive(project, make_release):
platform_name = get_platform_name()
if not platform_name:
return None
try:
base_dir, export_files = EXPORT_FILES[project]
except KeyError:
# No binary files to export
return None
if make_release:
postfix = get_postfix(project)
else:
postfix = DATE
archive_name = "{}_{}-{}".format(project, platform_name, postfix)
files_to_archive = []
for export_file in export_files:
files_to_archive.extend(base_dir.glob(export_file))
if make_release and platform.system() == "Windows":
for file in files_to_archive:
if str(file).endswith(".exe"):
sign_binary(file)
if platform_name == "win-i686" or platform.system() == "Windows":
open_archive = lambda a: zipfile.ZipFile(
str(a), "w", compression=zipfile.ZIP_DEFLATED
)
archive_add = lambda a, f: a.write(str(f), arcname=str(f.relative_to(base_dir)))
archive_ext = ".zip"
else:
open_archive = lambda a: tarfile.open(str(a), "w:gz")
archive_add = lambda a, f: a.add(
str(f), arcname="{}/{}".format(archive_name, str(f.relative_to(base_dir)))
)
archive_ext = ".tar.gz"
archive = TMP_DIR / "{}{}".format(archive_name, archive_ext)
print_message("create archive {} with {}", archive, files_to_archive)
with open_archive(archive) as arch:
for f in files_to_archive:
archive_add(arch, f)
return archive
def create_desktop_image(make_release):
print_message("creating desktop image")
if make_release:
postfix = get_postfix("kiwix-desktop")
src_dir = SOURCE_DIR / "kiwix-desktop_release"
else:
postfix = DATE
src_dir = SOURCE_DIR / "kiwix-desktop"
if COMPILE_CONFIG == "flatpak":
build_path = BASE_DIR / "org.kiwix.desktop.flatpak"
app_name = "org.kiwix.desktop.{}.flatpak".format(postfix)
print_message("archive is {}", build_path)
elif platform.system() == "Windows":
archive_basename = "kiwix-desktop_windows_x64_{}".format(postfix)
working_dir = INSTALL_DIR / archive_basename
build_path = Path(str(working_dir) + ".zip")
app_name = build_path.name
command = [
"python",
KBUILD_SOURCE_DIR / "scripts" / "package_kiwix-desktop_windows.py",
str(INSTALL_DIR),
str(working_dir),
str(build_path),
]
if make_release:
command += ["-s"]
print_message("Package archive of kiwix-desktop")
subprocess.check_call(command, cwd=str(HOME))
else:
build_path = HOME / "Kiwix-{}-x86_64.AppImage".format(postfix)
app_name = "kiwix-desktop_x86_64_{}.appimage".format(postfix)
command = [
KBUILD_SOURCE_DIR / "scripts" / "create_kiwix-desktop_appImage.sh",
str(INSTALL_DIR),
str(src_dir),
str(HOME / "AppDir"),
]
env = dict(os.environ)
env["VERSION"] = postfix
print_message("Build AppImage of kiwix-desktop")
subprocess.check_call(command, cwd=str(HOME), env=env)
print_message("Copy Build to {}".format(TMP_DIR / app_name))
shutil.copy(str(build_path), str(TMP_DIR / app_name))
return TMP_DIR / app_name
def update_flathub_git():
git_repo_dir = TMP_DIR / "org.kiwix.desktop"
env = dict(os.environ)
env["GIT_AUTHOR_NAME"] = env["GIT_COMMITTER_NAME"] = "KiwixBot"
env["GIT_AUTHOR_EMAIL"] = env["GIT_COMMITTER_EMAIL"] = "release@kiwix.org"
def call(command, cwd=None):
cwd = cwd or git_repo_dir
print_message("call {}", command)
subprocess.check_call(command, env=env, cwd=str(cwd))
command = ["git", "clone", FLATPAK_HTTP_GIT_REMOTE]
call(command, cwd=TMP_DIR)
branch_name = "v_{}".format(get_postfix("kiwix-desktop"))
command = ["git", "checkout", "-b", branch_name]
call(command)
shutil.copy(str(BASE_DIR / "org.kiwix.desktop.json"), str(git_repo_dir))
patch_dir = KBUILD_SOURCE_DIR / "kiwixbuild" / "patches"
for dep in ["pugixml", "libmicrohttpd"]:
for f in patch_dir.glob("{}_*.patch".format(dep)):
shutil.copy(str(f), str(git_repo_dir / "patches"))
command = ["git", "add", "-A", "."]
call(command)
command = [
"git",
"commit",
"-m",
"Update to version {}".format(get_postfix("kiwix-desktop")),
]
try:
call(command)
except subprocess.CalledProcessError:
# This may fail if there is nothing to commit (a rebuild of the CI for exemple)
return
command = ["git", "config", "remote.origin.pushurl", FLATPAK_GIT_REMOTE]
call(command)
command = ["git", "push", "origin", branch_name]
env["GIT_SSH_COMMAND"] = "ssh -o StrictHostKeyChecking=no -i " + _environ.get(
"SSH_KEY"
)
call(command)
def fix_macos_rpath(project):
base_dir, export_files = EXPORT_FILES[project]
for file in filter(lambda f: f.endswith(".dylib"), export_files):
lib = base_dir / file
if lib.is_symlink():
continue
command = ["install_name_tool", "-id", lib.name, str(lib)]
print_message("call {}", " ".join(command))
subprocess.check_call(command, env=os.environ)
def trigger_workflow(repo, workflow="docker.yml", ref="main", inputs=None):
"""triggers a `workflow_dispatch` event to the specified workflow on its repo
repo: {user}/{repo} format
workflow: workflow ID or workflow file name
ref: branch or tag name
inputs: dict of inputs to pass to the workflow"""
print_message(
"triggering workflow `{workflow}` on {repo}@{ref} " "with inputs={inputs}",
workflow=workflow,
repo=repo,
ref=ref,
inputs=inputs,
)
url = "{base_url}/repos/{repo}/actions/workflows/{workflow}/dispatches".format(
base_url=os.getenv("GITHUB_API_URL", "https://api.github.com"),
repo=repo,
workflow=workflow,
)
resp = requests.post(
url,
headers={
"Content-Type": "application/json",
"Authorization": "token {token}".format(token=os.getenv("GITHUB_PAT", "")),
"Accept": "application/vnd.github.v3+json",
},
json={"ref": ref, "inputs": inputs},
timeout=5,
)
if resp.status_code != 204:
raise ValueError(
"Unexpected HTTP {code}: {reason}".format(
code=resp.status_code, reason=resp.reason
)
)
def trigger_docker_publish(target):
if target not in ("zim-tools", "kiwix-tools"):
return
version = get_postfix(target)
repo = {"zim-tools": "openzim/zim-tools", "kiwix-tools": "kiwix/kiwix-tools"}.get(
target
)
try:
trigger_workflow(
repo, workflow="docker.yml", ref="main", inputs={"version": version}
)
print_message("triggered docker workflow on {repo}", repo=repo)
except Exception as exc:
print_message("Error triggering workflow: {exc}", exc=exc)
raise exc
def notarize_macos_build(project):
"""sign and notarize files for macOS
Expects the following environment:
- `SIGNING_IDENTITY` environ with Certificate name/identity
- `KEYCHAIN` environ with path to the keychain storing credentials
- `KEYCHAIN_PROFILE` environ with name of the profile in that keychain
- `KEYCHAIN_PASSWORD` environ with password to unlock the keychain
"""
if project != "libzim":
return
# currently only supports libzim use case: sign every dylib
base_dir, export_files = EXPORT_FILES[project]
filepaths = [
base_dir.joinpath(file)
for file in filter(lambda f: f.endswith(".dylib"), export_files)
if not base_dir.joinpath(file).is_symlink()
]
if not filepaths:
return
for filepath in filepaths:
subprocess.check_call(
[
"/usr/bin/codesign",
"--force",
"--sign",
os.getenv("SIGNING_IDENTITY", "no-signing-ident"),
"--keychain",
os.getenv("KEYCHAIN", "no-keychain-path"),
str(filepath),
"--deep",
"--timestamp",
],
env=os.environ,
)
# create a zip of the dylibs and upload for notarization
zip_name = "{}.zip".format(project)
subprocess.check_call(
["/usr/bin/ditto", "-c", "-k", "--keepParent"]
+ [str(f) for f in filepaths]
+ [zip_name],
env=os.environ,
)
# make sure keychain is unlocked
subprocess.check_call(
[
"/usr/bin/security",
"unlock-keychain",
"-p",
os.getenv("KEYCHAIN_PASSWORD", "no-keychain-password"),
os.getenv("KEYCHAIN", "no-keychain-path"),
],
env=os.environ,
)
subprocess.check_call(
[
"/usr/bin/xcrun",
"notarytool",
"submit",
"--keychain",
os.getenv("KEYCHAIN", "no-keychain-path"),
"--keychain-profile",
os.getenv("KEYCHAIN_PROFILE", "no-keychain-profile"),
"--wait",
str(zip_name),
],
env=os.environ,
)
# check notarization of a file (should be in-progress atm and this != 0)
subprocess.call(
["/usr/sbin/spctl", "--assess", "-vv", "--type", "install", filepaths[-1]],
env=os.environ,
)

22
.github/scripts/compile_all_deps.py vendored Executable file
View File

@ -0,0 +1,22 @@
#!/usr/bin/env python3
import os
from common import (
run_kiwix_build,
make_deps_archive,
upload,
COMPILE_CONFIG,
DEV_BRANCH,
)
from build_definition import select_build_targets, DEPS
for target in select_build_targets(DEPS):
run_kiwix_build(target, config=COMPILE_CONFIG, build_deps_only=True)
archive_file = make_deps_archive(target=target)
if DEV_BRANCH:
destination = "/data/tmp/ci/dev_preview/" + DEV_BRANCH
else:
destination = "/data/tmp/ci"
upload(archive_file, "ci@tmp.kiwix.org:30022", destination)
os.remove(str(archive_file))

72
.github/scripts/ensure_base_deps.py vendored Executable file
View File

@ -0,0 +1,72 @@
#!/usr/bin/env python3
import os
import tarfile
from urllib.request import urlopen
from urllib.error import URLError
from kiwixbuild.versions import base_deps_meta_version
from common import (
print_message,
run_kiwix_build,
upload,
make_deps_archive,
HOME,
COMPILE_CONFIG,
OS_NAME,
MAKE_RELEASE,
)
def download_base_archive(base_name):
url = "http://tmp.kiwix.org/ci/{}".format(base_name)
file_path = str(HOME / base_name)
batch_size = 1024 * 1024 * 8
with urlopen(url) as resource, open(file_path, "wb") as file:
while True:
batch = resource.read(batch_size)
if not batch:
break
print(".", end="", flush=True)
file.write(batch)
return file_path
def get_archive_name():
ARCHIVE_NAME_TEMPLATE = "base_deps_{os}_{config}_{version}.tar.gz"
if COMPILE_CONFIG == "flatpak":
return "base_deps_flatpak.tar.gz"
return ARCHIVE_NAME_TEMPLATE.format(
os=OS_NAME,
config=COMPILE_CONFIG,
version=base_deps_meta_version,
)
def main():
base_dep_archive_name = get_archive_name()
print_message("Getting archive {}", base_dep_archive_name)
try:
local_filename = download_base_archive(base_dep_archive_name)
with tarfile.open(local_filename) as f:
f.extractall(str(HOME))
os.remove(str(local_filename))
except URLError:
if COMPILE_CONFIG == "flatpak":
print_message("Cannot get archive. Move on")
else:
print_message("Cannot get archive. Build dependencies")
run_kiwix_build("alldependencies", config=COMPILE_CONFIG)
archive_file = make_deps_archive(name=base_dep_archive_name, full=True)
upload(archive_file, "ci@tmp.kiwix.org:30022", "/data/tmp/ci")
os.remove(str(archive_file))
if __name__ == "__main__":
if MAKE_RELEASE:
print_message("We are building release. Don't download deps archive.")
else:
main()

17
.github/scripts/trigger_docker_workflow.py vendored Executable file
View File

@ -0,0 +1,17 @@
#!/usr/bin/env python3
from common import (
trigger_docker_publish,
MAKE_RELEASE,
)
from build_definition import select_build_targets, DOCKER
# Filter what to build if we are doing a release.
if MAKE_RELEASE:
docker_trigger = select_build_targets(DOCKER)
else:
docker_trigger = []
for target in docker_trigger:
trigger_docker_publish(target)

18
.github/scripts/upload_failure_logs.py vendored Executable file
View File

@ -0,0 +1,18 @@
#!/usr/bin/env python3
import tarfile
from pathlib import Path
from common import upload, OS_NAME, COMPILE_CONFIG, HOME
ARCHIVE_NAME = Path(f"fail_log_{OS_NAME}_{COMPILE_CONFIG}.tar.gz")
files_to_archive = []
files_to_archive += HOME.glob("BUILD_*")
files_to_archive += [HOME / "SOURCE", HOME / "LOGS", HOME / "TOOLCHAINS"]
with tarfile.open(ARCHIVE_NAME, "w:xz") as tar:
for name in set(files_to_archive):
tar.add(str(name))
upload(ARCHIVE_NAME, "ci@tmp.kiwix.org:30022", "/data/tmp/ci")

326
.github/workflows/cd.yml vendored Normal file
View File

@ -0,0 +1,326 @@
name: CD
on:
push:
tags:
- r_[0-9]+
schedule:
- cron: '0 3 * * *'
jobs:
Windows:
strategy:
fail-fast: false
matrix:
config:
- native_mixed
- native_dyn
- native_static
runs-on: windows-2022
env:
OS_NAME: windows
COMPILE_CONFIG: ${{matrix.config}}
HOME: 'C:\\Users\\runneradmin'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install packages
run: |
choco.exe install pkgconfiglite ninja
- name: Install python modules
shell: bash
run: |
pip3 install meson pytest requests distro paramiko
pip3 install --no-deps $GITHUB_WORKSPACE
- name: Install QT
if: ${{ matrix.config == 'native_mixed' }}
uses: jurplel/install-qt-action@v4
with:
version: 5.15.2
modules: "qtwebengine"
setup-python: false
env:
AQT_CONFIG: ${{ github.workspace }}/.github/configs/aqt.ini
- name: Setup MSVC compiler
uses: bus1/cabuild/action/msdevshell@v1
with:
architecture: x64
- name: secret
shell: bash
run: |
echo "${{secrets.ssh_key}}" > $SSH_KEY
env:
SSH_KEY: ${{ runner.temp }}/id_rsa
- name: Install and configure eSigner CKA and Windows SDK
if: github.event_name == 'push'
env:
ESIGNER_URL: https://github.com/SSLcom/eSignerCKA/releases/download/v1.0.7/SSL.COM-eSigner-CKA_1.0.7.zip
run: |
Set-StrictMode -Version 'Latest'
# Download and Unzip eSignerCKA Setup
Invoke-WebRequest -OutFile eSigner_CKA_Setup.zip "$env:ESIGNER_URL"
Expand-Archive -Force eSigner_CKA_Setup.zip
Remove-Item eSigner_CKA_Setup.zip
Move-Item -Destination “eSigner_CKA_Installer.exe” -Path “eSigner_CKA_*\*.exe”
# Install eSignerCKA
New-Item -ItemType Directory -Force -Path "C:\esigner"
./eSigner_CKA_Installer.exe /CURRENTUSER /VERYSILENT /SUPPRESSMSGBOXES /DIR=”C:\esigner” /TYPE=automatic | Out-Null
Remove-Item "eSigner_CKA_Installer.exe"
# Configure the CKA with SSL.com credentials
C:\esigner\eSignerCKATool.exe config -mode product -user "${{ secrets.ESIGNER_USERNAME }}" -pass "${{ secrets.ESIGNER_PASSWORD }}" -totp "${{ secrets.ESIGNER_TOTP_SECRET }}" -key "C:\esigner\master.key" -r
C:\esigner\eSignerCKATool.exe unload
C:\esigner\eSignerCKATool.exe load
# Find certificate
$CodeSigningCert = Get-ChildItem Cert:\CurrentUser\My -CodeSigningCert | Select-Object -First 1
echo Certificate: $CodeSigningCert
# Extract thumbprint and subject name
$Thumbprint = $CodeSigningCert.Thumbprint
echo "SIGNTOOL_THUMBPRINT=$Thumbprint" >> $env:GITHUB_ENV
- name: Ensure base deps
run: |
python .github\\scripts\\ensure_base_deps.py
env:
SSH_KEY: ${{ runner.temp }}/id_rsa
- name: Build Release
run: |
python .github\\scripts\\build_release_nightly.py
env:
SIGNTOOL_PATH: "C:/Program Files (x86)/Windows Kits/10/bin/10.0.22621.0/x86/signtool.exe"
SSH_KEY: ${{ runner.temp }}/id_rsa
- name: Upload failure logs
if: failure()
run: |
python .github\\scripts\\upload_failure_logs.py
env:
SSH_KEY: ${{ runner.temp }}/id_rsa
Linux:
strategy:
fail-fast: false
matrix:
config:
- native_static
- native_mixed
- native_dyn
- wasm
- armv6_static
- armv6_mixed
- armv8_static
- armv8_mixed
- aarch64_static
- aarch64_mixed
- aarch64_musl_static
- aarch64_musl_mixed
- x86-64_musl_static
- x86-64_musl_mixed
- i586_static
- android_arm
- android_arm64
- android_x86
- android_x86_64
image_variant: ['focal']
include:
- config: native_mixed
image_variant: manylinux
- config: aarch64_mixed
image_variant: manylinux
- config: native_dyn
image_variant: jammy
env:
HOME: /home/runner
SSH_KEY: /tmp/id_rsa
runs-on: ubuntu-22.04
container:
image: "ghcr.io/kiwix/kiwix-build_ci_${{matrix.image_variant}}:2024-11-30"
options: "--device /dev/fuse --privileged"
steps:
- name: Checkout code
shell: bash
run: |
cd $HOME
git clone https://github.com/${REP}
cd ./${REP##*/}
git checkout --force ${GITHUB_SHA}
pip3 install --user --no-deps .
env:
REP: ${{github.repository}}
- name: secret
shell: bash
run: |
echo "${{secrets.ssh_key}}" > $SSH_KEY
chmod 600 $SSH_KEY
- name: Ensure base deps
shell: bash
run: |
cd $HOME
kiwix-build/.github/scripts/ensure_base_deps.py
env:
COMPILE_CONFIG: ${{matrix.config}}
- name: Build release
shell: bash
run: |
cd $HOME
kiwix-build/.github/scripts/build_release_nightly.py
env:
COMPILE_CONFIG: ${{matrix.config}}
- name: Upload failure logs
if: failure()
run: $HOME/kiwix-build/.github/scripts/upload_failure_logs.py
env:
COMPILE_CONFIG: ${{matrix.config}}
Flatpak:
strategy:
fail-fast: false
env:
HOME: /home/runner
SSH_KEY: /tmp/id_rsa
COMPILE_CONFIG: flatpak
OS_NAME: focal
runs-on: ubuntu-22.04
steps:
- name: Checkout code
shell: bash
run: |
cd $HOME
git clone https://github.com/${REP}
cd ./${REP##*/}
git checkout --force ${GITHUB_SHA}
pip3 install --user --no-deps .
env:
REP: ${{github.repository}}
- name: Install flatpak tools
run: |
sudo apt-get update
sudo apt-get install flatpak-builder ninja-build meson
- name: secret
shell: bash
run: |
echo "${{secrets.ssh_key}}" > $SSH_KEY
chmod 600 $SSH_KEY
- name: Ensure base deps
shell: bash
run: |
cd $HOME
kiwix-build/.github/scripts/ensure_base_deps.py
- name: Build release
shell: bash
run: |
cd $HOME
kiwix-build/.github/scripts/build_release_nightly.py
- name: Upload failure logs
if: failure()
run: $HOME/kiwix-build/.github/scripts/upload_failure_logs.py
Macos:
strategy:
fail-fast: false
matrix:
config:
- native_dyn
- native_static
- native_mixed
- macOS_arm64_static
- macOS_arm64_mixed
- apple_all_static
runs-on: macos-13
env:
SSH_KEY: /tmp/id_rsa
OS_NAME: macos
CERTIFICATE: /tmp/wmch-devid.p12
SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
KEYCHAIN: /Users/runner/build.keychain-db
KEYCHAIN_PASSWORD: mysecretpassword
KEYCHAIN_PROFILE: build-profile
steps:
- name: Set Xcode version (15.0.1)
# https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md#xcode
run: sudo xcode-select -s /Applications/Xcode_15.0.1.app
- name: Checkout code
uses: actions/checkout@v4
- name: Setup python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install packages
run:
brew install automake # ninja
- name: Install python modules
run: |
pip3 install meson pytest requests distro
pip3 install --no-deps $GITHUB_WORKSPACE
- name: secret
shell: bash
run: |
echo "${{secrets.ssh_key}}" > $SSH_KEY
chmod 600 $SSH_KEY
- name: install Apple certificate
shell: bash
run: |
echo "${{ secrets.APPLE_SIGNING_CERTIFICATE }}" | base64 --decode -o $CERTIFICATE
security create-keychain -p $KEYCHAIN_PASSWORD $KEYCHAIN
security default-keychain -s $KEYCHAIN
security set-keychain-settings $KEYCHAIN
security unlock-keychain -p $KEYCHAIN_PASSWORD $KEYCHAIN
security import $CERTIFICATE -k $KEYCHAIN -P "${{ secrets.APPLE_SIGNING_P12_PASSWORD }}" -A -T "/usr/bin/codesign"
rm $CERTIFICATE
security set-key-partition-list -S apple-tool:,apple: -s -k $KEYCHAIN_PASSWORD $KEYCHAIN
security find-identity -v $KEYCHAIN
xcrun notarytool store-credentials \
--apple-id "${{ secrets.APPLE_SIGNING_ALTOOL_USERNAME }}" \
--password "${{ secrets.APPLE_SIGNING_ALTOOL_PASSWORD }}" \
--team-id "${{ secrets.APPLE_SIGNING_TEAM }}" \
--validate \
--keychain $KEYCHAIN \
$KEYCHAIN_PROFILE
- name: Ensure base deps
shell: bash
run: |
cd $HOME
$GITHUB_WORKSPACE/.github/scripts/ensure_base_deps.py
env:
COMPILE_CONFIG: ${{matrix.config}}
- name: Build release
shell: bash
run: |
cd $HOME
$GITHUB_WORKSPACE/.github/scripts/build_release_nightly.py
env:
COMPILE_CONFIG: ${{matrix.config}}
- name: Upload failure logs
if: failure()
run: $GITHUB_WORKSPACE/.github/scripts/upload_failure_logs.py
env:
COMPILE_CONFIG: ${{matrix.config}}
Trigger_Docker:
needs: [Linux]
runs-on: ubuntu-22.04
env:
COMPILE_CONFIG: native_static
OS_NAME: focal
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install python modules
shell: bash
run: |
pip3 install --user --no-deps $GITHUB_WORKSPACE
- name: Trigger docker workflow
shell: bash
run: |
cd $HOME
$GITHUB_WORKSPACE/.github/scripts/trigger_docker_workflow.py
env:
GITHUB_PAT: ${{secrets.DOCKER_TRIGGER_GITHUB_PAT}}

280
.github/workflows/ci.yml vendored Normal file
View File

@ -0,0 +1,280 @@
name: CI
on:
push:
schedule:
- cron: '0 1 * * *'
jobs:
Windows:
strategy:
fail-fast: false
matrix:
config:
- native_mixed
- native_dyn
- native_static
runs-on: windows-2022
env:
OS_NAME: windows
COMPILE_CONFIG: ${{matrix.config}}
HOME: 'C:\\Users\\runneradmin'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install packages
run: |
choco.exe install pkgconfiglite ninja
- name: Install python modules
shell: bash
run: |
pip3 install meson pytest requests distro paramiko
pip3 install --no-deps $GITHUB_WORKSPACE
- name: Install QT
if: ${{ matrix.config == 'native_mixed' }}
uses: jurplel/install-qt-action@v4
with:
version: 6.4.3
modules: "qtwebengine qtwebchannel qtpositioning"
setup-python: false
env:
AQT_CONFIG: ${{ github.workspace }}/.github/configs/aqt.ini
- name: Setup MSVC compiler
uses: bus1/cabuild/action/msdevshell@v1
with:
architecture: x64
- name: secret
shell: bash
run: |
echo "${{secrets.ssh_key}}" > $SSH_KEY
env:
SSH_KEY: ${{ runner.temp }}/id_rsa
- name: Ensure base deps
run: |
python .github\\scripts\\ensure_base_deps.py
env:
SSH_KEY: ${{ runner.temp }}/id_rsa
- name: Compile all deps
run: |
python .github\\scripts\\compile_all_deps.py
env:
SSH_KEY: ${{ runner.temp }}/id_rsa
- name: Build projects
run: |
python .github\\scripts\\build_projects.py
env:
SSH_KEY: ${{ runner.temp }}/id_rsa
- name: Upload failure logs
if: failure()
run: |
python .github\\scripts\\upload_failure_logs.py
env:
SSH_KEY: ${{ runner.temp }}/id_rsa
Linux:
strategy:
fail-fast: false
matrix:
config:
- native_static
- native_dyn
- native_mixed
- wasm
- armv6_static
- armv6_dyn
- armv6_mixed
- armv8_static
- armv8_dyn
- armv8_mixed
- aarch64_static
- aarch64_dyn
- aarch64_mixed
- aarch64_musl_static
- aarch64_musl_dyn
- aarch64_musl_mixed
- x86-64_musl_static
- x86-64_musl_mixed
- i586_static
- i586_dyn
- android_arm
- android_arm64
- android_x86
- android_x86_64
image_variant: ['focal']
include:
- config: native_mixed
image_variant: manylinux
- config: aarch64_mixed
image_variant: manylinux
- config: native_dyn
image_variant: jammy
env:
HOME: /home/runner
SSH_KEY: /tmp/id_rsa
OS_NAME: ${{matrix.image_variant}}
runs-on: ubuntu-22.04
container:
image: "ghcr.io/kiwix/kiwix-build_ci_${{matrix.image_variant}}:2024-11-30"
options: "--device /dev/fuse --privileged"
steps:
- name: Checkout code
shell: bash
run: |
cd $HOME
git clone https://github.com/${REP}
cd ./${REP##*/}
git checkout --force ${GITHUB_SHA}
pip3 install --user --no-deps .
env:
REP: ${{github.repository}}
- name: Install paramiko
if: ${{matrix.image_variant != 'bionic' }}
shell: bash
run: pip3 install --user paramiko
- name: secret
shell: bash
run: |
echo "${{secrets.ssh_key}}" > $SSH_KEY
chmod 600 $SSH_KEY
- name: Ensure base deps
shell: bash
run: |
cd $HOME
kiwix-build/.github/scripts/ensure_base_deps.py
env:
COMPILE_CONFIG: ${{matrix.config}}
- name: Compile all deps
shell: bash
run: |
cd $HOME
kiwix-build/.github/scripts/compile_all_deps.py
env:
COMPILE_CONFIG: ${{matrix.config}}
- name: Build projects
shell: bash
run: |
cd $HOME
kiwix-build/.github/scripts/build_projects.py
env:
COMPILE_CONFIG: ${{matrix.config}}
- name: Upload failure logs
if: failure()
run: $HOME/kiwix-build/.github/scripts/upload_failure_logs.py
env:
COMPILE_CONFIG: ${{matrix.config}}
Flatpak:
strategy:
fail-fast: false
env:
HOME: /home/runner
SSH_KEY: /tmp/id_rsa
COMPILE_CONFIG: flatpak
OS_NAME: focal
runs-on: ubuntu-22.04
steps:
- name: Checkout code
shell: bash
run: |
cd $HOME
git clone https://github.com/${REP}
cd ./${REP##*/}
git checkout --force ${GITHUB_SHA}
pip3 install --user paramiko
pip3 install --user --no-deps .
env:
REP: ${{github.repository}}
- name: Install flatpak tools
run: |
sudo apt-get update
sudo apt-get install flatpak-builder ninja-build meson
- name: secret
shell: bash
run: |
echo "${{secrets.ssh_key}}" > $SSH_KEY
chmod 600 $SSH_KEY
- name: Ensure base deps
shell: bash
run: |
cd $HOME
kiwix-build/.github/scripts/ensure_base_deps.py
- name: Build projects
shell: bash
run: |
cd $HOME
kiwix-build/.github/scripts/build_projects.py
- name: Upload failure logs
if: failure()
run: $HOME/kiwix-build/.github/scripts/upload_failure_logs.py
Macos:
strategy:
fail-fast: false
matrix:
config:
- native_dyn
- native_static
- native_mixed
- iOS_arm64
- iOSSimulator_x86_64
- iOSSimulator_arm64
- macOS_arm64_static
- macOS_arm64_mixed
- macOS_x86_64
- apple_all_static
runs-on: macos-13
env:
SSH_KEY: /tmp/id_rsa
OS_NAME: macos
steps:
- name: Set Xcode version (15.0.1)
# https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md#xcode
run: sudo xcode-select -s /Applications/Xcode_15.0.1.app
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install packages
run:
brew install automake # ninja
- name: Install python modules
run: |
pip3 install meson pytest requests distro paramiko
pip3 install --no-deps $GITHUB_WORKSPACE
- name: secret
shell: bash
run: |
echo "${{secrets.ssh_key}}" > $SSH_KEY
chmod 600 $SSH_KEY
- name: Ensure base deps
shell: bash
run: |
cd $HOME
$GITHUB_WORKSPACE/.github/scripts/ensure_base_deps.py
env:
COMPILE_CONFIG: ${{matrix.config}}
- name: Compile all deps
shell: bash
run: |
cd $HOME
$GITHUB_WORKSPACE/.github/scripts/compile_all_deps.py
env:
COMPILE_CONFIG: ${{matrix.config}}
- name: Build projects
shell: bash
run: |
cd $HOME
$GITHUB_WORKSPACE/.github/scripts/build_projects.py
env:
COMPILE_CONFIG: ${{matrix.config}}
- name: Upload failure logs
if: failure()
run: $GITHUB_WORKSPACE/.github/scripts/upload_failure_logs.py
env:
COMPILE_CONFIG: ${{matrix.config}}

1
.gitignore vendored
View File

@ -109,3 +109,4 @@ ENV/
# mypy
.mypy_cache/
.idea

View File

@ -1,91 +0,0 @@
language: cpp
dist: trusty
sudo: required
branches:
only:
- master
- /\d+\.\d+\.\d+$/
before_install:
- eval "${MATRIX_EVAL}"
- ${CXX} --version
- openssl aes-256-cbc -K $encrypted_eba2f7543984_key -iv $encrypted_eba2f7543984_iv
-in travis/travisci_builder_id_key.enc -out travis/travisci_builder_id_key -d
- chmod 600 travis/travisci_builder_id_key
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
cache:
ccache: true
directories:
- $HOME/.cache/pip
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
- $HOME/.android/build-cache
install: travis/install_extra_deps.sh
script: travis/compile_all.py
after_failure: travis/upload_all_log.sh
deploy:
- provider: script
skip_cleanup: true
script: travis/deploy.sh
on:
tags: true
- provider: script
skip_cleanup: true
script: travis/deploy.sh
on:
branch: master
condition: $TRAVIS_EVENT_TYPE = cron
env:
global:
- MATRIX_EVAL="CC=gcc-5 && CXX=g++-5"
matrix:
- PLATFORM="native_dyn"
- PLATFORM="native_static"
- PLATFORM="win32_dyn"
- PLATFORM="win32_static"
- PLATFORM="armhf_dyn"
- PLATFORM="armhf_static"
- PLATFORM="android_arm"
- PLATFORM="android_arm64"
- PLATFORM="android_mips"
- PLATFORM="android_mips64"
- PLATFORM="android_x86"
- PLATFORM="android_x86_64"
matrix:
allow_failures:
- env: PLATFORM="android_arm"
- env: PLATFORM="android_arm64"
- env: PLATFORM="android_mips"
- env: PLATFORM="android_mips64"
- env: PLATFORM="android_x86"
- env: PLATFORM="android_x86_64"
notifications:
irc:
channels:
- "chat.freenode.net#kiwix"
on_success: change
on_failure: always
addons:
ssh_known_hosts:
- download.kiwix.org
- download.openzim.org
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-5
- cmake
- python3-pip
- zlib1g-dev
- libjpeg-dev
- libmagic-dev
- ctpp2-utils
- libctpp2-dev
- libmicrohttpd-dev
- g++-mingw-w64-i686
- gcc-mingw-w64-i686
- gcc-mingw-w64-base
- mingw-w64-tools
- default-jdk

3
MANIFEST.in Normal file
View File

@ -0,0 +1,3 @@
include kiwixbuild/templates/*_cross_file.txt
include kiwixbuild/patches/*.patch
include kiwixbuild/dependencies/icu4c_data_filter.json

245
README.md
View File

@ -1,104 +1,181 @@
Build status: [![Build Status](https://travis-ci.org/kiwix/kiwix-build.svg?branch=master)](https://travis-ci.org/kiwix/kiwix-build)
# Kiwix Build
Kiwix is an offline reader for web content. It's especially thought to
make Wikipedia available offline. This is done by reading the content
of the project stored in a file format ZIM, a high compressed open
format with additional meta-data.
Kiwix Build provides advanced tools to (cross-)compile easily
[Kiwix](https://kiwix.org) & [openZIM](https://openzim.org) softwares
and libraries and deploy them. They have been tested on
[Fedora](https://getfedora.org) 35+ & [Ubuntu](https://ubuntu.com)
20.04+.
This repository contains advanced tools to (cross-)compile easily
Kiwix softwares and library and deploy them. They have been tested on
Fedora 23 and Ubuntu 16.10.
Kiwix Build audience is:
* Advanced users who don't want/can handle all the dependencies
compilations manually
* Kiwix developer team for its own CI/CD
# Prerequesites
[![CI Build Status](https://github.com/kiwix/kiwix-build/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/kiwix/kiwix-build/actions/workflows/ci.yml?query=branch%3Amain)
[![CD Build Status](https://github.com/kiwix/kiwix-build/actions/workflows/cd.yml/badge.svg?branch=main)](https://github.com/kiwix/kiwix-build/actions/workflows/cd.yml?query=branch%3Amain)
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
You will need a recent version of `meson` (0.34) and `ninja` (1.6) If
your distribution provides a recent enough versions for them, just
install them with your package manager. Continue to read the
instructions otherwise.
Prerequisites
-------------
You will need a recent version of [Meson](https://mesonbuild.com/) (>=
0.34) and [Ninja](https://ninja-build.org) (>= 1.6) If your
distribution provides a recent enough versions for them, just install
them with your package manager. Continue to read the instructions
otherwise.
Before anything else you need to install Python3 related tools. On Debian
based systems:
```
```bash
sudo apt-get install python3-pip virtualenv
```
Then install Meson:
Create a virtual environment to install python module in it instead
of modifying the system.
```bash
virtualenv -p python3 ./ # Create virtualenv
source bin/activate # Activate the virtualenv
```
Then, download and install kiwix-build and its dependencies:
```bash
git clone https://github.com/kiwix/kiwix-build.git
cd kiwix-build
pip3 install .
hash -r # Refresh bash paths
```
Compilation
-----------
The compilation is handled by the `kiwix-build` command. It will compile
everything. If you are using a supported platform (Redhat or Debian
based) it will install missing packages using `sudo`. You can get
`kiwix-build` usage like this:
```bash
kiwix-build --help
```
#### Target
You may want to compile a specific target so you will have to specify it on the
command line:
```bash
kiwix-build libkiwix # will build kiwix-build and its dependencies
kiwix-build kiwix-desktop # will build kiwix-desktop and its dependencies
kiwix-build zim-tools # will build zim-tools and its dependencies
```
By default, `kiwix-build` will build `kiwix-tools` .
To see the whole list of available targets run with non existing target, ex:
```bash
kiwix-build not-existing-target
...
invalid choice: 'not-existing-target' (choose from 'alldependencies', 'android-ndk',
...
```
#### Config
If no config is specified, the default will be `native_dyn`.
You can select another config using the option
`--config`. For now, there is ten different supported
platforms:
- native_dyn
- native_mixed
- native_static
- android
- android_arm
- android_arm64
- android_x86
- android_x86_64
- flatpak
All `native_*` config means using the native compiler without any cross-compilation option.
Other may simply use cross-compilation or may download a specific toolchain to use.
Android
-------
`kiwix-android` (https://github.com/kiwix/kiwix-android) depends of
the `libkiwix` project.
When building `libkiwix`, you should directly use the
target-platform `android_<arch>`:
```bash
kiwix-build libkiwix --config android_arm
```
You may directly use the special config `android` which will build different android architectures
```bash
kiwix-build --config android libkiwix
```
By default, it will build for all android architecture,
you can limit this with option `--android-arch`:
```bash
kiwix-build libkiwix --config android --android-arch arm # aar with arm architecture
kiwix-build libkiwix --config android --android-arch arm --android-arch arm64 # aan with arm and arm64 architectures
```
To build `kiwix-android` itself, you should see the documentation of `kiwix-android`.
iOS
---
When building for ios, we may want to compile a "fat library", a library
for several architectures.
To do so, you should directly use the target-platfrom `ios_multi`.
As for `android`, `kiwix-build` will build the library several times
(once for each platform) and then create the fat library.
```bash
kiwix-build --config iOS_multi libkiwix
```
You can specify the supported architectures with the option `--ios-arch`:
```bash
kiwix-build --config iOS_multi libkiwix # all architetures
kiwix-build --config iOS_multi --ios-arch arm --ios-arch arm64 # arm and arm64 arch only
```
Outputs
-------
Kiwix-build.py will create several directories:
- `ARCHIVES`: All the downloaded archives go there.
- `SOURCES`: All the sources (extracted from archives and patched) go there.
- `BUILD_<config>`: All the build files go there.
- `BUILD_<config>/INSTALL`: The installed files go there.
- `BUILD_<config>/LOGS`: The logs files of the build.
If you want to install all those directories elsewhere, you can pass the
`--working-dir` option to `kiwix-build`:
Troubleshooting
---------------
If you need to install [Meson](https://mesonbuild.com/) "manually":
```bash
virtualenv -p python3 ./ # Create virtualenv
source bin/activate # Activate the virtualenv
pip3 install meson # Install Meson
hash -r # Refresh bash paths
```
Finally we need the Ninja tool (available in the $PATH). Here is a
solution to download, build and install it locally:
```
git clone git://github.com/ninja-build/ninja.git
cd ninja
git checkout release
./configure.py --bootstrap
mkdir ../bin
cp ninja ../bin
cd ..
If you need to install [Ninja](https://ninja-build.org) "manually":
```bash
wget https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-linux.zip
unzip ninja-linux.zip ninja -d $HOME/bin
```
# Compilation
License
-------
The compilation is handled by `kiwix-build.py`. It will compile
everything. If you are using a supported platform (Redhat or Debian
based) it will install missing packages using `sudo`. You can get
`kiwix-build.py` usage like this:
```
./kiwix-build.py -h
```
## Target
By default, `kiwix-build.py` will build `kiwix-tools`. If you want to
compile another target only (let's said kiwixlib), you can specify it:
```
./kiwix-build Kiwixlib
```
## Target platform
By default, `kiwix-build.py` will build everything for the current (native)
platform using dynamic linkage (hence the `native_dyn` of the
BUILD_native_dyn directory).
But you can select another target platform using the option
`target-platform`. For now, there is ten different supported
platforms :
- native_dyn
- native_static
- win32_dyn
- win32_static
- android_arm
- android_arm64
- android_mips
- android_mips64
- android_x86
- android_x86_64
So, if you want to compile for win32 using static linkage:
```
./kiwix-build.py --target-platform win32_dyn
```
# Outputs
Kiwix-build.py will create several directories:
- `ARCHIVES`: All the downloaded archives go there.
- `SOURCES`: All the sources (extracted from archives and patched) go there.
- `BUILD_native_dyn`: All the build files go there.
- `BUILD_native_dyn/INSTALL`: The installed files go there.
- `BUILD_native_dyn/LOGS`: The logs files of the build.
If you want to install all those directories elsewhere, you can pass the
`--working-dir` option to `kiwix-build.py`:
[GPLv3](https://www.gnu.org/licenses/gpl-3.0) or later, see
[LICENSE](LICENSE) for more details.

1
actions/dl_deps_archive/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
node_modules

View File

@ -0,0 +1,55 @@
# Download dependencies archive action
This action download dependencies archive made by kiwix-build.
It is intended to be used in projects using theses dependencies
## Inputs
### `base_url`
The base url where we can download the archive.
This input is provided for greater customization but you probably shouldn't set it.
### `os_name`
The os "name" on which the compilation is done.
By default this use the `OS_NAME` env var, which is set in the docker file.
### `target_platform`
**Required** The targeted platform. Must be provided. Values are kind of :
- native_dyn
- android_arm
- ...
### `project`
The name of the project being compiled.
By default, the name of the repository.
### `branch`
The name of the "branch" to try to download (`/dev_preview/<branch>`).
By default, the current branch on which the action is run.
### `extract_dir`
Where to extract the dependencies archive. By default it is `$HOME`
## Example usage
```yaml
uses: kiwix/kiwix-build/actions/dl_deps_archive@main
with:
target_platform: ${{ matrix.target_platform }}
```
```
uses: kiwix/kiwix-build/actions/dl_deps_archive@main
with:
target_platform: native_mixed
os_name: windows
```

View File

@ -0,0 +1,25 @@
name: 'DL deps archive'
description: 'Download the dependencies archive of the project'
inputs:
base_url: # id of input
description: 'What is the base url to download the archive'
required: false
default: 'https://tmp.kiwix.org/ci'
os_name:
description: "On which os are we running. [Default to env var `OS_NAME`]"
required: false
target_platform:
description: "What platform are we targetting"
required: true
project:
description: "What project are we building"
required: false
branch:
description: "On which branch are we ?"
required: false
extract_dir:
description: "Where to extract our dependencies. [Default to env var `HOME`]"
required: false
runs:
using: 'node20'
main: 'dist/index.js'

30531
actions/dl_deps_archive/dist/index.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,59 @@
const tc = require("@actions/tool-cache");
const core = require("@actions/core");
const path = require("path");
const os = require("os");
function getInput(name, dflt) {
const val = process.env[`INPUT_${name.replace(/ /g, "_").toUpperCase()}`];
if (!val) {
return dflt;
}
return val;
}
function addLocalPath(inputPath) {
process.env["PATH"] = `${inputPath}${path.delimiter}${process.env["PATH"]}`;
}
async function run() {
try {
const base_url = core.getInput("base_url");
const target = core.getInput("target_platform");
const project = getInput(
"project",
process.env["GITHUB_REPOSITORY"].split("/")[1],
);
const branch = getInput(
"branch",
process.env["GITHUB_HEAD_REF"] || process.env["GITHUB_REF_NAME"],
);
const extract_dir = getInput(
"extract_dir",
process.env["HOME"] || process.env["GITHUB_WORKSPACE"],
);
let archivePath;
try {
const archive_url = `${base_url}/dev_preview/${branch}/deps_${target}_${project}.tar.gz`;
process.stdout.write("Downloading " + archive_url + "\n");
archivePath = await tc.downloadTool(archive_url);
} catch (error) {
const archive_url = `${base_url}/deps_${target}_${project}.tar.gz`;
process.stdout.write("Downloading " + archive_url + "\n");
archivePath = await tc.downloadTool(archive_url);
}
process.stdout.write("Extracting " + archivePath + " to " + extract_dir);
const archive_dir = await tc.extractTar(archivePath, extract_dir);
process.stdout.write("Extracted to " + archive_dir);
} catch (error) {
core.setFailed(error.message);
}
}
if (os.platform() === "win32") {
addLocalPath("C:\\Program Files\\Git\\usr\\bin");
}
core.setCommandEcho(true);
run();

144
actions/dl_deps_archive/package-lock.json generated Normal file
View File

@ -0,0 +1,144 @@
{
"name": "dl_deps_archive",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "dl_deps_archive",
"version": "1.0.0",
"license": "ISC",
"dependencies": {
"@actions/core": "^1.10.1",
"@actions/tool-cache": "^2.0.1",
"path": "^0.12.7"
}
},
"node_modules/@actions/core": {
"version": "1.10.1",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.1.tgz",
"integrity": "sha512-3lBR9EDAY+iYIpTnTIXmWcNbX3T2kCkAEQGIQx4NVQ0575nk2k3GRZDTPQG+vVtS2izSLmINlxXf0uLtnrTP+g==",
"dependencies": {
"@actions/http-client": "^2.0.1",
"uuid": "^8.3.2"
}
},
"node_modules/@actions/exec": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.1.1.tgz",
"integrity": "sha512-+sCcHHbVdk93a0XT19ECtO/gIXoxvdsgQLzb2fE2/5sIZmWQuluYyjPQtrtTHdU1YzTZ7bAPN4sITq2xi1679w==",
"dependencies": {
"@actions/io": "^1.0.1"
}
},
"node_modules/@actions/http-client": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.2.0.tgz",
"integrity": "sha512-q+epW0trjVUUHboliPb4UF9g2msf+w61b32tAkFEwL/IwP0DQWgbCMM0Hbe3e3WXSKz5VcUXbzJQgy8Hkra/Lg==",
"dependencies": {
"tunnel": "^0.0.6",
"undici": "^5.25.4"
}
},
"node_modules/@actions/io": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/@actions/io/-/io-1.1.3.tgz",
"integrity": "sha512-wi9JjgKLYS7U/z8PPbco+PvTb/nRWjeoFlJ1Qer83k/3C5PHQi28hiVdeE2kHXmIL99mQFawx8qt/JPjZilJ8Q=="
},
"node_modules/@actions/tool-cache": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/@actions/tool-cache/-/tool-cache-2.0.1.tgz",
"integrity": "sha512-iPU+mNwrbA8jodY8eyo/0S/QqCKDajiR8OxWTnSk/SnYg0sj8Hp4QcUEVC1YFpHWXtrfbQrE13Jz4k4HXJQKcA==",
"dependencies": {
"@actions/core": "^1.2.6",
"@actions/exec": "^1.0.0",
"@actions/http-client": "^2.0.1",
"@actions/io": "^1.1.1",
"semver": "^6.1.0",
"uuid": "^3.3.2"
}
},
"node_modules/@actions/tool-cache/node_modules/uuid": {
"version": "3.4.0",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz",
"integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==",
"deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.",
"bin": {
"uuid": "bin/uuid"
}
},
"node_modules/@fastify/busboy": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.0.tgz",
"integrity": "sha512-+KpH+QxZU7O4675t3mnkQKcZZg56u+K/Ct2K+N2AZYNVK8kyeo/bI18tI8aPm3tvNNRyTWfj6s5tnGNlcbQRsA==",
"engines": {
"node": ">=14"
}
},
"node_modules/inherits": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
"integrity": "sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw=="
},
"node_modules/path": {
"version": "0.12.7",
"resolved": "https://registry.npmjs.org/path/-/path-0.12.7.tgz",
"integrity": "sha512-aXXC6s+1w7otVF9UletFkFcDsJeO7lSZBPUQhtb5O0xJe8LtYhj/GxldoL09bBj9+ZmE2hNoHqQSFMN5fikh4Q==",
"dependencies": {
"process": "^0.11.1",
"util": "^0.10.3"
}
},
"node_modules/process": {
"version": "0.11.10",
"resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz",
"integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==",
"engines": {
"node": ">= 0.6.0"
}
},
"node_modules/semver": {
"version": "6.3.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
"integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
"bin": {
"semver": "bin/semver.js"
}
},
"node_modules/tunnel": {
"version": "0.0.6",
"resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz",
"integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==",
"engines": {
"node": ">=0.6.11 <=0.7.0 || >=0.7.3"
}
},
"node_modules/undici": {
"version": "5.28.4",
"resolved": "https://registry.npmjs.org/undici/-/undici-5.28.4.tgz",
"integrity": "sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g==",
"dependencies": {
"@fastify/busboy": "^2.0.0"
},
"engines": {
"node": ">=14.0"
}
},
"node_modules/util": {
"version": "0.10.4",
"resolved": "https://registry.npmjs.org/util/-/util-0.10.4.tgz",
"integrity": "sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==",
"dependencies": {
"inherits": "2.0.3"
}
},
"node_modules/uuid": {
"version": "8.3.2",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==",
"bin": {
"uuid": "dist/bin/uuid"
}
}
}
}

View File

@ -0,0 +1,17 @@
{
"name": "dl_deps_archive",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"@actions/core": "^1.10.1",
"@actions/tool-cache": "^2.0.1",
"path": "^0.12.7"
}
}

View File

@ -1,97 +0,0 @@
#!/usr/bin/perl
use utf8;
use strict;
use warnings;
use Getopt::Long;
# get the params
my $zim_url;
my $custom_app;
my $keystore;
my $api_key;
my $version = "0";
my $cmd;
# Get console line arguments
GetOptions('zim_url=s' => \$zim_url,
'custom_app=s' => \$custom_app,
'keystore=s' => \$keystore,
'api_key=s' => \$api_key,
'version=s' => \$version
);
# Print usage() if necessary
if (!$zim_url || !$custom_app || !$keystore || !$api_key) {
print "usage: ./build_custom_app.pl --keystore=kiwix-android.keystore --api_key=google.json --zim_url=\"https://download.kiwix.org/zim/wikipedia_en_medicine_novid.zim\" --custom_app=wikimed [--version=1]\n";
exit;
}
# Clean signed ap
$cmd = "rm ./signed_apks/*apk"; `$cmd`;
# Download ZIM file
$cmd = "wget \"$zim_url\" -O content.zim"; `$cmd`;
# Get ZIM file size
$cmd = "stat -c %s content.zim";
my $zim_size = `$cmd` =~ s/\n//gr ;
$ENV{ZIM_SIZE} = $zim_size;
# Compute version code base
$cmd = "date +%y%j";
my $version_code_base = `$cmd` =~ s/\n//gr . $version;
# Compute content version code
my $content_version_code = $version_code_base;
$ENV{CONTENT_VERSION_CODE} = $content_version_code;
# Compute custom app date
$cmd = "date +%Y-%m";
my $date = `$cmd` =~ s/\n//gr;
$ENV{VERSION_NAME} = $date;
# Compile apps
$ENV{VERSION_CODE} = $version_code_base;
$cmd = "./kiwix-build.py --target-platform android_arm --android-custom-app $custom_app --zim-file-size $zim_size kiwix-android-custom"; system $cmd;
$ENV{VERSION_CODE} = "1" . $version_code_base;
$cmd = "./kiwix-build.py --target-platform android_arm64 --android-custom-app $custom_app --zim-file-size $zim_size kiwix-android-custom"; system $cmd;
$ENV{VERSION_CODE} = "2" . $version_code_base;
$cmd = "./kiwix-build.py --target-platform android_x86 --android-custom-app $custom_app --zim-file-size $zim_size kiwix-android-custom"; system $cmd;
$ENV{VERSION_CODE} = "3" . $version_code_base;
$cmd = "./kiwix-build.py --target-platform android_x86_64 --android-custom-app $custom_app --zim-file-size $zim_size kiwix-android-custom"; system $cmd;
$ENV{VERSION_CODE} = "4" . $version_code_base;
$cmd = "./kiwix-build.py --target-platform android_mips --android-custom-app $custom_app --zim-file-size $zim_size kiwix-android-custom"; system $cmd;
$ENV{VERSION_CODE} = "5" . $version_code_base;
$cmd = "./kiwix-build.py --target-platform android_mips64 --android-custom-app $custom_app --zim-file-size $zim_size kiwix-android-custom"; system $cmd;
# Sign apps
$cmd = "./TOOLCHAINS/android-sdk-r25.2.3/build-tools/25.0.2/apksigner sign -ks \"${keystore}\" --out signed_apks/app-${version_code_base}-release-signed.apk BUILD_android_arm/kiwix-android-custom_${custom_app}/app/build/outputs/apk/${custom_app}/release/app-${custom_app}-release-unsigned.apk";
system $cmd;
$cmd = "./TOOLCHAINS/android-sdk-r25.2.3/build-tools/25.0.2/apksigner sign -ks \"${keystore}\" --out signed_apks/app-1${version_code_base}-release-signed.apk BUILD_android_arm64/kiwix-android-custom_${custom_app}/app/build/outputs/apk/${custom_app}/release/app-${custom_app}-release-unsigned.apk";
system $cmd;
$cmd = "./TOOLCHAINS/android-sdk-r25.2.3/build-tools/25.0.2/apksigner sign -ks \"${keystore}\" --out signed_apks/app-2${version_code_base}-release-signed.apk BUILD_android_x86/kiwix-android-custom_${custom_app}/app/build/outputs/apk/${custom_app}/release/app-${custom_app}-release-unsigned.apk";
system $cmd;
$cmd = "./TOOLCHAINS/android-sdk-r25.2.3/build-tools/25.0.2/apksigner sign -ks \"${keystore}\" --out signed_apks/app-3${version_code_base}-release-signed.apk BUILD_android_x86_64/kiwix-android-custom_${custom_app}/app/build/outputs/apk/${custom_app}/release/app-${custom_app}-release-unsigned.apk";
system $cmd;
$cmd = "./TOOLCHAINS/android-sdk-r25.2.3/build-tools/25.0.2/apksigner sign -ks \"${keystore}\" --out signed_apks/app-4${version_code_base}-release-signed.apk BUILD_android_mips/kiwix-android-custom_${custom_app}/app/build/outputs/apk/${custom_app}/release/app-${custom_app}-release-unsigned.apk";
system $cmd;
$cmd = "./TOOLCHAINS/android-sdk-r25.2.3/build-tools/25.0.2/apksigner sign -ks \"${keystore}\" --out signed_apks/app-5${version_code_base}-release-signed.apk BUILD_android_mips64/kiwix-android-custom_${custom_app}/app/build/outputs/apk/${custom_app}/release/app-${custom_app}-release-unsigned.apk";
system $cmd;
# Upload
$cmd = "./build_custom_app.py --step publish --custom-app ${custom_app} --google-api-key ${api_key} --zim-path content.zim --apks-dir signed_apks --content-version-code ${content_version_code}";
system $cmd;
exit;

View File

@ -1,430 +0,0 @@
#!/usr/bin/env python3
import \
argparse, \
datetime, \
glob, \
json, \
os, \
ssl, \
sys, \
tempfile, \
time, \
urllib
from uuid import uuid4
from contextlib import contextmanager
from urllib.parse import urlparse
from utils import (
Remotefile,
download_remote
)
import requests
import httplib2
from apiclient.discovery import build
from apiclient.errors import HttpError
from oauth2client import client
from oauth2client.service_account import ServiceAccountCredentials
tmpl_request_url = "https://api.travis-ci.org/repo/{organisation}%2F{repository}/{endpoint}"
tmpl_message = """Build of custom app {app} with zim file {zim}.
UUID:#{uuid}#"""
description = """Launch a custom application build.
This command will launch a custom application build on Travis-CI.
Travis-CI jobs will compile the application and upload the build apks on
google play, using tha 'alpha' track of the application.
You will need to have a valid TRAVIS_TOKEN associated to your personnal account
and the kiwix-build repository on travis.
Use the 'travis' command line tool (https://github.com/travis-ci/travis.rb)
to generate a token.
"""
def parse_args():
parser = argparse.ArgumentParser(description=description,
formatter_class=argparse.RawDescriptionHelpFormatter)
parser.add_argument('--custom-app')
parser.add_argument('--travis-token')
advance = parser.add_argument_group('advance', "Some advanced options.")
advance.add_argument('--extra-code', type=int, default=0)
advance.add_argument('--version-name', default=None,
help="The version of the application (seen by user). Get from json info file by default.")
advance.add_argument('--check-certificate', default=True)
advance.add_argument('--zim-url', default=None, help="Get from json info file by default.")
advance.add_argument('--no-android-upload', action='store_false', dest='android_upload')
# Hidden options
parser.add_argument('--step', default='launch', choices=['launch', 'publish'], help=argparse.SUPPRESS)
parser.add_argument('--apks-dir', help=argparse.SUPPRESS)
parser.add_argument('--zim-path', default=None, help=argparse.SUPPRESS)
parser.add_argument('--content-version-code', type=int, help=argparse.SUPPRESS)
parser.add_argument('--package-name', default=None, help=argparse.SUPPRESS)
parser.add_argument('--google-api-key', help=argparse.SUPPRESS)
options = parser.parse_args()
if (not options.package_name
or not (options.zim_url or options.zim_path)
or not options.version_name):
if not options.package_name:
print("Try to get package name from info.json file")
if not options.zim_url:
print("Try to get zim url from info.json file")
if not options.version_name:
print("Try to get version_name form info.json file")
request_url = ('https://raw.githubusercontent.com/kiwix/kiwix-android-custom/master/{}/info.json'
.format(options.custom_app))
json_request = requests.get(request_url)
if json_request.status_code != 200:
print("Error while getting json file.")
print("Reason is '{}'".format(json_request.reason))
sys.exit(-1)
json_data = json.loads(json_request.text)
if not options.package_name:
print("Found package_name '{}'".format(json_data['package']))
options.package_name = json_data['package']
if not options.zim_url:
print("Found zim_url '{}'".format(json_data['zim_url']))
options.zim_url = json_data['zim_url']
if not options.version_name:
print("Found version_name '{}'".format(json_data['version_name']))
options.version_name = json_data['version_name']
options.base_version = "{}{}".format(
datetime.date.today().strftime('%y%j'),
options.extra_code)
return options
def download_zim_file(zim_url, dest_dir=None):
if dest_dir is None:
dest_dir = os.getcwd()
out_filename = urlparse(zim_url).path
out_filename = os.path.basename(out_filename)
zim_file = Remotefile(out_filename, '', zim_url)
download_remote(zim_file, dest_dir)
return os.path.join(dest_dir, out_filename)
def get_zim_size(*, zim_url=None, zim_path=None, check_certificate=True):
print("Try to get zim size")
if not zim_path:
if not check_certificate:
context = ssl.create_default_context()
context.check_hostname = False
context.verify_mode = ssl.CERT_NONE
else:
context = None
extra_args = {'context':context} if sys.version_info >= (3, 4, 3) else {}
with urllib.request.urlopen(zim_url, **extra_args) as resource:
size = resource.getheader('Content-Length', None)
if size is not None:
size = int(size)
print("Zim size is {}".format(size))
return size
else:
print("No 'Content-Length' header in http answer from the server.\n"
"We need to download the zim file to get its size.")
zim_path = download_zim_file(zim_url, tempfile.gettempdir())
size = os.path.getsize(zim_path)
print("Zim size is {}".format(size))
return size
def do_launch(options):
if options.zim_path:
zim_size = get_zim_size(zim_path=options.zim_path)
else:
zim_size = get_zim_size(zim_url=options.zim_url,
check_certificate=options.check_certificate)
travis_launch_build('kiwix', 'kiwix-build', options, zim_size)
print("Travis build has been launch.")
def do_publish(options):
zim_path = options.zim_path or download_zim_file(options.zim_url)
googleService = Google(options)
with googleService.new_request():
versionCodes = []
for apk in glob.iglob(options.apks_dir+"/*.apk"):
result = googleService.upload_apk(apk)
versionCodes.append(result['versionCode'])
googleService.upload_expansionfile(
zim_path, options.content_version_code, versionCodes)
googleService.publish_release(options, versionCodes)
def travis_launch_build(organisation, repository, options, zim_size):
request_url = tmpl_request_url.format(
organisation=organisation,
repository=repository,
endpoint='requests')
headers = {
"Travis-API-Version": "3",
"Content-Type": "application/json",
"Authorization": "token {}".format(options.travis_token),
"User-Agent": "kiwix-build"
}
uuid = uuid4()
envs = []
for platform_index, platform in enumerate(['arm', 'arm64', 'x86', 'x86_64', 'mips', 'mips64']):
d = {
'PLATFORM': "android_{}".format(platform),
'VERSION_CODE': gen_version_code(platform_index, options.base_version)
}
envs.append(d)
global_env = [
{ 'CUSTOM_APP': options.custom_app},
{ 'ZIM_FILE_SIZE': zim_size},
{ 'PACKAGE_NAME': options.package_name},
{ 'ZIM_URL': options.zim_url},
{ 'EXTRA_CODE': options.extra_code},
{ 'CONTENT_VERSION_CODE': gen_version_code(0, options.base_version)},
{ 'VERSION_NAME': options.version_name},
# google_key
{ 'secure': ('VAgKBMx0KEIyJlSnpM4YrHKLALIbaibkhlsgiv19ITa6dODoEIqeYHz'
'wFTiL3mRHU6HwtXtdNb/JeMle9NfHJVFSV56ZgFzX7ev9zr0YG0qZQv'
'tl8vHQlFPBErARder/L2tblOTM194/TiJk/q89a0XWDanKswXExwjcW'
'Z0tnDYQXTHSAKEt+xW8hjbnhqqB/v16lX6dUjZI+sVlsw+qAM4VT/qf'
'FCyDO5eJCzWIEL2LDUWI7jKSETNih5hl5fMMvCCNRPnkgGnytw5kF/t'
'Lw8YAbLRxkGsO4FCx5mB7HF5pNHyWOCCalMTKheyg/qUV/VcXW9Unlr'
'puMu0+d3hpLZESplS/NkvDxSrx16ank7EORS8OxLOufu56TW2hDuBzz'
'w1CBAj1p6s+Z6Kc4RMYYdxRgR1TjXg/ZVUn3T69d9igdS/5lAPFx2Ww'
'8x82FWCLSaiXymxXRNsNcKx5ifuvtv307r4yh31QjlKFYwadOCaCHHZ'
'zGE1mXcOu3j6W9WIaZfYRTpxmOrcfDIHxZSdLf11hOSZEUUFpj9hQlV'
'Op0RHkDEJUMNs6vkXUhZq9yPuqgrcb6GaN+UhOT8iHlijKmlG8NJEPk'
'Hp8RnL1hsr44N57ZzLqmSUZtvC83u/5e+YUb7beUDGsMyJV/fcMiGMM'
'LVtRnuPCFyNVNQUf2CphtG0=') },
# pass
{ 'secure': ('AtbgKUukES2uJPpEWNEDHLg0WcghLlCGL171Ah3+4CckBI8y1Fn+VpH'
'U2vEXzsV8tKoxX1IyB2tFivzuyo6CQXHSuWGJYQexwkBeGCgOfzKJLj'
'MAy75ATYA6JnFrikV+UcqdEz/9Dow3J1K7Slp3jpsQhERHbNeqkr4I+'
'XCL1LLnpewfOZo9OIEu93p6b6YlqvIPXJHyQe5xnMd8jFWg3/uIYqFn'
'XPvigeZqC2lhNp48mj4JdwwF2tmiArgyXOmgxiuHJNVVI7okbhc7kmI'
'Y3MmCSFgG0XPUEBU3Kdr4o/2hy8DDP6Gff+rUZW8nPI/2UWXRLWtOxv'
'XGGRyjHHTxGWzI4JyZbli9dls5M32MMjsXVKtciSFVwsMM8qn7wFnRi'
'q248a1Sg5fDNX/WYowmsHlWjffHZ7+UqUqJxAKtZ0vpQL+4SPIALPnK'
'V6j6CoorQp+VhMF01EFlZ0c8bkNmk4YW7R7RyNLIcaHKfd1ud8QF9PD'
'AnQ7Jr1GRBxzkjHvHfFrE14WPUu+FjVvDO7UPVMNQX7RS1IVACpKSRu'
'7N8KnIK3vSnLpn5GXKsbx0JB2vtyoTaFZvC9c3qyAw1nlpn7Lp3sPs3'
'bgIBU4tWOzg5g46eHbc4ad5nyB9Soz715lbMdECvKs2HHJUG3tubLKj'
'L0S/LRGRQ+IDgC7xrjQj8aA=') },
]
env = {
'matrix': envs,
'global': global_env
}
data = {
'request': {
'message' : tmpl_message.format(app=options.custom_app, zim=options.zim_url, uuid=uuid),
'branch' : "custom_app",
'config' : {
'before_install' : [
( 'pip3 install pyOpenSSl google-api-python-client'
' httplib2 apiclient requests'),
( 'openssl aes-256-cbc -k $google_key'
' -in travis/googleplay_android_developer-5a411156212c.json.enc'
' -out travis/googleplay_android_developer-5a411156212c.json'
' -d'),
( 'openssl aes-256-cbc -k $google_key'
' -in travis/kiwix-android.keystore.enc'
' -out travis/kiwix-android.keystore -d'),
( 'openssl aes-256-cbc -K $encrypted_eba2f7543984_key'
' -iv $encrypted_eba2f7543984_iv'
' -in travis/travisci_builder_id_key.enc'
' -out travis/travisci_builder_id_key -d'),
'chmod 600 travis/travisci_builder_id_key'
],
'env' : env,
'script' : 'travis_wait 30 travis/compile_custom_app.sh',
'deploy' : {
'provider': 'script',
'skip_cleanup': True,
'script': 'travis/deploy_apk.sh',
'on': {
'branch': 'custom_app'
}
}
}
}
}
if options.android_upload:
data['request']['config']['jobs'] = {
'include': [
{
'stage' : 'make_release',
'install': 'pip3 install -r requirements_build_custom_app.txt',
'script': True,
'env': global_env,
'deploy' : {
'provider': 'script',
'skip_cleanup': True,
'script': 'travis/make_release.sh',
'on': {
'branch': 'custom_app'
}
}
}
]
}
global_env.append({
'DEPLOY_DIR' : '/home/nightlybot/apks/{}_{}'.format(
options.custom_app, options.base_version)
})
else:
global_env.append({
'DEPLOY_DIR' : '/var/www/tmp.kiwix.org/custom_apps/{}_{}'.format(
options.custom_app, options.base_version)
})
r = requests.post(request_url, headers=headers, json=data)
if r.status_code != 202:
print("Error while requesting build:")
print(r.reason)
print("Have you forget to give the travis token ?")
sys.exit(-1)
else:
request_id = r.json()['request']['id']
print("Request {} has been schedule.".format(request_id))
request_left = 10
found = False
request_url = tmpl_request_url.format(
organisation=organisation,
repository=repository,
endpoint='builds')
while request_left:
time.sleep(1)
print("Try to get associated build.")
r = requests.get(request_url, headers=headers)
json_data = json.loads(r.text)
for build in json_data['builds']:
if build['event_type'] != 'api':
continue
message = build['commit']['message']
if str(uuid) in message:
found = True
break
if found:
break
print("Cannot find build. Wait 1 second and try again")
print("{} tries left".format(request_left))
request_left -= 1
if found:
print("Associated build found: {}.".format(build['number']))
print("https://travis-ci.org/kiwix/kiwix-build/builds/{}".format(build['id']))
else:
print("Request has been accepted by travis-ci but I cannot found "
"the associated build. Have a look here "
"https://travis-ci.org/kiwix/kiwix-build/builds"
"if you found it.")
if not options.android_upload:
print(("Automatic upload to android play store has been deactivated.\n"
"You will find the apks at this address once they have been compiled :"
" http://tmp.kiwix.org/custom_apps/{}_{}").format(
options.custom_app, options.base_version))
ERROR_MSG_EDIT_CHANGE = "A change was made to the application outside of this Edit, please create a new edit."
class Google:
def __init__(self, options):
scope = 'https://www.googleapis.com/auth/androidpublisher'
key = options.google_api_key
credentials = ServiceAccountCredentials.from_json_keyfile_name(
key,
scopes=[scope])
http = httplib2.Http()
http = credentials.authorize(http)
self.service = build('androidpublisher', 'v2', http=http)
self.packageName = options.package_name
self.edit_id = None
@contextmanager
def new_request(self):
edit_request = self.service.edits().insert(
packageName=self.packageName,
body={})
result = edit_request.execute()
print("create", result)
self.edit_id = result['id']
yield
commit_request = self.service.edits().commit(
editId=self.edit_id,
packageName=self.packageName)
result = commit_request.execute()
print("commit", result)
self.edit_id = None
def make_request(self, section, method, **kwargs):
request_content = self._build_request_content(kwargs)
_section = getattr(self._edits, section)()
_method = getattr(_section, method)
print(">", request_content)
request = _method(**request_content)
result = request.execute()
print("<", result)
return result
def _build_request_content(self, kwargs):
d = kwargs.copy()
d['editId'] = self.edit_id
d['packageName'] = self.packageName
return d
@property
def _edits(self):
return self.service.edits()
def upload_expansionfile(self, comp_file, contentVersionCode, versionCodes):
versionCodes = [int(v) for v in versionCodes]
self.make_request('expansionfiles', 'upload',
expansionFileType='main',
apkVersionCode=contentVersionCode,
media_body=comp_file,
media_mime_type='application/octet-stream')
for versionCode in versionCodes:
if versionCode == contentVersionCode:
continue
self.make_request('expansionfiles', 'update',
expansionFileType='main',
apkVersionCode=versionCode,
body={'referencesVersion': contentVersionCode}
)
def upload_apk(self, apk_file):
return self.make_request('apks', 'upload',
media_body=apk_file)
def publish_release(self, options, versionCodes):
return self.make_request('tracks', 'update',
track="alpha",
body={'versionCodes': versionCodes})
def gen_version_code(platform_index, base_version):
str_version = "{platform}{base_version}".format(
platform=platform_index,
base_version=base_version
)
return int(str_version)
if __name__ == "__main__":
options = parse_args()
func = globals()['do_{}'.format(options.step)]
func(options)

View File

@ -1,547 +0,0 @@
import shutil, os, json
from urllib.parse import urlparse
from dependency_utils import (
Dependency,
ReleaseDownload,
GitClone,
SvnClone,
NoopSource,
MakeBuilder,
CMakeBuilder,
MesonBuilder,
GradleBuilder,
NoopBuilder,
Builder as BaseBuilder)
from utils import Remotefile, pj, SkipCommand, copy_tree, add_execution_right
# *************************************
# Missing dependencies
# Is this ok to assume that those libs
# exist in your "distri" (linux/mac) ?
# If not, we need to compile them here
# *************************************
# aria2
# Argtable
# MSVirtual
# Android
# libiconv
# gettext
# *************************************
class zlib(Dependency):
name = 'zlib'
class Source(ReleaseDownload):
archive = Remotefile('zlib-1.2.8.tar.gz',
'36658cb768a54c1d4dec43c3116c27ed893e88b02ecfcb44f2166f9c0b7f2a0d')
patches = ['zlib_std_libname.patch']
class Builder(MakeBuilder):
dynamic_configure_option = "--shared"
static_configure_option = "--static"
def _pre_build_script(self, context):
context.try_skip(self.build_path)
shutil.copytree(self.source_path, self.build_path)
@property
def all_configure_option(self):
return '--static' if self.buildEnv.platform_info.static else '--shared'
@property
def configure_option(self):
options = "-DINSTALL_PKGCONFIG_DIR={}".format(pj(self.buildEnv.install_dir, self.buildEnv.libprefix, 'pkgconfig'))
if self.buildEnv.platform_info.static:
options += " -DBUILD_SHARED_LIBS=false"
else:
options += " -DBUILD_SHARED_LIBS=true"
return options
def _configure(self, context):
if self.buildEnv.platform_info.build == 'win32':
raise SkipCommand()
return super()._configure(context)
@property
def make_option(self):
if self.buildEnv.platform_info.build == 'win32':
return "--makefile win32/Makefile.gcc PREFIX={host}- SHARED_MODE={static} INCLUDE_PATH={include_path} LIBRARY_PATH={library_path} BINARY_PATH={binary_path}".format(
host='i686-w64-mingw32',
static="0" if self.buildEnv.platform_info.static else "1",
include_path=pj(self.buildEnv.install_dir, 'include'),
library_path=pj(self.buildEnv.install_dir, self.buildEnv.libprefix),
binary_path=pj(self.buildEnv.install_dir, 'bin'),
)
return ""
class lzma(Dependency):
name = 'lzma'
class Source(ReleaseDownload):
archive = Remotefile('xz-5.0.4.tar.bz2',
'5cd9b060d3a1ad396b3be52c9b9311046a1c369e6062aea752658c435629ce92')
class Builder(MakeBuilder):
@property
def configure_option(self):
return "--disable-assembler"
class UUID(Dependency):
name = 'uuid'
class Source(ReleaseDownload):
archive = Remotefile('e2fsprogs-libs-1.43.4.tar.gz',
'eed4516325768255c9745e7b82c9d7d0393abce302520a5b2cde693204b0e419',
'https://www.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/v1.43.4/e2fsprogs-libs-1.43.4.tar.gz')
extract_dir = 'e2fsprogs-libs-1.43.4'
class Builder(MakeBuilder):
configure_option = ("--enable-libuuid --disable-debugfs --disable-imager --disable-resizer --disable-defrag --enable-fsck"
" --disable-uuidd")
configure_env = {'_format_CFLAGS': "{env.CFLAGS} -fPIC"}
static_configure_option = dynamic_configure_option = ""
make_target = 'libs'
make_install_target = 'install-libs'
class Xapian(Dependency):
name = "xapian-core"
class Source(ReleaseDownload):
archive = Remotefile('xapian-core-1.4.5.tar.xz',
'85b5f952de9df925fd13e00f6e82484162fd506d38745613a50b0a2064c6b02b')
class Builder(MakeBuilder):
configure_option = "--disable-sse --disable-backend-inmemory --disable-documentation"
configure_env = {'_format_LDFLAGS': "-L{buildEnv.install_dir}/{buildEnv.libprefix}",
'_format_CXXFLAGS': "-I{buildEnv.install_dir}/include"}
@property
def dependencies(self):
deps = ['zlib', 'lzma']
if (self.buildEnv.platform_info.build == 'win32'
or self.buildEnv.distname == 'Darwin'):
return deps
return deps + ['uuid']
class CTPP2(Dependency):
name = "ctpp2"
class Source(ReleaseDownload):
name = "ctpp2"
source_dir = "ctpp2-2.8.3"
archive = Remotefile('ctpp2-2.8.3.tar.gz',
'a83ffd07817adb575295ef40fbf759892512e5a63059c520f9062d9ab8fb42fc')
patches = ["ctpp2_include.patch",
"ctpp2_no_src_modification.patch",
"ctpp2_fix-static-libname.patch",
"ctpp2_mingw32.patch",
"ctpp2_dll_export_VMExecutable.patch",
"ctpp2_win_install_lib_in_lib_dir.patch",
"ctpp2_iconv_support.patch",
"ctpp2_compile_ctpp2c_static.patch",
]
class Builder(CMakeBuilder):
configure_option = "-DMD5_SUPPORT=OFF"
class CTPP2C(CTPP2):
name = "ctpp2c"
force_native_build = True
class Builder(CTPP2.Builder):
make_target = "ctpp2c"
@property
def build_path(self):
return super().build_path+"_native"
def _install(self, context):
context.try_skip(self.build_path)
command = "cp {ctpp2c}* {install_dir}".format(
ctpp2c=pj(self.build_path, 'ctpp2c'),
install_dir=pj(self.buildEnv.install_dir, 'bin')
)
self.buildEnv.run_command(command, self.build_path, context)
class Pugixml(Dependency):
name = "pugixml"
class Source(ReleaseDownload):
archive = Remotefile('pugixml-1.2.tar.gz',
'0f422dad86da0a2e56a37fb2a88376aae6e931f22cc8b956978460c9db06136b')
patches = ["pugixml_meson.patch"]
Builder = MesonBuilder
class MicroHttpd(Dependency):
name = "libmicrohttpd"
class Source(ReleaseDownload):
archive = Remotefile('libmicrohttpd-0.9.46.tar.gz',
'06dbd2654f390fa1e8196fe063fc1449a6c2ed65a38199a49bf29ad8a93b8979',
'http://ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-0.9.46.tar.gz')
class Builder(MakeBuilder):
configure_option = "--disable-https --without-libgcrypt --without-libcurl"
class Gumbo(Dependency):
name = "gumbo"
class Source(ReleaseDownload):
archive = Remotefile('gumbo-0.10.1.tar.gz',
'28463053d44a5dfbc4b77bcf49c8cee119338ffa636cc17fc3378421d714efad',
'https://github.com/google/gumbo-parser/archive/v0.10.1.tar.gz')
def _post_prepare_script(self, context):
context.try_skip(self.extract_path)
command = "./autogen.sh"
self.buildEnv.run_command(command, self.extract_path, context)
Builder = MakeBuilder
class Icu(Dependency):
name = "icu4c"
class Source(SvnClone):
name = "icu4c"
svn_remote = "http://source.icu-project.org/repos/icu/tags/release-58-2/icu4c"
svn_dir = "icu4c"
patches = ["icu4c_fix_static_lib_name_mingw.patch",
"icu4c_android_elf64_st_info.patch",
"icu4c_custom_data.patch",
"icu4c_noxlocale.patch"]
class Builder(MakeBuilder):
subsource_dir = "source"
@property
def configure_option(self):
options = "--disable-samples --disable-tests --disable-extras --disable-dyload"
if self.buildEnv.platform_info.build == 'android':
options += " --with-data-packaging=archive"
return options
class Icu_native(Icu):
name = "icu4c_native"
force_native_build = True
class Builder(Icu.Builder):
@property
def build_path(self):
return super().build_path+"_native"
def _install(self, context):
raise SkipCommand()
class Icu_cross_compile(Icu):
name = "icu4c_cross-compile"
dependencies = ['icu4c_native']
class Builder(Icu.Builder):
@property
def configure_option(self):
icu_native_dep = self.buildEnv.targetsDict['icu4c_native']
return super().configure_option + " --with-cross-build=" + icu_native_dep.builder.build_path
class Libzim(Dependency):
name = "libzim"
@property
def dependencies(self):
base_dependencies = ['zlib', 'lzma', 'xapian-core']
if self.buildEnv.platform_info.build != 'native':
return base_dependencies + ["icu4c_cross-compile"]
else:
return base_dependencies + ["icu4c"]
class Source(GitClone):
git_remote = "https://github.com/openzim/libzim.git"
git_dir = "libzim"
class Builder(MesonBuilder):
test_option = "-t 8"
class ZimTools(Dependency):
name = "zim-tools"
dependencies = ['libzim']
class Source(GitClone):
git_remote = "https://github.com/openzim/zim-tools.git"
git_dir = "zim-tools"
class Builder(MesonBuilder):
@property
def configure_option(self):
if self.buildEnv.platform_info.static:
return "-Dstatic-linkage=true"
return ""
class Zimwriterfs(Dependency):
name = "zimwriterfs"
extra_packages = ['file']
@property
def dependencies(self):
base_dependencies = ['libzim', 'zlib', 'lzma', 'xapian-core', 'gumbo']
if self.buildEnv.platform_info.build != 'native':
return base_dependencies + ["icu4c_cross-compile"]
else:
return base_dependencies + ["icu4c"]
class Source(GitClone):
git_remote = "https://github.com/openzim/zimwriterfs.git"
git_dir = "zimwriterfs"
release_git_ref = "1.1"
def _post_prepare_script(self, context):
context.try_skip(self.git_path)
command = "./autogen.sh"
self.buildEnv.run_command(command, self.git_path, context)
Builder = MakeBuilder
class Kiwixlib(Dependency):
name = "kiwix-lib"
@property
def dependencies(self):
base_dependencies = ["pugixml", "libzim", "zlib", "lzma"]
if ( self.buildEnv.platform_info.build != 'android'
and self.buildEnv.distname != 'Darwin'):
base_dependencies += ['ctpp2c', 'ctpp2']
if self.buildEnv.platform_info.build != 'native':
return base_dependencies + ["icu4c_cross-compile"]
else:
return base_dependencies + ["icu4c"]
class Source(GitClone):
git_remote = "https://github.com/kiwix/kiwix-lib.git"
git_dir = "kiwix-lib"
class Builder(MesonBuilder):
@property
def configure_option(self):
base_option = "-Dctpp2-install-prefix={buildEnv.install_dir}"
if self.buildEnv.platform_info.build == 'android':
base_option += ' -Dandroid=true'
return base_option
@property
def library_type(self):
if self.buildEnv.platform_info.build == 'android':
return 'shared'
return super().library_type
class KiwixTools(Dependency):
name = "kiwix-tools"
dependencies = ["kiwix-lib", "libmicrohttpd", "zlib"]
class Source(GitClone):
git_remote = "https://github.com/kiwix/kiwix-tools.git"
git_dir = "kiwix-tools"
class Builder(MesonBuilder):
@property
def configure_option(self):
if self.buildEnv.platform_info.static:
return "-Dstatic-linkage=true"
return ""
class Gradle(Dependency):
name = "Gradle"
class Source(ReleaseDownload):
archive = Remotefile('gradle-4.1-bin.zip',
'd55dfa9cfb5a3da86a1c9e75bb0b9507f9a8c8c100793ccec7beb6e259f9ed43',
'https://services.gradle.org/distributions/gradle-4.1-bin.zip')
class Builder(BaseBuilder):
def build(self):
self.command('install', self._install)
def _install(self, context):
copy_tree(
pj(self.source_path, "bin"),
pj(self.buildEnv.install_dir, "bin"),
post_copy_function = add_execution_right)
copy_tree(
pj(self.source_path, "lib"),
pj(self.buildEnv.install_dir, "lib"))
class AllBaseDependencies(Dependency):
name = "alldependencies"
@property
def dependencies(self):
base_deps = ['zlib', 'lzma', 'xapian-core', 'gumbo', 'pugixml', 'libmicrohttpd']
if self.buildEnv.platform_info.build != 'native':
base_deps += ["icu4c_cross-compile"]
else:
base_deps += ["icu4c"]
if ( self.buildEnv.platform_info.build != 'android'
and self.buildEnv.distname != 'Darwin'):
base_deps += ['ctpp2c', 'ctpp2']
if self.buildEnv.platform_info.build == 'android':
base_deps += ['Gradle']
return base_deps
Source = NoopSource
Builder = NoopBuilder
class KiwixAndroid(Dependency):
name = "kiwix-android"
dependencies = ["Gradle", "kiwix-lib"]
class Source(GitClone):
git_remote = "https://github.com/kiwix/kiwix-android"
git_dir = "kiwix-android"
class Builder(GradleBuilder):
def build(self):
if self.buildEnv.options.targets == 'kiwix-android-custom':
print("SKIP")
else:
super().build()
def _configure(self, context):
if not os.path.exists(self.build_path):
shutil.copytree(self.source_path, self.build_path, symlinks=True)
try:
shutil.rmtree(pj(self.build_path, 'kiwixlib', 'src', 'main'))
except FileNotFoundError:
pass
shutil.copytree(pj(self.buildEnv.install_dir, 'kiwix-lib'),
pj(self.build_path, 'kiwixlib', 'src', 'main'))
os.makedirs(
pj(self.build_path, 'app', 'src', 'main', 'assets', 'icu'),
exist_ok=True)
shutil.copy2(pj(self.buildEnv.install_dir, 'share', 'icu', '58.2',
'icudt58l.dat'),
pj(self.build_path, 'app', 'src', 'main', 'assets',
'icu', 'icudt58l.dat'))
class KiwixCustomApp(Dependency):
name = "kiwix-android-custom"
dependencies = ["kiwix-android", "kiwix-lib"]
def __init__(self, buildEnv):
super().__init__(buildEnv)
self.custom_name = buildEnv.options.android_custom_app
class Source(GitClone):
git_remote = "https://github.com/kiwix/kiwix-android-custom"
git_dir = "kiwix-android-custom"
class Builder(GradleBuilder):
@property
def gradle_target(self):
return "assemble{}".format(self.target.custom_name)
@property
def gradle_option(self):
template = ("-i -P customDir={customDir}"
" -P zim_file_size={zim_size}"
" -P version_code={version_code}"
" -P version_name={version_name}"
" -P content_version_code={content_version_code}")
return template.format(
customDir=pj(self.build_path, 'custom'),
zim_size=self._get_zim_size(),
version_code=os.environ['VERSION_CODE'],
version_name=os.environ['VERSION_NAME'],
content_version_code=os.environ['CONTENT_VERSION_CODE'])
@property
def build_path(self):
return pj(self.buildEnv.build_dir, "{}_{}".format(self.target.full_name, self.target.custom_name))
@property
def custom_build_path(self):
return pj(self.build_path, 'custom', self.target.custom_name)
def _get_zim_size(self):
try:
zim_size = self.buildEnv.options.zim_file_size
except AttributeError:
with open(pj(self.source_path, self.target.custom_name, 'info.json')) as f:
app_info = json.load(f)
zim_size = os.path.getsize(pj(self.custom_build_path, app_info['zim_file']))
return zim_size
def build(self):
self.command('configure', self._configure)
self.command('download_zim', self._download_zim)
self.command('compile', self._compile)
def _download_zim(self, context):
zim_url = self.buildEnv.options.zim_file_url
if zim_url is None:
raise SkipCommand()
with open(pj(self.source_path, self.target.custom_name, 'info.json')) as f:
app_info = json.load(f)
zim_url = app_info.get('zim_url', zim_url)
out_filename = urlparse(zim_url).path
out_filename = os.path.basename(out_filename)
zim_file = Remotefile(out_filename, '', zim_url)
self.buildEnv.download(zim_file)
shutil.copy(pj(self.buildEnv.archive_dir, out_filename),
pj(self.custom_build_path, app_info['zim_file']))
def _configure(self, context):
# Copy kiwix-android in build dir.
kiwix_android_dep = self.buildEnv.targetsDict['kiwix-android']
if not os.path.exists(self.build_path):
shutil.copytree(kiwix_android_dep.source_path, self.build_path)
# Copy kiwix-lib application in build dir
try:
shutil.rmtree(pj(self.build_path, 'kiwixlib', 'src', 'main'))
except FileNotFoundError:
pass
shutil.copytree(pj(self.buildEnv.install_dir, 'kiwix-lib'),
pj(self.build_path, 'kiwixlib', 'src', 'main'))
os.makedirs(
pj(self.build_path, 'app', 'src', 'main', 'assets', 'icu'),
exist_ok=True)
shutil.copy2(pj(self.buildEnv.install_dir, 'share', 'icu', '58.2',
'icudt58l.dat'),
pj(self.build_path, 'app', 'src', 'main', 'assets',
'icu', 'icudt58l.dat'))
# Generate custom directory
try:
shutil.rmtree(pj(self.build_path, 'custom'))
except FileNotFoundError:
pass
os.makedirs(pj(self.build_path, 'custom'))
command = "./gen-custom-android-directory.py {custom_name} --output-dir {custom_dir}"
command = command.format(
custom_name=self.target.custom_name,
custom_dir=pj(self.build_path, 'custom', self.target.custom_name)
)
self.buildEnv.run_command(command, self.source_path, context)

View File

@ -1,431 +0,0 @@
import subprocess
import os
import shutil
from utils import pj, Context, SkipCommand, extract_archive, Defaultdict, StopBuild
from dependency_versions import main_project_versions, base_deps_versions
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
class _MetaDependency(type):
def __new__(cls, name, bases, dct):
_class = type.__new__(cls, name, bases, dct)
if name != 'Dependency':
dep_name = dct['name']
Dependency.all_deps[dep_name] = _class
return _class
class Dependency(metaclass=_MetaDependency):
all_deps = {}
dependencies = []
force_native_build = False
def __init__(self, buildEnv):
self.buildEnv = buildEnv
self.source = self.Source(self)
self.builder = self.Builder(self)
self.skip = False
@property
def version(self):
return base_deps_versions.get(self.name, None)
@property
def full_name(self):
if self.version:
return "{}-{}".format(self.name, self.version)
return self.name
@property
def source_path(self):
return pj(self.buildEnv.source_dir, self.source.source_dir)
@property
def _log_dir(self):
return self.buildEnv.log_dir
def command(self, name, function, *args):
print(" {} {} : ".format(name, self.name), end="", flush=True)
log = pj(self._log_dir, 'cmd_{}_{}.log'.format(name, self.name))
context = Context(name, log, self.force_native_build)
try:
ret = function(*args, context=context)
context._finalise()
print("OK")
return ret
except SkipCommand:
print("SKIP")
except subprocess.CalledProcessError:
print("ERROR")
try:
with open(log, 'r') as f:
print(f.read())
except:
pass
raise StopBuild()
except:
print("ERROR")
raise
class Source:
"""Base Class to the real preparator
A source preparator must install source in the self.source_dir attribute
inside the buildEnv.source_dir."""
def __init__(self, target):
self.target = target
self.buildEnv = target.buildEnv
@property
def name(self):
return self.target.name
@property
def source_dir(self):
return self.target.full_name
def _patch(self, context):
source_path = pj(self.buildEnv.source_dir, self.source_dir)
context.try_skip(source_path)
context.force_native_build = True
for p in self.patches:
with open(pj(SCRIPT_DIR, 'patches', p), 'r') as patch_input:
self.buildEnv.run_command("patch -p1", source_path, context, input=patch_input.read())
def command(self, *args, **kwargs):
return self.target.command(*args, **kwargs)
class NoopSource(Source):
def prepare(self):
pass
class ReleaseDownload(Source):
archive_top_dir = None
@property
def extract_path(self):
return pj(self.buildEnv.source_dir, self.source_dir)
def _download(self, context):
context.try_skip(self.buildEnv.archive_dir, self.name)
self.buildEnv.download(self.archive)
def _extract(self, context):
context.try_skip(self.extract_path)
if os.path.exists(self.extract_path):
shutil.rmtree(self.extract_path)
extract_archive(pj(self.buildEnv.archive_dir, self.archive.name),
self.buildEnv.source_dir,
topdir=self.archive_top_dir,
name=self.source_dir)
def prepare(self):
self.command('download', self._download)
self.command('extract', self._extract)
if hasattr(self, 'patches'):
self.command('patch', self._patch)
if hasattr(self, '_post_prepare_script'):
self.command('post_prepare_script', self._post_prepare_script)
class GitClone(Source):
base_git_ref = "master"
@property
def release_git_ref(self):
return main_project_versions.get(self.name, "master")
@property
def source_dir(self):
if self.buildEnv.make_release:
return "{}_release".format(self.git_dir)
else:
return self.git_dir
@property
def git_path(self):
return pj(self.buildEnv.source_dir, self.source_dir)
@property
def git_ref(self):
if self.buildEnv.make_release:
return self.release_git_ref
else:
return self.base_git_ref
def _git_clone(self, context):
context.force_native_build = True
if os.path.exists(self.git_path):
raise SkipCommand()
command = "git clone --depth=1 --branch {} {} {}".format(
self.git_ref, self.git_remote, self.source_dir)
self.buildEnv.run_command(command, self.buildEnv.source_dir, context)
def _git_update(self, context):
context.force_native_build = True
command = "git fetch origin {}".format(
self.git_ref)
self.buildEnv.run_command(command, self.git_path, context)
self.buildEnv.run_command("git checkout "+self.git_ref, self.git_path, context)
def prepare(self):
self.command('gitclone', self._git_clone)
self.command('gitupdate', self._git_update)
if hasattr(self, '_post_prepare_script'):
self.command('post_prepare_script', self._post_prepare_script)
class SvnClone(Source):
@property
def source_dir(self):
return self.svn_dir
@property
def svn_path(self):
return pj(self.buildEnv.source_dir, self.svn_dir)
def _svn_checkout(self, context):
context.force_native_build = True
if os.path.exists(self.svn_path):
raise SkipCommand()
command = "svn checkout {} {}".format(self.svn_remote, self.svn_dir)
self.buildEnv.run_command(command, self.buildEnv.source_dir, context)
def _svn_update(self, context):
context.force_native_build = True
self.buildEnv.run_command("svn update", self.svn_path, context)
def prepare(self):
self.command('svncheckout', self._svn_checkout)
self.command('svnupdate', self._svn_update)
if hasattr(self, 'patches'):
self.command('patch', self._patch)
class Builder:
subsource_dir = None
def __init__(self, target):
self.target = target
self.buildEnv = target.buildEnv
@property
def name(self):
return self.target.name
@property
def source_path(self):
base_source_path = self.target.source_path
if self.subsource_dir:
return pj(base_source_path, self.subsource_dir)
return base_source_path
@property
def build_path(self):
return pj(self.buildEnv.build_dir, self.target.full_name)
def command(self, *args, **kwargs):
return self.target.command(*args, **kwargs)
def build(self):
if hasattr(self, '_pre_build_script'):
self.command('pre_build_script', self._pre_build_script)
self.command('configure', self._configure)
self.command('compile', self._compile)
if hasattr(self, '_test'):
self.command('test', self._test)
self.command('install', self._install)
if hasattr(self, '_post_build_script'):
self.command('post_build_script', self._post_build_script)
def make_dist(self):
if hasattr(self, '_pre_build_script'):
self.command('pre_build_script', self._pre_build_script)
self.command('configure', self._configure)
self.command('make_dist', self._make_dist)
class NoopBuilder(Builder):
def build(self):
pass
def make_dist(self):
pass
class MakeBuilder(Builder):
configure_option = ""
dynamic_configure_option = "--enable-shared --disable-static"
static_configure_option = "--enable-static --disable-shared"
make_option = ""
install_option = ""
configure_script = "configure"
configure_env = None
make_target = ""
make_install_target = "install"
@property
def all_configure_option(self):
return "{} {} {}".format(
self.configure_option,
self.static_configure_option if self.buildEnv.platform_info.static else self.dynamic_configure_option,
self.buildEnv.configure_option if not self.target.force_native_build else "")
def _configure(self, context):
context.try_skip(self.build_path)
command = "{configure_script} {configure_option} --prefix {install_dir} --libdir {libdir}"
command = command.format(
configure_script=pj(self.source_path, self.configure_script),
configure_option=self.all_configure_option,
install_dir=self.buildEnv.install_dir,
libdir=pj(self.buildEnv.install_dir, self.buildEnv.libprefix)
)
env = Defaultdict(str, os.environ)
if self.buildEnv.platform_info.static:
env['CFLAGS'] = env['CFLAGS'] + ' -fPIC'
if self.configure_env:
for k in self.configure_env:
if k.startswith('_format_'):
v = self.configure_env.pop(k)
v = v.format(buildEnv=self.buildEnv, env=env)
self.configure_env[k[8:]] = v
env.update(self.configure_env)
self.buildEnv.run_command(command, self.build_path, context, env=env)
def _compile(self, context):
context.try_skip(self.build_path)
command = "make -j4 {make_target} {make_option}".format(
make_target=self.make_target,
make_option=self.make_option
)
self.buildEnv.run_command(command, self.build_path, context)
def _install(self, context):
context.try_skip(self.build_path)
command = "make {make_install_target} {make_option}".format(
make_install_target=self.make_install_target,
make_option=self.make_option
)
self.buildEnv.run_command(command, self.build_path, context)
def _make_dist(self, context):
context.try_skip(self.build_path)
command = "make dist"
self.buildEnv.run_command(command, self.build_path, context)
class CMakeBuilder(MakeBuilder):
def _configure(self, context):
context.try_skip(self.build_path)
cross_option = ""
if not self.target.force_native_build and self.buildEnv.cmake_crossfile:
cross_option = "-DCMAKE_TOOLCHAIN_FILE={}".format(self.buildEnv.cmake_crossfile)
command = ("cmake {configure_option}"
" -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON"
" -DCMAKE_INSTALL_PREFIX={install_dir}"
" -DCMAKE_INSTALL_LIBDIR={libdir}"
" {source_path}"
" {cross_option}")
command = command.format(
configure_option="{} {}".format(self.buildEnv.cmake_option, self.configure_option),
install_dir=self.buildEnv.install_dir,
libdir=self.buildEnv.libprefix,
source_path=self.source_path,
cross_option=cross_option
)
env = Defaultdict(str, os.environ)
if self.buildEnv.platform_info.static:
env['CFLAGS'] = env['CFLAGS'] + ' -fPIC'
if self.configure_env:
for k in self.configure_env:
if k.startswith('_format_'):
v = self.configure_env.pop(k)
v = v.format(buildEnv=self.buildEnv, env=env)
self.configure_env[k[8:]] = v
env.update(self.configure_env)
self.buildEnv.run_command(command, self.build_path, context, env=env, cross_env_only=True)
class MesonBuilder(Builder):
configure_option = ""
test_option = ""
@property
def library_type(self):
return 'static' if self.buildEnv.platform_info.static else 'shared'
def _configure(self, context):
context.try_skip(self.build_path)
if os.path.exists(self.build_path):
shutil.rmtree(self.build_path)
os.makedirs(self.build_path)
configure_option = self.configure_option.format(buildEnv=self.buildEnv)
cross_option = ""
if not self.target.force_native_build and self.buildEnv.meson_crossfile:
cross_option = "--cross-file {}".format(
self.buildEnv.meson_crossfile)
command = ("{command} . {build_path}"
" --default-library={library_type}"
" {configure_option}"
" --prefix={buildEnv.install_dir}"
" --libdir={buildEnv.libprefix}"
" {cross_option}")
command = command.format(
command=self.buildEnv.meson_command,
library_type=self.library_type,
configure_option=configure_option,
build_path=self.build_path,
buildEnv=self.buildEnv,
cross_option=cross_option
)
self.buildEnv.run_command(command, self.source_path, context, cross_env_only=True)
def _compile(self, context):
command = "{} -v".format(self.buildEnv.ninja_command)
self.buildEnv.run_command(command, self.build_path, context)
def _test(self, context):
if ( self.buildEnv.platform_info.build == 'android'
or (self.buildEnv.platform_info.build != 'native'
and not self.buildEnv.platform_info.static)
):
raise SkipCommand()
command = "{} --verbose {}".format(self.buildEnv.mesontest_command, self.test_option)
self.buildEnv.run_command(command, self.build_path, context)
def _install(self, context):
command = "{} -v install".format(self.buildEnv.ninja_command)
self.buildEnv.run_command(command, self.build_path, context)
def _make_dist(self, context):
command = "{} -v dist".format(self.buildEnv.ninja_command)
self.buildEnv.run_command(command, self.build_path, context)
class GradleBuilder(Builder):
gradle_target = "build"
gradle_option = "-i"
def build(self):
self.command('configure', self._configure)
if hasattr(self, '_pre_compile_script'):
self.command('pre_compile_script', self._pre_compile_script)
self.command('compile', self._compile)
def _configure(self, context):
# We don't have a lot to configure by itself
context.try_skip(self.build_path)
if os.path.exists(self.build_path):
shutil.rmtree(self.build_path)
shutil.copytree(self.source_path, self.build_path)
def _compile(self, context):
command = "gradle {gradle_target} {gradle_option}"
command = command.format(
gradle_target=self.gradle_target,
gradle_option=self.gradle_option)
self.buildEnv.run_command(command, self.build_path, context)

View File

@ -1,27 +0,0 @@
main_project_versions = {
'kiwix-lib': '1.0.2',
'kiwix-tools': '0.3.0',
'libzim': '3.0.0',
'zim-tools': '0.0.1',
'zimwriterfs': '1.1',
}
# This is the "version" of the whole base_deps_versions dict.
# Change this when you change base_deps_versions.
base_deps_meta_version = '0'
base_deps_versions = {
'zlib' : '1.2.8',
'lzma' : '5.0.4',
'uuid' : '1.43.4',
'xapian-core' : '1.4.5',
'ctpp2' : '2.8.3',
'pugixml' : '1.2',
'libmicrohttpd' : '0.9.46',
'gumbo' : '0.10.1',
'icu4c' : '58.2',
'Gradle' : '3.4',
}

File diff suppressed because it is too large Load Diff

View File

@ -1,98 +0,0 @@
#!/usr/bin/env python3
import os, sys, stat
import argparse
import datetime
import subprocess
import tarfile
import zipfile
pj = os.path.join
FILES_TO_UPLOAD = [
'kiwix-index',
'kiwix-install',
'kiwix-manage',
'kiwix-read',
'kiwix-search',
'kiwix-serve'
]
class Archiver:
def __init__(self, options):
self.options = options
self.working_directory = "{:%Y-%m-%d}".format(datetime.date.today())
os.makedirs(self.working_directory, exist_ok=True)
self.archive_basename = "kiwix-tools_{:%Y-%m-%d}".format(datetime.date.today())
self.files_to_upload = list(self._gen_file_list())
def _gen_file_list(self):
bin_dir = pj(self.options.install_dir, 'bin')
for filename in os.listdir(bin_dir):
basename, _ = os.path.splitext(filename)
if basename in FILES_TO_UPLOAD:
yield pj(bin_dir, filename), pj(self.archive_basename, filename)
def build_tar(self):
archive_name = "{}.tar.gz".format(self.archive_basename)
archive_name = pj(self.working_directory, archive_name)
with tarfile.open(archive_name, "w:gz") as archive:
for filename, arcname in self.files_to_upload:
archive.add(filename, arcname=arcname)
return archive_name
def build_zip(self):
archive_name = "{}.zip".format(self.archive_basename)
archive_name = pj(self.working_directory, archive_name)
with zipfile.ZipFile(archive_name, "w") as archive:
for filename, arcname in self.files_to_upload:
archive.write(filename, arcname)
return archive_name
class Deployer:
def __init__(self, options):
self.options = options
def deploy(self, directory):
if not os.path.isdir(directory):
return
command = "scp -v -r -p -i {id_file} {directory} {host_addr}".format(
id_file=self.options.ssh_private_key,
directory=directory,
host_addr="{}:{}".format(self.options.server, self.options.base_path)
)
return subprocess.check_call(command, shell=True)
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument('install_dir')
parser.add_argument('--deploy', action="store_true")
group = parser.add_argument_group('deploy options')
group.add_argument('--ssh_private_key')
group.add_argument('--server')
group.add_argument('--base_path')
parser.add_argument('--tar', action="store_true")
parser.add_argument('--zip', action="store_true")
parser.add_argument('--verbose', '-v', action="store_true",
help=("Print all logs on stdout instead of in specific"
" log files per commands"))
return parser.parse_args()
if __name__ == "__main__":
options = parse_args()
options.install_dir = os.path.abspath(options.install_dir)
archiver = Archiver(options)
archive_list = []
if options.tar:
print("Generating tar archive")
archive_list.append(archiver.build_tar())
if options.zip:
print("Generating zip archive")
archive_list.append(archiver.build_zip())
if options.deploy:
deployer = Deployer(options)
deployer.deploy(archiver.working_directory)

166
kiwixbuild/__init__.py Normal file
View File

@ -0,0 +1,166 @@
#!/usr/bin/env python3
import os, sys
import argparse
from .dependencies import Dependency
from .configs import ConfigInfo
from .builder import Builder
from .flatpak_builder import FlatpakBuilder
from . import _global
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument(
"target",
default="kiwix-tools",
nargs="?",
metavar="TARGET",
choices=Dependency.all_deps.keys(),
)
parser.add_argument(
"--working-dir",
default=".",
help=(
"Directory where kiwix-build puts all its files "
"(source, archive and build)\n"
"working-dir can be absolute path or a relative (to cwd) one."
),
)
parser.add_argument(
"--build-dir",
default=".",
help=(
"Directory where kiwix-build puts all build files.\n"
"build-dir can be absolute path or a relative (to working-dir) one."
),
)
parser.add_argument("--libprefix", default=None)
parser.add_argument(
"--config", choices=ConfigInfo.all_configs, default="native_dyn"
)
parser.add_argument(
"--verbose",
"-v",
action="store_true",
help=(
"Print all logs on stdout instead of in specific" " log files per commands"
),
)
parser.add_argument(
"--hide-progress",
action="store_false",
dest="show_progress",
help="Hide intermediate progress information.",
)
parser.add_argument(
"--skip-source-prepare",
action="store_true",
help="Skip the source download part",
)
parser.add_argument(
"--build-deps-only",
action="store_true",
help="Build only the dependencies of the specified target.",
)
parser.add_argument(
"--build-nodeps",
action="store_true",
help="Build only the target, not its dependencies.",
)
parser.add_argument(
"--make-dist",
action="store_true",
help="Build distrubution (dist) source archive",
)
parser.add_argument(
"--make-release", action="store_true", help="Build a release version"
)
subgroup = parser.add_argument_group("advanced")
subgroup.add_argument(
"--no-cert-check",
action="store_true",
help="Skip SSL certificate verification during download",
)
subgroup.add_argument(
"--clean-at-end",
action="store_true",
help="Clean all intermediate files after the (successfull) build",
)
subgroup.add_argument(
"--dont-install-packages",
action="store_true",
help="Do not try to install packages before compiling",
)
subgroup.add_argument(
"--assume-packages-installed",
action="store_true",
help="Assume the package to install to be aleady installed",
)
subgroup.add_argument(
"--android-arch",
action="append",
help=(
"Specify the architecture to build for android application/libraries.\n"
"Can be specified several times to build for several architectures.\n"
"If not specified, all architectures will be build."
),
)
subgroup.add_argument(
"--ios-arch",
action="append",
help=(
"Specify the architecture to build for ios application/libraries.\n"
"Can be specified several times to build for several architectures.\n"
"If not specified, all architectures will be build."
),
)
subgroup.add_argument(
"--fast-clone",
action="store_true",
help=(
"Do not clone the whole repository.\n"
"This is useful for one shot build but it is not recommended if you want "
"to develop with the cloned sources."
),
)
subgroup.add_argument(
"--use-target-arch-name",
action="store_true",
help=(
"Name the build directory using the arch name instead of the config name.\n"
"Different configs may create binary for the same arch so this option is "
"not recommended when working with several config on the same computer.\n"
"However, when generating dependencies for other it is better to have a "
"directory named using the target instead of the used config.\n"
"Intended to be used in CI only."
),
)
subgroup.add_argument(
"--get-build-dir", action="store_true", help="Print the output directory."
)
options = parser.parse_args()
if not options.android_arch:
options.android_arch = ["arm", "arm64", "x86", "x86_64"]
if not options.ios_arch:
options.ios_arch = ["arm64", "x86_64"]
return options
def main():
options = parse_args()
options.working_dir = os.path.abspath(options.working_dir)
_global.set_options(options)
neutralEnv = buildenv.NeutralEnv(options.get_build_dir)
_global.set_neutralEnv(neutralEnv)
if options.config == "flatpak":
builder = FlatpakBuilder()
else:
builder = Builder()
if options.get_build_dir:
print(ConfigInfo.get_config(options.config).buildEnv.build_dir)
else:
builder.run()

7
kiwixbuild/__main__.py Normal file
View File

@ -0,0 +1,7 @@
#!/usr/bin/env python3
from . import main
if __name__ == "__main__":
main()

40
kiwixbuild/_global.py Normal file
View File

@ -0,0 +1,40 @@
from collections import OrderedDict as _OrderedDict
import platform
_neutralEnv = None
_options = None
_target_steps = _OrderedDict()
def set_neutralEnv(env):
global _neutralEnv
_neutralEnv = env
def neutralEnv(what):
return getattr(_neutralEnv, what)
def set_options(options):
global _options
_options = options
def option(what):
return getattr(_options, what)
def add_target_step(key, what):
_target_steps[key] = what
def get_target_step(key, default_context=None):
if isinstance(key, tuple):
context, target = key
else:
context, target = default_context, key
return _target_steps[(context, target)]
def target_steps():
return _target_steps

183
kiwixbuild/buildenv.py Normal file
View File

@ -0,0 +1,183 @@
import os, sys, shutil
import subprocess
import platform
import distro
from .utils import pj, download_remote, escape_path
from ._global import neutralEnv, option
class NeutralEnv:
def __init__(self, dummy_run):
self.working_dir = option("working_dir")
self.source_dir = pj(self.working_dir, "SOURCE")
self.archive_dir = pj(self.working_dir, "ARCHIVE")
self.toolchain_dir = pj(self.working_dir, "TOOLCHAINS")
self.log_dir = pj(self.working_dir, "LOGS")
for d in (self.source_dir, self.archive_dir, self.toolchain_dir, self.log_dir):
os.makedirs(d, exist_ok=True)
self.detect_platform()
if dummy_run:
# If this is for a dummy run, we will not run anything.
# To check for command (and so, don't enforce their presence)
return
self.ninja_command = self._detect_command(
"ninja", default=[["ninja"], ["ninja-build"]]
)
self.meson_command = self._detect_command(
"meson", default=[["meson.py"], ["meson"]]
)
self.mesontest_command = [*self.meson_command, "test"]
self.patch_command = self._detect_command("patch")
self.git_command = self._detect_command("git")
if platform.system() == "Windows":
self.make_command = self._detect_command("nmake", options=["/?", "/NOLOGO"])
else:
self.make_command = self._detect_command("make")
self.cmake_command = self._detect_command("cmake")
self.qmake_command = self._detect_command(
"qmake", required=False, default=[["qmake"], ["qmake-qt5"]]
)
def detect_platform(self):
_platform = platform.system()
self.distname = _platform
if _platform == "Linux":
self.distname = distro.id()
if self.distname == "ubuntu":
self.distname = "debian"
def download(self, what, where=None):
where = where or self.archive_dir
download_remote(what, where)
def _detect_command(self, name, default=None, options=["--version"], required=True):
if default is None:
default = [[name]]
env_key = "KBUILD_{}_COMMAND".format(name.upper())
if env_key in os.environ:
default = [os.environ[env_key].split()] + default
for command in default:
try:
retcode = subprocess.check_call(
command + options, stdout=subprocess.DEVNULL
)
except (FileNotFoundError, PermissionError, OSError):
# Doesn't exist in PATH or isn't executable
continue
if retcode == 0:
return command
else:
if required:
sys.exit("ERROR: {} command not found".format(name))
else:
print("WARNING: {} command not found".format(name), file=sys.stderr)
return ["{}_NOT_FOUND".format(name.upper())]
class BuildEnv:
def __init__(self, configInfo):
self.configInfo = configInfo
self.base_build_dir = pj(option("working_dir"), option("build_dir"))
build_dir = (
configInfo.arch_name if option("use_target_arch_name") else configInfo.name
)
build_dir = f"BUILD_{build_dir}"
self.build_dir = pj(self.base_build_dir, build_dir)
self.install_dir = pj(self.build_dir, "INSTALL")
self.toolchain_dir = pj(self.build_dir, "TOOLCHAINS")
self.log_dir = pj(self.build_dir, "LOGS")
for d in (self.build_dir, self.install_dir, self.toolchain_dir, self.log_dir):
os.makedirs(d, exist_ok=True)
self.libprefix = option("libprefix") or self._detect_libdir()
def clean_intermediate_directories(self):
for subdir in os.listdir(self.build_dir):
subpath = pj(self.build_dir, subdir)
if subpath == self.install_dir:
continue
if os.path.isdir(subpath):
shutil.rmtree(subpath)
else:
os.remove(subpath)
def _is_debianlike(self):
return os.path.isfile("/etc/debian_version")
def _detect_libdir(self):
if self.configInfo.libdir is not None:
return self.configInfo.libdir
if self._is_debianlike():
try:
pc = subprocess.Popen(
["dpkg-architecture", "-qDEB_HOST_MULTIARCH"],
stdout=subprocess.PIPE,
stderr=subprocess.DEVNULL,
)
(stdo, _) = pc.communicate()
if pc.returncode == 0:
archpath = stdo.decode().strip()
return "lib/" + archpath
except Exception:
pass
if os.path.isdir("/usr/lib64") and not os.path.islink("/usr/lib64"):
return "lib64"
return "lib"
def get_env(self, *, cross_comp_flags, cross_compilers, cross_path):
env = self.configInfo.get_env()
pkgconfig_path = pj(self.install_dir, self.libprefix, "pkgconfig")
env["PKG_CONFIG_PATH"].append(pkgconfig_path)
env["PATH"].insert(0, pj(self.install_dir, "bin"))
env["LD_LIBRARY_PATH"].extend(
[
pj(self.install_dir, "lib"),
pj(self.install_dir, self.libprefix),
]
)
env["QMAKE_CXXFLAGS"] = " ".join(
[escape_path("-I" + pj(self.install_dir, "include")), env["QMAKE_CXXFLAGS"]]
)
env["CPPFLAGS"] = " ".join(
[escape_path("-I" + pj(self.install_dir, "include")), env["CPPFLAGS"]]
)
env["QMAKE_LFLAGS"] = " ".join(
[
escape_path("-L" + pj(self.install_dir, "lib")),
escape_path("-L" + pj(self.install_dir, self.libprefix)),
env["QMAKE_LFLAGS"],
]
)
env["LDFLAGS"] = " ".join(
[
escape_path("-L" + pj(self.install_dir, "lib")),
escape_path("-L" + pj(self.install_dir, self.libprefix)),
env["LDFLAGS"],
]
)
if cross_comp_flags:
self.configInfo.set_comp_flags(env)
if cross_compilers:
self.configInfo.set_compiler(env)
if cross_path:
env["PATH"][0:0] = self.configInfo.get_bin_dir()
return env
@property
def configure_wrapper(self):
try:
yield self.configInfo.configure_wrapper
except AttributeError:
pass
@property
def make_wrapper(self):
try:
yield self.configInfo.make_wrapper
except AttributeError:
pass

213
kiwixbuild/builder.py Normal file
View File

@ -0,0 +1,213 @@
import sys
from collections import OrderedDict
from .buildenv import *
from .configs import ConfigInfo
from .utils import remove_duplicates, StopBuild, colorize
from .dependencies import Dependency
from .packages import PACKAGE_NAME_MAPPERS
from ._global import (
neutralEnv,
option,
add_target_step,
get_target_step,
target_steps,
)
from . import _global
class Builder:
def __init__(self):
self._targets = {}
ConfigInfo.get_config("neutral", self._targets)
config_name = option("config")
config = ConfigInfo.get_config(config_name, self._targets)
if neutralEnv("distname") not in config.compatible_hosts:
print(
(
colorize("ERROR") + ": The config {} cannot be build on host {}.\n"
"Select another config or change your host system."
).format(config.name, neutralEnv("distname"))
)
self.targetDefs = config.add_targets(option("target"), self._targets)
def finalize_target_steps(self):
steps = []
for targetDef in self.targetDefs:
steps += self.order_steps(targetDef)
steps = list(remove_duplicates(steps))
if option("build_nodeps"):
# add all config steps
for dep in steps:
stepClass = Dependency.all_deps[dep[1]]
if stepClass.dont_skip:
add_target_step(dep, self._targets[dep])
src_targetDef = ("source", targetDef[1])
add_target_step(src_targetDef, self._targets[src_targetDef])
add_target_step(targetDef, self._targets[targetDef])
else:
for dep in steps:
if option("build_deps_only") and dep[1] == targetDef[1]:
continue
add_target_step(dep, self._targets[dep])
self.instanciate_steps()
def order_steps(self, targetDef):
for cfgName in ConfigInfo.all_running_configs:
cfg = ConfigInfo.all_configs[cfgName]
for tlcName in cfg.toolchain_names:
tlc = Dependency.all_deps[tlcName]
yield ("source", tlcName)
yield ("neutral" if tlc.neutral else cfgName, tlcName)
_targets = dict(self._targets)
yield from self.order_dependencies(targetDef, _targets)
def order_dependencies(self, targetDef, targets):
targetConfigName, targetName = targetDef
if targetConfigName == "source":
# Do not try to order sources, they will be added as dep by the
# build step two lines later.
return
try:
target = targets.pop(targetDef)
except KeyError:
return
targetConfig = ConfigInfo.get_config(targetConfigName)
for dep in target.get_dependencies(targetConfig, True):
depConfig, depName = targetConfig.get_fully_qualified_dep(dep)
if (depConfig, depName) in targets:
yield from self.order_dependencies((depConfig, depName), targets)
yield ("source", targetName)
yield targetDef
def instanciate_steps(self):
for stepDef in list(target_steps()):
stepConfig, stepName = stepDef
stepClass = Dependency.all_deps[stepName]
if stepConfig == "source":
source = get_target_step(stepDef)(stepClass)
add_target_step(stepDef, source)
else:
source = get_target_step(stepName, "source")
env = ConfigInfo.get_config(stepConfig).buildEnv
builder = get_target_step(stepDef)(stepClass, source, env)
add_target_step(stepDef, builder)
def prepare_sources(self):
if option("skip_source_prepare"):
print(colorize("SKIP"))
return
sourceDefs = remove_duplicates(
tDef for tDef in target_steps() if tDef[0] == "source"
)
for sourceDef in sourceDefs:
print("prepare sources {} :".format(sourceDef[1]))
source = get_target_step(sourceDef)
source.prepare()
def build(self):
builderDefs = (tDef for tDef in target_steps() if tDef[0] != "source")
for builderDef in builderDefs:
builder = get_target_step(builderDef)
if option("make_dist") and builderDef[1] == option("target"):
print("make dist {} ({}):".format(builder.name, builderDef[0]))
builder.make_dist()
continue
print("build {} ({}):".format(builder.name, builderDef[0]))
add_target_step(builderDef, builder)
builder.build()
def _get_packages(self):
packages_list = []
for config in ConfigInfo.all_running_configs.values():
mapper_name = "{host}_{config}".format(
host=neutralEnv("distname"), config=config
)
package_name_mapper = PACKAGE_NAME_MAPPERS.get(mapper_name, {})
packages_list += package_name_mapper.get("COMMON", [])
to_drop = []
for builderDef in self._targets:
configName, builderName = builderDef
mapper_name = "{host}_{config}".format(
host=neutralEnv("distname"), config=configName
)
package_name_mapper = PACKAGE_NAME_MAPPERS.get(mapper_name, {})
packages = package_name_mapper.get(builderName)
if packages:
to_drop.append(builderDef)
if packages is not True:
# True means "assume the dependency is install but do not try to install anything for it"
packages_list += packages
for dep in to_drop:
del self._targets[dep]
return packages_list
def install_packages(self):
packages_to_have = self._get_packages()
packages_to_have = remove_duplicates(packages_to_have)
if option("assume_packages_installed"):
print(colorize("SKIP") + ", Assume package installed")
return
distname = neutralEnv("distname")
if distname in ("fedora", "redhat", "centos"):
package_installer = "sudo dnf install {}"
package_checker = "rpm -q --quiet {}"
elif distname in ("debian", "Ubuntu"):
package_installer = "sudo apt-get install {}"
package_checker = 'LANG=C dpkg -s {} 2>&1 | grep Status | grep "ok installed" 1>/dev/null 2>&1'
elif distname == "Darwin":
package_installer = "brew install {}"
package_checker = "brew ls --version {} > /dev/null"
packages_to_install = []
for package in packages_to_have:
print(" - {} : ".format(package), end="")
command = package_checker.format(package)
try:
subprocess.check_call(command, shell=True)
except subprocess.CalledProcessError:
print(colorize("NEEDED"))
packages_to_install.append(package)
else:
print(colorize("SKIP"))
if packages_to_install:
command = package_installer.format(" ".join(packages_to_install))
print(command)
subprocess.check_call(command, shell=True)
else:
print(colorize("SKIP") + ", No package to install.")
def run(self):
try:
print("[INSTALL PACKAGES]")
if option("dont_install_packages"):
print(colorize("SKIP"))
else:
self.install_packages()
self.finalize_target_steps()
print("[SETUP TOOLCHAINS]")
for config in ConfigInfo.all_running_configs.values():
config.finalize_setup()
print("[PREPARE]")
self.prepare_sources()
print("[BUILD]")
self.build()
# No error, clean intermediate file at end of build if needed.
print("[CLEAN]")
if option("clean_at_end"):
for config in ConfigInfo.all_running_configs.values():
config.clean_intermediate_directories()
else:
print(colorize("SKIP"))
except StopBuild as e:
print(e)
sys.exit("Stopping build due to errors")

View File

@ -0,0 +1,3 @@
from .base import *
from . import android, armhf, musl, flatpak, i586, ios, native, neutral, wasm

View File

@ -0,0 +1,169 @@
from .base import ConfigInfo, MetaConfigInfo
from kiwixbuild.utils import pj
from kiwixbuild._global import get_target_step, option
class AndroidConfigInfo(ConfigInfo):
build = "android"
static = True
toolchain_names = ["android-ndk"]
compatible_hosts = ["fedora", "debian"]
def __str__(self):
return "android"
@property
def libdir(self):
return "lib/{}".format(self.arch_full)
@property
def binaries_name(self):
arch_full = self.arch_full
return {
"CC": "{}-{}".format(arch_full, "clang"),
"CXX": "{}-{}".format(arch_full, "clang++"),
"AR": "{}-{}".format(arch_full, "ar"),
"STRIP": "{}-{}".format(arch_full, "strip"),
"RANLIB": "{}-{}".format(arch_full, "ranlib"),
"LD": "{}-{}".format(arch_full, "ld"),
}
def binaries(self):
install_path = self.install_path
binaries = {
k: pj(install_path, "bin", v) for k, v in self.binaries_name.items()
}
binaries["PKGCONFIG"] = "pkg-config"
return binaries
@property
def ndk_builder(self):
return get_target_step("android-ndk", self.name)
@property
def install_path(self):
return self.ndk_builder.install_path
def get_cross_config(self):
extra_libs = [
"-llog",
"-Wl,--exclude-libs,libgcc.a",
"-Wl,--exclude-libs,libunwind.a",
]
extra_cflags = [
"-I{}".format(include_dir) for include_dir in self.get_include_dirs()
]
if hasattr(self, "march"):
extra_libs.append("-march={}".format(self.march))
extra_cflags.append("-march={}".format(self.march))
return {
"exe_wrapper_def": "",
"install_path": self.install_path,
"binaries": self.binaries(),
"root_path": pj(self.install_path, "sysroot"),
"extra_libs": extra_libs,
"extra_cflags": extra_cflags,
"host_machine": {
"system": "Android",
"lsystem": "android",
"cpu_family": self.arch,
"cpu": self.cpu,
"endian": "little",
"abi": self.abi,
},
}
def get_env(self):
env = super().get_env()
root_path = pj(self.install_path, "sysroot")
env["PKG_CONFIG_LIBDIR"] = pj(root_path, "lib", "pkgconfig")
env["NDK_DEBUG"] = "0"
return env
def get_bin_dir(self):
return [pj(self.install_path, "bin")]
def set_comp_flags(self, env):
super().set_comp_flags(env)
root_path = pj(self.install_path, "sysroot")
march = "-march={}".format(self.march) if hasattr(self, "march") else ""
env["CFLAGS"] = (
"-fPIC -D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64 --sysroot={} {} ".format(
root_path, march
)
+ env["CFLAGS"]
)
env["CXXFLAGS"] = (
"-fPIC -D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64 --sysroot={} {} ".format(
root_path, march
)
+ env["CXXFLAGS"]
)
env["LDFLAGS"] = "--sysroot={} {} ".format(root_path, march) + env["LDFLAGS"]
def set_compiler(self, env):
binaries = self.binaries()
for k, v in binaries.items():
env[k] = v
@property
def configure_options(self):
yield "--host={}".format(self.arch_full)
def finalize_setup(self):
super().finalize_setup()
self.buildEnv.cmake_crossfile = self._gen_crossfile(
"cmake_android_cross_file.txt", "cmake_cross_file.txt"
)
self.buildEnv.meson_crossfile = self._gen_crossfile("meson_cross_file.txt")
class AndroidArm(AndroidConfigInfo):
name = "android_arm"
arch = cpu = "arm"
arch_full = "arm-linux-androideabi"
abi = "armeabi-v7a"
march = "armv7-a"
class AndroidArm64(AndroidConfigInfo):
name = "android_arm64"
arch = "arm64"
arch_full = "aarch64-linux-android"
cpu = "aarch64"
abi = "arm64-v8a"
class AndroidX86(AndroidConfigInfo):
name = "android_x86"
arch = abi = "x86"
arch_full = "i686-linux-android"
cpu = "i686"
class AndroidX8664(AndroidConfigInfo):
name = "android_x86_64"
arch = cpu = abi = "x86_64"
arch_full = "x86_64-linux-android"
class Android(MetaConfigInfo):
name = "android"
compatible_hosts = ["fedora", "debian"]
@property
def arch_name(self):
return "multi-linux-android"
@property
def subConfigNames(self):
return ["android_{}".format(arch) for arch in option("android_arch")]
def add_targets(self, targetName, targets):
return super().add_targets(targetName, targets)
def __str__(self):
return self.name
def set_comp_flags(self, env):
pass

183
kiwixbuild/configs/armhf.py Normal file
View File

@ -0,0 +1,183 @@
from .base import ConfigInfo, MixedMixin
from kiwixbuild.utils import pj
from kiwixbuild._global import get_target_step
# Base config for arm
class ArmConfigInfo(ConfigInfo):
compatible_hosts = ["fedora", "debian", "almalinux"]
def get_cross_config(self):
return {
"binaries": self.binaries,
"exe_wrapper_def": "",
"root_path": self.root_path,
"extra_libs": [],
"extra_cflags": [
"-I{}".format(include_dir) for include_dir in self.get_include_dirs()
],
"host_machine": {
"system": "linux",
"lsystem": "linux",
"cpu_family": self.cpu_family,
"cpu": self.cpu,
"endian": "little",
"abi": "",
},
}
@property
def libdir(self):
return "lib/{}".format(self.arch_full)
@property
def toolchain(self):
return get_target_step(self.build, "neutral")
@property
def root_path(self):
return self.toolchain.build_path
@property
def binaries(self):
binaries = (
(k, "{}-{}".format(self.arch_full, v))
for k, v in (
("CC", "gcc"),
("CXX", "g++"),
("AR", "ar"),
("STRIP", "strip"),
("WINDRES", "windres"),
("RANLIB", "ranlib"),
("LD", "ld"),
("LDSHARED", "g++ -shared"),
)
)
binaries = {k: pj(self.root_path, "bin", v) for k, v in binaries}
binaries["PKGCONFIG"] = "pkg-config"
return binaries
@property
def exe_wrapper_def(self):
try:
which("qemu-arm")
except subprocess.CalledProcessError:
return ""
else:
return "exe_wrapper = 'qemu-arm'"
@property
def configure_options(self):
yield "--host={}".format(self.arch_full)
def get_bin_dir(self):
return [pj(self.root_path, "bin")]
def get_env(self):
env = super().get_env()
env["LD_LIBRARY_PATH"][0:0] = [
pj(self.root_path, self.arch_full, "lib64"),
pj(self.root_path, "lib"),
]
env["PKG_CONFIG_LIBDIR"] = pj(self.root_path, "lib", "pkgconfig")
env["QEMU_LD_PREFIX"] = pj(self.root_path, self.arch_full, "libc")
env["QEMU_SET_ENV"] = "LD_LIBRARY_PATH={}".format(
":".join(
[pj(self.root_path, self.arch_full, "lib"), str(env["LD_LIBRARY_PATH"])]
)
)
return env
def set_comp_flags(self, env):
super().set_comp_flags(env)
env["CFLAGS"] = (
" -fPIC -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 "
+ env["CFLAGS"]
)
env["CXXFLAGS"] = (
" -fPIC -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 "
+ env["CXXFLAGS"]
)
def set_compiler(self, env):
for k, v in self.binaries.items():
env[k] = v
def finalize_setup(self):
super().finalize_setup()
self.buildEnv.cmake_crossfile = self._gen_crossfile("cmake_cross_file.txt")
self.buildEnv.meson_crossfile = self._gen_crossfile("meson_cross_file.txt")
class Armv6(ArmConfigInfo):
build = "armv6"
arch_full = "armv6-rpi-linux-gnueabihf"
toolchain_names = ["armv6"]
cpu_family = "arm"
cpu = "armv6"
class Armv6Dyn(Armv6):
name = "armv6_dyn"
static = False
class Armv6Static(Armv6):
name = "armv6_static"
static = True
class Armv6Mixed(MixedMixin("armv6_static"), Armv6):
name = "armv6_mixed"
static = False
class Armv8(ArmConfigInfo):
build = "armv8"
arch_full = "armv8-rpi3-linux-gnueabihf"
toolchain_names = ["armv8"]
cpu_family = "arm"
cpu = "armv8"
class Armv8Dyn(Armv8):
name = "armv8_dyn"
static = False
class Armv8Static(Armv8):
name = "armv8_static"
static = True
class Armv8Mixed(MixedMixin("armv8_static"), Armv8):
name = "armv8_mixed"
static = False
class Aarch64(ArmConfigInfo):
build = "aarch64"
arch_full = "aarch64-linux-gnu"
toolchain_names = ["aarch64"]
cpu_family = "aarch64"
cpu = "aarch64"
@property
def root_path(self):
return self.toolchain.build_path
class Aarch64Dyn(Aarch64):
name = "aarch64_dyn"
static = False
class Aarch64Static(Aarch64):
name = "aarch64_static"
static = True
class Aarch64Mixed(MixedMixin("aarch64_static"), Aarch64):
name = "aarch64_mixed"
static = False

179
kiwixbuild/configs/base.py Normal file
View File

@ -0,0 +1,179 @@
import os, sys
import subprocess
from kiwixbuild.dependencies import Dependency
from kiwixbuild.utils import pj, remove_duplicates, DefaultEnv
from kiwixbuild.buildenv import BuildEnv
from kiwixbuild._global import neutralEnv, option, target_steps
_SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
TEMPLATES_DIR = pj(os.path.dirname(_SCRIPT_DIR), "templates")
class _MetaConfig(type):
def __new__(cls, name, bases, dct):
_class = type.__new__(cls, name, bases, dct)
if name not in ("ConfigInfo", "MetaConfigInfo") and "name" in dct:
dep_name = dct["name"]
ConfigInfo.all_configs[dep_name] = _class
return _class
class ConfigInfo(metaclass=_MetaConfig):
all_configs = {}
all_running_configs = {}
toolchain_names = []
configure_options = []
mixed = False
libdir = None
@property
def arch_name(self):
return self.arch_full
@classmethod
def get_config(cls, name, targets=None):
if name not in cls.all_running_configs:
if targets is None:
print("Should not got there.")
print(cls.all_running_configs)
raise KeyError(name)
cls.all_running_configs[name] = cls.all_configs[name](targets)
return cls.all_running_configs[name]
def __init__(self, targets):
self.all_running_configs[self.name] = self
self.buildEnv = BuildEnv(self)
self.setup_toolchains(targets)
def __str__(self):
return "{}_{}".format(self.build, "static" if self.static else "dyn")
def setup_toolchains(self, targets):
for tlc_name in self.toolchain_names:
ToolchainClass = Dependency.all_deps[tlc_name]
targets[("source", tlc_name)] = ToolchainClass.Source
cfg_name = "neutral" if ToolchainClass.neutral else self.name
targets[(cfg_name, tlc_name)] = ToolchainClass.Builder
def add_targets(self, targetName, targets):
if (self.name, targetName) in targets:
return []
targetClass = Dependency.all_deps[targetName]
targets[("source", targetName)] = targetClass.Source
targets[(self.name, targetName)] = targetClass.Builder
for dep in targetClass.Builder.get_dependencies(self, False):
if isinstance(dep, tuple):
depConfigName, depName = dep
else:
depConfigName, depName = self.name, dep
depConfig = self.get_config(depConfigName, targets)
depConfig.add_targets(depName, targets)
return [(self.name, targetName)]
def get_fully_qualified_dep(self, dep):
if isinstance(dep, tuple):
return dep
else:
return self.name, dep
def get_cross_config(self):
return {}
def get_include_dirs(self):
return [pj(self.buildEnv.install_dir, "include")]
def get_env(self):
return DefaultEnv()
def get_bin_dir(self):
return []
def set_compiler(self, env):
pass
def set_comp_flags(self, env):
if self.static:
env["CFLAGS"] = env["CFLAGS"] + " -fPIC"
env["CXXFLAGS"] = env["CXXFLAGS"] + " -fPIC"
def _gen_crossfile(self, name, outname=None):
if outname is None:
outname = name
crossfile = pj(self.buildEnv.build_dir, outname)
template_file = pj(TEMPLATES_DIR, name)
with open(template_file, "r") as f:
template = f.read()
content = template.format(**self.get_cross_config())
with open(crossfile, "w") as outfile:
outfile.write(content)
return crossfile
def finalize_setup(self):
self.buildEnv.cross_config = self.get_cross_config()
self.buildEnv.meson_crossfile = None
self.buildEnv.cmake_crossfile = None
def clean_intermediate_directories(self):
self.buildEnv.clean_intermediate_directories()
class MetaConfigInfo(ConfigInfo):
subConfigNames = []
def add_targets(self, targetName, targets):
targetDefs = []
for configName in self.subConfigNames:
config = self.get_config(configName, targets)
targetDefs += config.add_targets(targetName, targets)
return targetDefs
def MixedMixin(static_name):
class MixedMixinClass:
mixed = True
static = False
def add_targets(self, targetName, targets):
if option("target") == targetName:
return super().add_targets(targetName, targets)
else:
static_config = self.get_config(static_name, targets)
return static_config.add_targets(targetName, targets)
def get_fully_qualified_dep(self, dep):
if isinstance(dep, tuple):
return dep
if option("target") == dep:
return self.name, dep
return static_name, dep
@property
def static_buildEnv(self):
static_config = self.get_config(static_name)
return static_config.buildEnv
def get_include_dirs(self):
return [
pj(self.buildEnv.install_dir, "include"),
pj(self.static_buildEnv.install_dir, "include"),
]
def get_env(self):
env = super().get_env()
env["PATH"].insert(0, pj(self.static_buildEnv.install_dir, "bin"))
pkgconfig_path = pj(
self.static_buildEnv.install_dir,
self.static_buildEnv.libprefix,
"pkgconfig",
)
env["PKG_CONFIG_PATH"].append(pkgconfig_path)
env["CPPFLAGS"] = " ".join(
[
"-I" + pj(self.static_buildEnv.install_dir, "include"),
env["CPPFLAGS"],
]
)
return env
return MixedMixinClass

View File

@ -0,0 +1,19 @@
from .base import ConfigInfo
from kiwixbuild._global import option, neutralEnv
class FlatpakConfigInfo(ConfigInfo):
name = "flatpak"
arch_name = "flatpak"
build = "flatpak"
static = ""
toolchain_names = ["org.kde", "io.qt.qtwebengine"]
compatible_hosts = ["debian", "fedora"]
def __str__(self):
return "flatpak"
def get_env(self):
env = super().get_env()
env["FLATPAK_USER_DIR"] = self.buildEnv.build_dir
return env

View File

@ -0,0 +1,79 @@
import os
from .base import ConfigInfo
from kiwixbuild.utils import which, pj
class I586ConfigInfo(ConfigInfo):
build = "i586"
arch_full = "i586-linux-gnu"
compatible_hosts = ["fedora", "debian"]
def get_cross_config(self):
return {
"binaries": self.binaries,
"exe_wrapper_def": "",
"extra_libs": ["-m32", "-march=i586", "-mno-sse"],
"extra_cflags": [
"-m32",
"-march=i586",
"-mno-sse",
*(
"-I{}".format(include_dir)
for include_dir in self.get_include_dirs()
),
],
"host_machine": {
"system": "linux",
"lsystem": "linux",
"cpu_family": "x86",
"cpu": "i586",
"endian": "little",
"abi": "",
},
}
@property
def configure_options(self):
yield f"--host={self.arch_full}"
@property
def binaries(self):
return {
k: which(v)
for k, v in (
("CC", os.environ.get("CC", "gcc")),
("CXX", os.environ.get("CXX", "g++")),
("AR", "ar"),
("STRIP", "strip"),
("RANLIB", "ranlib"),
("LD", "ld"),
("PKGCONFIG", "pkg-config"),
)
}
def set_comp_flags(self, env):
super().set_comp_flags(env)
env["CFLAGS"] = "-m32 -march=i586 -mno-sse " + env["CFLAGS"]
env["CXXFLAGS"] = "-m32 -march=i586 -mno-sse " + env["CXXFLAGS"]
env["LDFLAGS"] = "-m32 -march=i586 -mno-sse " + env["LDFLAGS"]
def get_bin_dir(self):
return []
def finalize_setup(self):
super().finalize_setup()
self.buildEnv.cmake_crossfile = self._gen_crossfile(
"cmake_i586_cross_file.txt", "cmake_cross_file.txt"
)
self.buildEnv.meson_crossfile = self._gen_crossfile("meson_cross_file.txt")
class I586Dyn(I586ConfigInfo):
name = "i586_dyn"
static = False
class I586Static(I586ConfigInfo):
name = "i586_static"
static = True

249
kiwixbuild/configs/ios.py Normal file
View File

@ -0,0 +1,249 @@
import subprocess
from kiwixbuild._global import option
from kiwixbuild.utils import pj, xrun_find
from .base import ConfigInfo, MetaConfigInfo, MixedMixin
from kiwixbuild.dependencies.apple_xcframework import AppleXCFramework
MIN_MACOS_VERSION = "12.0"
class AppleConfigInfo(ConfigInfo):
build = "iOS"
static = True
compatible_hosts = ["Darwin"]
arch = None
host = None
target = None
sdk_name = None
min_iphoneos_version = None
min_macos_version = None
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self._root_path = None
@property
def arch_name(self):
return self.target
@property
def root_path(self):
if self._root_path is None:
command = "xcrun --sdk {} --show-sdk-path".format(self.sdk_name)
self._root_path = subprocess.check_output(command, shell=True)[:-1].decode()
return self._root_path
def __str__(self):
return "iOS"
def finalize_setup(self):
super().finalize_setup()
self.buildEnv.cmake_crossfile = self._gen_crossfile(
"cmake_ios_cross_file.txt", "cmake_cross_file.txt"
)
self.buildEnv.meson_crossfile = self._gen_crossfile(
"meson_ios_cross_file.txt", "meson_cross_file.txt"
)
def get_cross_config(self):
config = {
"root_path": self.root_path,
"binaries": self.binaries,
"exe_wrapper_def": "",
"extra_libs": [
"-isysroot",
self.root_path,
"-arch",
self.arch,
"-target",
self.target,
],
"extra_cflags": [
"-isysroot",
self.root_path,
"-arch",
self.arch,
"-target",
self.target,
*(
"-I{}".format(include_dir)
for include_dir in self.get_include_dirs()
),
],
"host_machine": {
"system": "Darwin",
"lsystem": "darwin",
"cpu_family": self.arch,
"cpu": self.cpu,
"endian": "",
"abi": "",
},
}
if self.min_iphoneos_version:
config["extra_libs"].append(
"-miphoneos-version-min={}".format(self.min_iphoneos_version)
)
config["extra_cflags"].append(
"-miphoneos-version-min={}".format(self.min_iphoneos_version)
)
if self.min_macos_version:
config["extra_libs"].append(
"-mmacosx-version-min={}".format(self.min_macos_version)
)
config["extra_cflags"].append(
"-mmacosx-version-min={}".format(self.min_macos_version)
)
return config
def get_env(self):
env = super().get_env()
cflags = [env["CFLAGS"]]
if self.min_iphoneos_version:
cflags.append("-miphoneos-version-min={}".format(self.min_iphoneos_version))
if self.min_macos_version:
cflags.append("-mmacosx-version-min={}".format(self.min_macos_version))
env["CFLAGS"] = " ".join(cflags)
return env
def set_comp_flags(self, env):
super().set_comp_flags(env)
cflags = [
"-isysroot {}".format(self.root_path),
"-arch {}".format(self.arch),
"-target {}".format(self.target),
env["CFLAGS"],
]
if self.min_iphoneos_version:
cflags.append("-miphoneos-version-min={}".format(self.min_iphoneos_version))
env["CFLAGS"] = " ".join(cflags)
env["CXXFLAGS"] = " ".join(
[
env["CFLAGS"],
"-std=c++11",
env["CXXFLAGS"],
]
)
env["LDFLAGS"] = " ".join(
[
" -arch {}".format(self.arch),
"-isysroot {}".format(self.root_path),
]
)
def get_bin_dir(self):
return [pj(self.root_path, "bin")]
@property
def binaries(self):
return {
"CC": xrun_find("clang"),
"CXX": xrun_find("clang++"),
"AR": xrun_find("ar"),
"STRIP": xrun_find("strip"),
"RANLIB": xrun_find("ranlib"),
"LD": xrun_find("ld"),
"PKGCONFIG": "pkg-config",
}
@property
def configure_options(self):
yield f"--host={self.host}"
class iOSArm64(AppleConfigInfo):
name = "iOS_arm64"
arch = cpu = "arm64"
host = "arm-apple-darwin"
target = "aarch64-apple-ios"
sdk_name = "iphoneos"
min_iphoneos_version = "15.0"
class iOSx64Simulator(AppleConfigInfo):
name = "iOSSimulator_x86_64"
arch = cpu = "x86_64"
host = "x86_64-apple-darwin"
target = "x86-apple-ios-simulator"
sdk_name = "iphonesimulator"
min_iphoneos_version = "15.0"
class iOSArm64Simulator(AppleConfigInfo):
name = "iOSSimulator_arm64"
arch = cpu = "arm64"
host = "arm-apple-darwin"
target = "aarch64-apple-ios-simulator"
sdk_name = "iphonesimulator"
min_iphoneos_version = "15.0"
class macOSArm64(AppleConfigInfo):
name = "macOS_arm64_static"
arch = cpu = "arm64"
host = "aarch64-apple-darwin"
target = "arm64-apple-macos"
sdk_name = "macosx"
min_iphoneos_version = None
min_macos_version = MIN_MACOS_VERSION
class macOSArm64Mixed(MixedMixin("macOS_arm64_static"), AppleConfigInfo):
name = "macOS_arm64_mixed"
arch = cpu = "arm64"
host = "aarch64-apple-darwin"
target = "arm64-apple-macos"
sdk_name = "macosx"
min_iphoneos_version = None
min_macos_version = MIN_MACOS_VERSION
class macOSx64(AppleConfigInfo):
name = "macOS_x86_64"
arch = cpu = "x86_64"
host = "x86_64-apple-darwin"
target = "x86_64-apple-macos"
sdk_name = "macosx"
min_iphoneos_version = None
min_macos_version = MIN_MACOS_VERSION
class IOS(MetaConfigInfo):
name = "iOS_multi"
compatible_hosts = ["Darwin"]
@property
def arch_name(self):
return self.name
@property
def subConfigNames(self):
return ["iOS_{}".format(arch) for arch in option("ios_arch")]
def add_targets(self, targetName, targets):
super().add_targets(targetName, targets)
return ConfigInfo.add_targets(self, "_ios_fat_lib", targets)
def __str__(self):
return self.name
class AppleStaticAll(MetaConfigInfo):
name = "apple_all_static"
compatible_hosts = ["Darwin"]
@property
def arch_name(self):
return self.name
@property
def subConfigNames(self):
return AppleXCFramework.subConfigNames
def add_targets(self, targetName, targets):
super().add_targets(targetName, targets)
return ConfigInfo.add_targets(self, "apple_xcframework", targets)
def __str__(self):
return self.name

157
kiwixbuild/configs/musl.py Normal file
View File

@ -0,0 +1,157 @@
from .base import ConfigInfo, MixedMixin
from kiwixbuild.utils import pj
from kiwixbuild._global import get_target_step
class MuslConfigInfo(ConfigInfo):
compatible_hosts = ["fedora", "debian"]
def get_cross_config(self):
return {
"binaries": self.binaries,
"exe_wrapper_def": "",
"root_path": self.root_path,
"extra_libs": [],
"extra_cflags": [
"-I{}".format(include_dir) for include_dir in self.get_include_dirs()
],
"host_machine": {
"system": "linux",
"lsystem": "linux",
"cpu_family": self.cpu_family,
"cpu": self.cpu,
"endian": "little",
"abi": "",
},
}
@property
def toolchain(self):
return get_target_step(self.build, "neutral")
@property
def root_path(self):
return self.toolchain.build_path
@property
def binaries(self):
binaries = (
(k, "{}-{}".format(self.arch_full, v))
for k, v in (
("CC", "gcc"),
("CXX", "g++"),
("AR", "ar"),
("STRIP", "strip"),
("WINDRES", "windres"),
("RANLIB", "ranlib"),
("LD", "ld"),
("LDSHARED", "g++ -shared"),
)
)
binaries = {k: pj(self.root_path, "bin", v) for k, v in binaries}
binaries["PKGCONFIG"] = "pkg-config"
return binaries
@property
def exe_wrapper_def(self):
try:
which(self.qemu)
except subprocess.CalledProcessError:
return ""
except AttributeError:
return ""
else:
return f"exe_wrapper = '{self.qemu}'"
@property
def configure_options(self):
return [f"--host={self.arch_full}"]
def get_bin_dir(self):
return [pj(self.root_path, "bin")]
def get_env(self):
env = super().get_env()
env["LD_LIBRARY_PATH"][0:0] = [
pj(self.root_path, self.arch_full, "lib64"),
pj(self.root_path, "lib"),
]
env["PKG_CONFIG_LIBDIR"] = pj(self.root_path, "lib", "pkgconfig")
env["QEMU_LD_PREFIX"] = pj(self.root_path, self.arch_full, "libc")
env["QEMU_SET_ENV"] = "LD_LIBRARY_PATH={}".format(
":".join(
[pj(self.root_path, self.arch_full, "lib"), str(env["LD_LIBRARY_PATH"])]
)
)
return env
def set_comp_flags(self, env):
super().set_comp_flags(env)
env["LD_LIBRARY_PATH"].insert(0, pj(self.root_path, self.arch_full, "lib"))
env["CFLAGS"] = (
" -fPIC -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 "
+ env["CFLAGS"]
)
env["CXXFLAGS"] = (
" -fPIC -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 "
+ env["CXXFLAGS"]
)
def set_compiler(self, env):
for k, v in self.binaries.items():
env[k] = v
def finalize_setup(self):
super().finalize_setup()
self.buildEnv.cmake_crossfile = self._gen_crossfile("cmake_cross_file.txt")
self.buildEnv.meson_crossfile = self._gen_crossfile("meson_cross_file.txt")
class Aarch64MuslConfigInfo(MuslConfigInfo):
build = "aarch64_musl"
arch_full = "aarch64-linux-musl"
toolchain_names = ["aarch64_musl"]
libdir = "lib/aarch64-linux-musl"
cpu_family = "arm"
cpu = "armhf"
qemu = "qemu-arm"
class Aarch64MuslDyn(Aarch64MuslConfigInfo):
name = "aarch64_musl_dyn"
static = False
class Aarch64MuslStatic(Aarch64MuslConfigInfo):
name = "aarch64_musl_static"
static = True
class Aarch64MuslMixed(MixedMixin("aarch64_musl_static"), Aarch64MuslConfigInfo):
name = "aarch64_musl_mixed"
static = False
class X86_64MuslConfigInfo(MuslConfigInfo):
build = "x86-64_musl"
arch_full = "x86_64-linux-musl"
toolchain_names = ["x86-64_musl"]
libdir = "lib/x86_64-linux-musl"
cpu_family = "x86_64"
cpu = "x86_64"
class X86_64MuslDyn(X86_64MuslConfigInfo):
name = "x86-64_musl_dyn"
static = False
class X86_64MuslStatic(X86_64MuslConfigInfo):
name = "x86-64_musl_static"
static = True
class x86_64MuslMixed(MixedMixin("x86-64_musl_static"), X86_64MuslConfigInfo):
name = "x86-64_musl_mixed"
static = False

View File

@ -0,0 +1,44 @@
from .base import ConfigInfo, MixedMixin
from kiwixbuild.utils import pj
from kiwixbuild._global import option, neutralEnv
from kiwixbuild.configs.ios import MIN_MACOS_VERSION
import sysconfig
import platform
import sys
class NativeConfigInfo(ConfigInfo):
build = "native"
def get_env(self):
env = super().get_env()
if neutralEnv("distname") == "fedora":
env["QT_SELECT"] = "5-64"
if neutralEnv("distname") == "Darwin":
env["CFLAGS"] += f"-mmacosx-version-min={MIN_MACOS_VERSION}"
return env
@property
def arch_name(self):
if sys.platform == "darwin":
return f"{platform.machine()}-apple-darwin"
return sysconfig.get_platform()
class NativeDyn(NativeConfigInfo):
name = "native_dyn"
static = False
compatible_hosts = ["fedora", "debian", "Darwin", "almalinux", "Windows"]
class NativeStatic(NativeConfigInfo):
name = "native_static"
static = True
compatible_hosts = ["fedora", "debian", "Darwin", "almalinux", "Windows"]
class NativeMixed(MixedMixin("native_static"), NativeConfigInfo):
name = "native_mixed"
static = False
compatible_hosts = ["fedora", "debian", "Darwin", "almalinux", "Windows"]

View File

@ -0,0 +1,11 @@
from .base import ConfigInfo
class NeutralConfigInfo(ConfigInfo):
name = "neutral"
arch_name = "neutral"
static = ""
compatible_hosts = ["fedora", "debian", "Darwin"]
def __str__(self):
return "neutral"

113
kiwixbuild/configs/wasm.py Normal file
View File

@ -0,0 +1,113 @@
from .base import ConfigInfo
from kiwixbuild.utils import pj
from kiwixbuild._global import get_target_step
class WasmConfigInfo(ConfigInfo):
name = "wasm"
static = True
build = "wasm"
arch_full = "wasm64-emscripten"
libdir = "lib"
# arch_full = 'wasm64-linux'
toolchain_names = ["emsdk"]
compatible_hosts = ["fedora", "debian"]
exe_wrapper_def = ""
def get_cross_config(self):
return {
"binaries": self.binaries,
"exe_wrapper_def": "",
"root_path": self.root_path,
"extra_libs": [],
"extra_cflags": [],
"host_machine": {
"system": "emscripten",
"lsystem": "emscripten",
"cpu_family": "wasm64",
"cpu": "wasm64",
"endian": "little",
"abi": "",
},
}
@property
def wasm_sdk(self):
return get_target_step("emsdk", self.name)
@property
def install_path(self):
return self.wasm_sdk.install_path
@property
def root_path(self):
return self.install_path
@property
def binaries(self):
binaries = (
("CC", "emcc"),
("CXX", "em++"),
("AR", "emar"),
("STRIP", "emstrip"),
("WINDRES", "windres"),
("RANLIB", "emranlib"),
("LD", "wasm-ld"),
)
binaries = {
k: pj(self.install_path, "upstream", "emscripten", v) for k, v in binaries
}
binaries["PKGCONFIG"] = "pkg-config"
return binaries
@property
def configure_options(self):
# return ""
return [f"--host={self.arch_full}"]
@property
def configure_wrapper(self):
return "emconfigure"
@property
def make_wrapper(self):
return "emmake"
def get_bin_dir(self):
return [pj(self.install_path, "bin")]
def get_env(self):
env = super().get_env()
env["PATH"].extend(
[
self.install_path,
pj(self.install_path, "upstream", "emscripten"),
pj(self.install_path, "node", "14.18.2_64bit", "bin"),
]
)
env["EMSDK"] = self.install_path
env["EMSDK_NODE"] = pj(
self.install_path, "node", "14.18.2_64bit", "bin", "node"
)
return env
def set_comp_flags(self, env):
super().set_comp_flags(env)
env["CFLAGS"] = (
" -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 "
+ env["CFLAGS"]
)
env["CXXFLAGS"] = (
" -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 "
+ env["CXXFLAGS"]
)
def set_compiler(self, env):
for k, v in self.binaries.items():
env[k] = v
def finalize_setup(self):
super().finalize_setup()
self.buildEnv.cmake_crossfile = self._gen_crossfile("cmake_cross_file.txt")
self.buildEnv.meson_crossfile = self._gen_crossfile("meson_cross_file.txt")

103
kiwixbuild/configs/win64.py Normal file
View File

@ -0,0 +1,103 @@
import subprocess
from .base import ConfigInfo
from kiwixbuild.utils import which, pj
from kiwixbuild._global import neutralEnv
class Win64ConfigInfo(ConfigInfo):
extra_libs = [
"-lmingw32",
"-lwinmm",
"-lws2_32",
"-lshlwapi",
"-lrpcrt4",
"-lmsvcr100",
"-liphlpapi",
"-lshell32",
"-lkernel32",
]
build = "win64"
compatible_hosts = ["fedora", "debian"]
arch_full = "x86_64-w64-mingw32"
def get_cross_config(self):
return {
"exe_wrapper_def": self.exe_wrapper_def,
"binaries": self.binaries,
"root_path": self.root_path,
"extra_libs": self.extra_libs,
"extra_cflags": ["-DWIN32"],
"host_machine": {
"system": "Windows",
"lsystem": "windows",
"cpu_family": "x86_64",
"cpu": "x86_64",
"endian": "little",
"abi": "",
},
}
def finalize_setup(self):
super().finalize_setup()
self.buildEnv.cmake_crossfile = self._gen_crossfile("cmake_cross_file.txt")
self.buildEnv.meson_crossfile = self._gen_crossfile("meson_cross_file.txt")
@property
def root_path(self):
root_paths = {
"fedora": "/usr/x86_64-w64-mingw32/sys-root/mingw",
"debian": "/usr/x86_64-w64-mingw32",
}
return root_paths[neutralEnv("distname")]
@property
def binaries(self):
return {
k: which("{}-{}".format(self.arch_full, v))
for k, v in (
("CC", "gcc"),
("CXX", "g++"),
("AR", "ar"),
("STRIP", "strip"),
("WINDRES", "windres"),
("RANLIB", "ranlib"),
("PKGCONFIG", "pkg-config"),
)
}
@property
def exe_wrapper_def(self):
try:
which("wine")
except subprocess.CalledProcessError:
return ""
else:
return "exe_wrapper = 'wine'"
@property
def configure_options(self):
return [f"--host={self.arch_full}"]
def set_compiler(self, env):
for k, v in self.binaries.items():
env[k] = v
def get_bin_dir(self):
return [pj(self.root_path, "bin")]
def get_env(self):
env = super().get_env()
env["PKG_CONFIG_LIBDIR"] = pj(self.root_path, "lib", "pkgconfig")
env["LIBS"] = " ".join(self.extra_libs) + " " + env["LIBS"]
return env
class Win64Dyn(Win64ConfigInfo):
name = "win64_dyn"
static = False
class Win64Static(Win64ConfigInfo):
name = "win64_static"
static = True

View File

@ -0,0 +1,32 @@
from .base import *
from . import (
all_dependencies,
boostregex,
tc_android_ndk,
aria2,
tc_armhf,
tc_musl,
docoptcpp,
tc_emsdk,
tc_flatpak,
gumbo,
icu4c,
ios_fat_lib,
mustache,
kiwix_desktop,
kiwix_tools,
libcurl,
libkiwix,
libmagic,
libmicrohttpd,
libzim,
lzma,
qt,
pugixml,
uuid,
xapian,
zim_tools,
zim_testing_suite,
zlib,
zstd,
)

View File

@ -0,0 +1,61 @@
from os import environ
from .base import Dependency, NoopSource, NoopBuilder
from kiwixbuild._global import neutralEnv
class AllBaseDependencies(Dependency):
name = "alldependencies"
Source = NoopSource
class Builder(NoopBuilder):
@classmethod
def get_dependencies(cls, configInfo, allDeps):
if configInfo.build == "wasm" or environ.get("OS_NAME") == "manylinux":
return ["zlib", "lzma", "zstd", "icu4c", "xapian-core"]
if neutralEnv("distname") == "Windows":
base_deps = [
"zlib",
"zstd",
"xapian-core",
"zim-testing-suite",
"icu4c",
"boostregex",
"docoptcpp",
]
if not configInfo.name.endswith("_dyn"):
base_deps += [
"pugixml",
"libcurl",
"mustache",
"libmicrohttpd",
]
else:
base_deps = [
"zlib",
"lzma",
"zstd",
"xapian-core",
"pugixml",
"libcurl",
"icu4c",
"mustache",
"libmicrohttpd",
"zim-testing-suite",
]
# Add specific dependencies depending of the config
if configInfo.build not in ("android", "iOS"):
# For zimtools
base_deps += ["docoptcpp", "libmagic", "gumbo"]
if (
configInfo.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

View File

@ -0,0 +1,126 @@
import os
import shutil
from pathlib import Path
from kiwixbuild.configs import ConfigInfo
from kiwixbuild.utils import pj, run_command
from .base import Dependency, NoopSource, Builder as BaseBuilder
class AppleXCFramework(Dependency):
name = "apple_xcframework"
subConfigNames = [
"macOS_x86_64",
"macOS_arm64_static",
"iOS_arm64",
"iOSSimulator_x86_64",
"iOSSimulator_arm64",
]
Source = NoopSource
class Builder(BaseBuilder):
@property
def all_subconfigs(self):
return self.buildEnv.configInfo.subConfigNames
@property
def macos_subconfigs(self):
return [
target for target in self.all_subconfigs if target.startswith("macOS")
]
@property
def iossimulator_subconfigs(self):
return [
target
for target in self.all_subconfigs
if target.startswith("iOSSimulator")
]
@property
def ios_subconfigs(self):
return [
target for target in self.all_subconfigs if target.startswith("iOS_")
]
@classmethod
def get_dependencies(cls, configInfo, alldeps):
return [(target, "libkiwix") for target in AppleXCFramework.subConfigNames]
@property
def final_path(self):
return pj(self.buildEnv.install_dir, "lib", "CoreKiwix.xcframework")
def _remove_if_exists(self, context):
if not os.path.exists(self.final_path):
return
shutil.rmtree(self.final_path)
def _merge_libs(self, context):
"""create merged.a in all targets to bundle all static archives"""
xcf_libs = []
for target in self.all_subconfigs:
static_ars = []
cfg = ConfigInfo.get_config(target)
lib_dir = pj(cfg.buildEnv.install_dir, "lib")
static_ars = [str(f) for f in Path(lib_dir).glob("*.a")]
# create merged.a from all *.a in install_dir/lib
command = ["libtool", "-static", "-o", "merged.a", *static_ars]
run_command(command, lib_dir, context)
# will be included in xcframework
if target in self.ios_subconfigs:
xcf_libs.append(pj(lib_dir, "merged.a"))
return xcf_libs
def make_fat_with(self, configs, folder_name, context):
"""create fat merged.a in {folder_name} install/lib with {configs}"""
libs = []
for target in configs:
cfg = ConfigInfo.get_config(target)
libs.append(pj(cfg.buildEnv.install_dir, "lib", "merged.a"))
fat_dir = pj(self.buildEnv.build_dir, folder_name)
os.makedirs(fat_dir, exist_ok=True)
output_merged = pj(fat_dir, "merged.a")
command = ["lipo", "-create", "-output", output_merged, *libs]
run_command(command, self.buildEnv.build_dir, context)
return [output_merged]
def _build_xcframework(self, xcf_libs, context):
# create xcframework
ref_conf = ConfigInfo.get_config(self.macos_subconfigs[0])
command = ["xcodebuild", "-create-xcframework"]
for lib in xcf_libs:
command += [
"-library",
lib,
"-headers",
pj(ref_conf.buildEnv.install_dir, "include"),
]
command += ["-output", self.final_path]
run_command(command, self.buildEnv.build_dir, context)
def build(self):
xcf_libs = []
self.command("remove_if_exists", self._remove_if_exists)
xcf_libs += self.command("merge_libs", self._merge_libs)
xcf_libs += self.command(
"make_macos_fat",
self.make_fat_with,
self.macos_subconfigs,
"macOS_fat",
)
xcf_libs += self.command(
"make_simulator_fat",
self.make_fat_with,
self.iossimulator_subconfigs,
"iOS-simulator_fat",
)
self.command("build_xcframework", self._build_xcframework, xcf_libs)

View File

@ -0,0 +1,53 @@
from .base import Dependency, ReleaseDownload, MakeBuilder, NoopBuilder
from kiwixbuild.utils import Remotefile, run_command, pj
import platform
from shutil import copy2
# Important: in case of aria2c update,
# 'scripts/create_kiwix-desktop_appImage.sh' should not be forgotten!
class Aria2(Dependency):
name = "aria2"
if platform.system() == "Windows":
class Source(ReleaseDownload):
archive = Remotefile(
"aria2-1.37.0-win-64bit-build1.zip",
"67d015301eef0b612191212d564c5bb0a14b5b9c4796b76454276a4d28d9b288",
"https://dev.kiwix.org/kiwix-desktop/aria2-1.37.0-win-64bit-build1.zip",
)
class Builder(NoopBuilder):
def build(self):
self.command("copy_binary", self._copy_binary)
def _copy_binary(self, context):
context.try_skip(self.build_path)
copy2(
pj(self.source_path, "aria2c.exe"),
pj(self.buildEnv.install_dir, "bin"),
)
else:
class Source(ReleaseDownload):
archive = Remotefile(
"aria2-1.37.0.tar.xz",
"60a420ad7085eb616cb6e2bdf0a7206d68ff3d37fb5a956dc44242eb2f79b66b",
"https://dev.kiwix.org/kiwix-desktop/aria2-1.37.0.tar.xz",
)
def _post_prepare_script(self, context):
context.try_skip(self.extract_path)
command = ["autoreconf", "-i"]
run_command(command, self.extract_path, context)
class Builder(MakeBuilder):
dependencies = ["zlib"]
configure_options = [
"--disable-libaria2",
"--disable-websocket",
"--without-sqlite3",
]

View File

@ -0,0 +1,615 @@
import subprocess
import os
import shutil
import time
import platform
from kiwixbuild.utils import (
pj,
Context,
SkipCommand,
WarningMessage,
extract_archive,
StopBuild,
run_command,
colorize,
copy_tree,
)
from kiwixbuild.versions import main_project_versions, base_deps_versions
from kiwixbuild._global import neutralEnv, option, get_target_step
SCRIPT_DIR = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
class _MetaDependency(type):
def __new__(cls, name, bases, dct):
_class = type.__new__(cls, name, bases, dct)
if name != "Dependency":
dep_name = dct["name"]
Dependency.all_deps[dep_name] = _class
return _class
class Dependency(metaclass=_MetaDependency):
all_deps = {}
force_build = False
force_native_build = False
dont_skip = False
@classmethod
def version(cls):
if cls.name in base_deps_versions:
return base_deps_versions[cls.name]
elif option("make_release"):
return main_project_versions.get(cls.name, None)
return None
@classmethod
def full_name(cls):
if cls.version():
return "{}-{}".format(cls.name, cls.version())
return cls.name
class Source:
"""Base Class to the real preparator
A source preparator must install source in the self.source_dir attribute
inside the neutralEnv.source_dir."""
def __init__(self, target):
self.target = target
@property
def name(self):
return self.target.name
@property
def full_name(self):
return self.target.full_name()
@property
def source_dir(self):
return self.target.full_name()
@property
def source_path(self):
return pj(neutralEnv("source_dir"), self.source_dir)
@property
def _log_dir(self):
return neutralEnv("log_dir")
def _patch(self, context):
context.try_skip(self.source_path)
for p in self.patches:
patch_file_path = pj(SCRIPT_DIR, "patches", p)
patch_command = [*neutralEnv("patch_command"), "-p1", "-i", patch_file_path]
run_command(patch_command, self.source_path, context)
def command(self, name, function, *args):
print(" {} {} : ".format(name, self.name), end="", flush=True)
log = pj(self._log_dir, "cmd_{}_{}.log".format(name, self.name))
context = Context(name, log, True)
try:
start_time = time.time()
ret = function(*args, context=context)
context._finalise()
duration = time.time() - start_time
print(colorize("OK"), "({:.1f}s)".format(duration))
return ret
except WarningMessage as e:
print(e)
except SkipCommand as e:
print(e)
except subprocess.CalledProcessError:
print(colorize("ERROR"))
try:
with open(log, "r") as f:
print(f.read())
except:
pass
raise StopBuild()
except:
print(colorize("ERROR"))
raise
class NoopSource(Source):
def prepare(self):
pass
class ReleaseDownload(Source):
archive_top_dir = None
@property
def archives(self):
return (self.archive,)
@property
def extract_path(self):
return pj(neutralEnv("source_dir"), self.source_dir)
def _download(self, context):
context.try_skip(neutralEnv("archive_dir"), self.full_name)
archive_iter = iter(self.archives)
archive = next(archive_iter, None)
while archive:
try:
neutralEnv("download")(archive)
except SkipCommand as e:
archive = next(archive_iter, None)
if not archive:
raise e
continue
archive = next(archive_iter, None)
def _extract(self, context):
context.try_skip(self.extract_path)
if os.path.exists(self.extract_path):
shutil.rmtree(self.extract_path)
for archive in self.archives:
extract_archive(
pj(neutralEnv("archive_dir"), archive.name),
neutralEnv("source_dir"),
topdir=self.archive_top_dir,
name=self.source_dir,
)
def prepare(self):
self.command("download", self._download)
self.command("extract", self._extract)
if hasattr(self, "patches"):
self.command("patch", self._patch)
if hasattr(self, "_post_prepare_script"):
self.command("post_prepare_script", self._post_prepare_script)
class GitClone(Source):
base_git_ref = "main"
force_full_clone = False
@property
def release_git_ref(self):
return main_project_versions.get(self.name, self.base_git_ref)
@property
def source_dir(self):
if option("make_release"):
return "{}_release".format(self.git_dir)
else:
return self.git_dir
@property
def git_path(self):
return pj(neutralEnv("source_dir"), self.source_dir)
@property
def git_ref(self):
if option("make_release"):
return self.release_git_ref
else:
return self.base_git_ref
def _git_init(self, context):
if option("fast_clone") and self.force_full_clone == False:
command = [
*neutralEnv("git_command"),
"clone",
"--depth=1",
"--branch",
self.git_ref,
self.git_remote,
self.source_dir,
]
run_command(command, neutralEnv("source_dir"), context)
else:
command = [
*neutralEnv("git_command"),
"clone",
self.git_remote,
self.source_dir,
]
run_command(command, neutralEnv("source_dir"), context)
command = [*neutralEnv("git_command"), "checkout", self.git_ref]
run_command(command, self.git_path, context)
def _git_update(self, context):
command = [*neutralEnv("git_command"), "fetch", "origin", self.git_ref]
run_command(command, self.git_path, context)
try:
command = [
*neutralEnv("git_command"),
"merge",
"--ff-only",
f"origin/{self.git_ref}",
]
run_command(command, self.git_path, context)
except subprocess.CalledProcessError:
raise WarningMessage("Cannot update, please check log for information")
def prepare(self):
if not os.path.exists(self.git_path):
self.command("gitinit", self._git_init)
else:
self.command("gitupdate", self._git_update)
if hasattr(self, "_post_prepare_script"):
self.command("post_prepare_script", self._post_prepare_script)
class Builder:
subsource_dir = None
dependencies = []
def __init__(self, target, source, buildEnv):
self.target = target
self.source = source
self.buildEnv = buildEnv
@classmethod
def get_dependencies(cls, configInfo, allDeps):
return cls.dependencies
@property
def name(self):
return self.target.name
@property
def source_path(self):
base_source_path = self.source.source_path
if self.subsource_dir:
return pj(base_source_path, self.subsource_dir)
return base_source_path
@property
def build_path(self):
return pj(self.buildEnv.build_dir, self.target.full_name())
@property
def _log_dir(self):
return self.buildEnv.log_dir
def command(self, name, function, *args):
print(" {} {} : ".format(name, self.name), end="", flush=True)
log = pj(self._log_dir, "cmd_{}_{}.log".format(name, self.name))
context = Context(name, log, self.target.force_native_build)
if self.target.force_build:
context.no_skip = True
try:
start_time = time.time()
ret = function(*args, context=context)
context._finalise()
duration = time.time() - start_time
print(colorize("OK"), "({:.1f}s)".format(duration))
return ret
except SkipCommand as e:
print(e)
except WarningMessage as e:
print(e)
except subprocess.CalledProcessError:
print(colorize("ERROR"))
try:
with open(log, "r") as f:
print(f.read())
except:
pass
raise StopBuild()
except:
print(colorize("ERROR"))
raise
def build(self):
if hasattr(self, "_pre_build_script"):
self.command("pre_build_script", self._pre_build_script)
self.command("configure", self._configure)
if hasattr(self, "_post_configure_script"):
self.command("post_configure_script", self._post_configure_script)
self.command("compile", self._compile)
if hasattr(self, "_test"):
self.command("test", self._test)
self.command("install", self._install)
if hasattr(self, "_post_build_script"):
self.command("post_build_script", self._post_build_script)
def make_dist(self):
if hasattr(self, "_pre_build_script"):
self.command("pre_build_script", self._pre_build_script)
self.command("configure", self._configure)
self.command("make_dist", self._make_dist)
def set_flatpak_buildsystem(self, module):
if getattr(self, "flatpak_buildsystem", None):
module["buildsystem"] = self.flatpak_buildsystem
if getattr(self, "subsource_dir", None):
module["subdir"] = self.subsource_dir
if getattr(self, "flatpack_build_options", None):
module["build-options"] = self.flatpack_build_options
if getattr(self, "configure_options", ""):
module["config-opts"] = list(self.configure_options)
def get_env(self, *, cross_comp_flags, cross_compilers, cross_path):
env = self.buildEnv.get_env(
cross_comp_flags=cross_comp_flags,
cross_compilers=cross_compilers,
cross_path=cross_path,
)
for dep in self.get_dependencies(self.buildEnv.configInfo, False):
try:
builder = get_target_step(dep, self.buildEnv.configInfo.name)
builder.set_env(env)
except KeyError:
# Some target may be missing (installed by a package, ...)
pass
return env
def set_env(self, env):
pass
class NoopBuilder(Builder):
def build(self):
pass
def make_dist(self):
pass
class TcCopyBuilder(Builder):
src_subdir = None
@property
def build_path(self):
return pj(self.buildEnv.toolchain_dir, self.target.full_name())
def build(self):
self.command("copy", self._copy)
def _copy(self, context):
context.try_skip(self.build_path)
if self.src_subdir:
source_path = pj(self.source_path, self.src_subdir)
else:
source_path = self.source_path
copy_tree(source_path, self.build_path)
def make_dist(self):
pass
class MakeBuilder(Builder):
configure_options = []
dynamic_configure_options = ["--enable-shared", "--disable-static"]
static_configure_options = ["--enable-static", "--disable-shared"]
make_options = ["-j4"]
install_options = []
configure_script = "configure"
configure_env = {
"_format_CFLAGS": "{env[CFLAGS]} -O3",
"_format_CXXFLAGS": "{env[CXXFLAGS]} -O3",
}
make_targets = []
flatpak_buildsystem = None
@property
def make_install_targets(self):
if self.buildEnv.configInfo.build in ("iOS", "wasm"):
yield "install"
else:
yield "install-strip"
@property
def all_configure_options(self):
yield from self.configure_options
if self.buildEnv.configInfo.static:
yield from self.static_configure_options
else:
yield from self.dynamic_configure_options
if not self.target.force_native_build:
yield from self.buildEnv.configInfo.configure_options
yield from ("--prefix", self.buildEnv.install_dir)
yield from ("--libdir", pj(self.buildEnv.install_dir, self.buildEnv.libprefix))
def set_configure_env(self, env):
dep_conf_env = self.configure_env
if not dep_conf_env:
return
for k, v in dep_conf_env.items():
if k.startswith("_format_"):
v = v.format(buildEnv=self.buildEnv, env=env)
env[k[8:]] = v
else:
env[k] = v
def _configure(self, context):
context.try_skip(self.build_path)
command = [
*self.buildEnv.configure_wrapper,
pj(self.source_path, self.configure_script),
*self.all_configure_options,
]
env = self.get_env(cross_comp_flags=True, cross_compilers=True, cross_path=True)
self.set_configure_env(env)
run_command(command, self.build_path, context, env=env)
def _compile(self, context):
context.try_skip(self.build_path)
command = [
*self.buildEnv.make_wrapper,
*neutralEnv("make_command"),
*self.make_targets,
*self.make_options,
]
env = self.get_env(cross_comp_flags=True, cross_compilers=True, cross_path=True)
run_command(command, self.build_path, context, env=env)
def _install(self, context):
context.try_skip(self.build_path)
command = [
*self.buildEnv.make_wrapper,
*neutralEnv("make_command"),
*self.make_install_targets,
*self.make_options,
]
env = self.get_env(cross_comp_flags=True, cross_compilers=True, cross_path=True)
run_command(command, self.build_path, context, env=env)
def _make_dist(self, context):
context.try_skip(self.build_path)
command = [*self.buildEnv.make_wrapper, *neutralEnv("make_command"), "dist"]
env = self.get_env(cross_comp_flags=True, cross_compilers=True, cross_path=True)
run_command(command, self.build_path, context, env=env)
class CMakeBuilder(MakeBuilder):
flatpak_buildsystem = "cmake"
def _configure(self, context):
context.try_skip(self.build_path)
cross_options = []
if not self.target.force_native_build and self.buildEnv.cmake_crossfile:
cross_options += [f"-DCMAKE_TOOLCHAIN_FILE={self.buildEnv.cmake_crossfile}"]
command = [
*neutralEnv("cmake_command"),
*self.configure_options,
"-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON",
f"-DCMAKE_INSTALL_PREFIX={self.buildEnv.install_dir}",
f"-DCMAKE_INSTALL_LIBDIR={self.buildEnv.libprefix}",
self.source_path,
*cross_options,
]
env = self.get_env(
cross_comp_flags=True, cross_compilers=False, cross_path=True
)
self.set_configure_env(env)
run_command(command, self.build_path, context, env=env)
def set_flatpak_buildsystem(self, module):
super().set_flatpak_buildsystem(module)
module["buildir"] = True
class QMakeBuilder(MakeBuilder):
qmake_targets = []
flatpak_buildsystem = "qmake"
@property
def make_options(self):
if platform.system() == "Windows":
return []
return super().make_options
@property
def env_options(self):
if "QMAKE_CC" in os.environ:
yield f"QMAKE_CC={os.environ['QMAKE_CC']}"
if "QMAKE_CXX" in os.environ:
yield f"QMAKE_CXX={os.environ['QMAKE_CXX']}"
def _configure(self, context):
context.try_skip(self.build_path)
command = [
*neutralEnv("qmake_command"),
*self.configure_options,
*self.env_options,
self.source_path,
]
env = self.get_env(
cross_comp_flags=True, cross_compilers=False, cross_path=True
)
self.set_configure_env(env)
run_command(command, self.build_path, context, env=env)
def _make_dist(self, context):
command = [
*neutralEnv("git_command"),
"archive",
"-o",
f"{self.build_path}/{self.target.full_name()}.tar.gz",
f"--prefix={self.target.full_name()}/",
"HEAD",
]
run_command(command, self.source_path, context)
class MesonBuilder(Builder):
configure_options = []
test_options = []
flatpak_buildsystem = "meson"
@property
def build_type(self):
if platform.system() == "Windows":
return "release"
return "release" if option("make_release") else "debug"
@property
def strip_options(self):
if option("make_release"):
yield "--strip"
@property
def library_type(self):
return "static" if self.buildEnv.configInfo.static else "shared"
def _configure(self, context):
context.try_skip(self.build_path)
if os.path.exists(self.build_path):
shutil.rmtree(self.build_path)
os.makedirs(self.build_path)
cross_options = []
if not self.target.force_native_build and self.buildEnv.meson_crossfile:
cross_options += ["--cross-file", self.buildEnv.meson_crossfile]
command = [
*neutralEnv("meson_command"),
"setup",
".",
self.build_path,
f"--buildtype={self.build_type}",
*self.strip_options,
f"--default-library={self.library_type}",
*self.configure_options,
f"--prefix={self.buildEnv.install_dir}",
f"--libdir={self.buildEnv.libprefix}",
*cross_options,
]
env = self.get_env(
cross_comp_flags=False, cross_compilers=False, cross_path=True
)
run_command(command, self.source_path, context, env=env)
def _compile(self, context):
context.try_skip(self.build_path)
command = [*neutralEnv("ninja_command"), "-v"]
env = self.get_env(
cross_comp_flags=False, cross_compilers=False, cross_path=True
)
run_command(command, self.build_path, context, env=env)
def _test(self, context):
context.try_skip(self.build_path)
if self.buildEnv.configInfo.build == "android" or (
self.buildEnv.configInfo.build != "native"
and not self.buildEnv.configInfo.static
):
raise SkipCommand()
command = [*neutralEnv("mesontest_command"), "--verbose", *self.test_options]
env = self.get_env(
cross_comp_flags=False, cross_compilers=False, cross_path=True
)
run_command(command, self.build_path, context, env=env)
def _install(self, context):
context.try_skip(self.build_path)
command = [*neutralEnv("ninja_command"), "-v", "install"]
env = self.get_env(
cross_comp_flags=False, cross_compilers=False, cross_path=True
)
run_command(command, self.build_path, context, env=env)
def _make_dist(self, context):
command = [*neutralEnv("ninja_command"), "-v", "dist"]
env = self.get_env(
cross_comp_flags=False, cross_compilers=False, cross_path=True
)
run_command(command, self.build_path, context, env=env)

View File

@ -0,0 +1,27 @@
from .base import Dependency, ReleaseDownload, Builder as BaseBuilder
from kiwixbuild.utils import Remotefile, pj
from shutil import copytree
class BoostRegex(Dependency):
name = "boostregex"
class Source(ReleaseDownload):
archive = Remotefile(
"regex-boost-1.86.0.zip",
"",
"https://codeload.github.com/boostorg/regex/zip/refs/tags/boost-1.86.0",
)
class Builder(BaseBuilder):
def build(self):
self.command("copy_headers", self._copy_headers)
def _copy_headers(self, context):
context.try_skip(self.build_path)
copytree(
pj(self.source_path, "include", "boost"),
pj(self.buildEnv.install_dir, "include", "boost"),
dirs_exist_ok=True,
)

View File

@ -0,0 +1,34 @@
from .base import Dependency, ReleaseDownload, MesonBuilder
from kiwixbuild.utils import Remotefile
from kiwixbuild._global import neutralEnv
class docoptcpp(Dependency):
name = "docoptcpp"
class Source(ReleaseDownload):
name = "docoptcpp"
src_archive = Remotefile(
"v0.6.3.tar.gz",
"28af5a0c482c6d508d22b14d588a3b0bd9ff97135f99c2814a5aa3cbff1d6632",
"https://github.com/docopt/docopt.cpp/archive/v0.6.3.tar.gz",
)
meson_archive = Remotefile(
"docopt_0.6.3-3_patch.zip",
"1f641187f9d3f35b0a5ebd2011876ef8e9b04b69b7b163095dd7dfa16219ad01",
"https://wrapdb.mesonbuild.com/v2/docopt_0.6.3-3/get_patch",
)
archives = [src_archive, meson_archive]
patches = [
"docopt_meson_install_pkgconfig.patch",
"docopt_meson_use_boostregex.patch",
]
class Builder(MesonBuilder):
@classmethod
def get_dependencies(cls, configInfo, allDeps):
if neutralEnv("distname") == "Windows":
return ["boostregex"]
return []

View File

@ -0,0 +1,21 @@
from .base import Dependency, ReleaseDownload, MakeBuilder
from kiwixbuild.utils import Remotefile, run_command
class Gumbo(Dependency):
name = "gumbo"
class Source(ReleaseDownload):
archive = Remotefile(
"gumbo-0.10.1.tar.gz",
"28463053d44a5dfbc4b77bcf49c8cee119338ffa636cc17fc3378421d714efad",
"https://github.com/google/gumbo-parser/archive/v0.10.1.tar.gz",
)
def _post_prepare_script(self, context):
context.try_skip(self.extract_path)
command = ["./autogen.sh"]
run_command(command, self.extract_path, context)
Builder = MakeBuilder

View File

@ -0,0 +1,191 @@
from .base import (
Dependency,
ReleaseDownload,
MakeBuilder,
Builder as BaseBuilder,
)
from kiwixbuild.utils import pj, SkipCommand, Remotefile, extract_archive
from kiwixbuild._global import get_target_step, neutralEnv
import os, shutil
import fileinput
import platform
if platform.system() == "Windows":
class Icu(Dependency):
name = "icu4c"
class Source(ReleaseDownload):
archive = Remotefile(
"icu4c-74_1-Win64-MSVC2022.zip",
"",
"https://github.com/unicode-org/icu/releases/download/release-74-1/icu4c-74_1-Win64-MSVC2022.zip",
)
class Builder(BaseBuilder):
def build(self):
self.command("copy_headers", self._copy_headers)
self.command("copy_bins", self._copy_bin)
self.command("generate_pkg_config", self._generate_pkg_config)
def _copy_headers(self, context):
context.try_skip(self.build_path)
shutil.copytree(
pj(self.source_path, "include", "unicode"),
pj(self.buildEnv.install_dir, "include", "unicode"),
)
def _copy_bin(self, context):
context.try_skip(self.build_path)
shutil.copytree(
pj(self.source_path, "lib64"),
pj(self.buildEnv.install_dir, "lib"),
dirs_exist_ok=True,
)
def ignore_non_dll(path, names):
return [n for n in names if not n.endswith(".dll")]
shutil.copytree(
pj(self.source_path, "bin64"),
pj(self.buildEnv.install_dir, "bin"),
ignore=ignore_non_dll,
dirs_exist_ok=True,
)
def _generate_pkg_config(self, context):
context.try_skip(self.build_path)
pkg_config_template = """ Copyright (C) 2016 and later: Unicode, Inc. and others.
# License & terms of use: http://www.unicode.org/copyright.html
# Copyright (C) 2010-2013, International Business Machines Corporation. All Rights Reserved.
# CFLAGS contains only anything end users should set
CFLAGS =
# CXXFLAGS contains only anything end users should set
CXXFLAGS = -std=c++11
# DEFS only contains those UCONFIG_CPPFLAGS which are not auto-set by platform.h
DEFS =
prefix = {prefix}
exec_prefix = ${{prefix}}
libdir = ${{exec_prefix}}/lib
includedir = ${{prefix}}/include
baselibs = -lpthread -lm
UNICODE_VERSION=15.0
ICUPREFIX=icu
ICULIBSUFFIX=
LIBICU=lib${{ICUPREFIX}}
pkglibdir=${{libdir}}/icu${{ICULIBSUFFIX}}/73.1
ICUDATA_NAME = icudt73l
ICUDESC=International Components for Unicode
Version: 73.1
Cflags: -I${{includedir}}
Description: International Components for Unicode: Internationalization library
Name: icu-i18n
Libs: -L${{libdir}} -licuin -licuuc -licudt"""
pkg_config_content = pkg_config_template.format(
prefix=self.buildEnv.install_dir
)
os.makedirs(
pj(self.buildEnv.install_dir, "lib", "pkgconfig"), exist_ok=True
)
with open(
pj(self.buildEnv.install_dir, "lib", "pkgconfig", "icu-i18n.pc"),
mode="w",
) as f:
f.write(pkg_config_content)
else:
class Icu(Dependency):
name = "icu4c"
class Source(ReleaseDownload):
archive_src = Remotefile(
"icu4c-73_2-src.tgz",
"818a80712ed3caacd9b652305e01afc7fa167e6f2e94996da44b90c2ab604ce1",
"https://github.com/unicode-org/icu/releases/download/release-73-2/icu4c-73_2-src.tgz",
)
archive_data = Remotefile(
"icu4c-73_2-data.zip",
"ca1ee076163b438461e484421a7679fc33a64cd0a54f9d4b401893fa1eb42701",
"https://github.com/unicode-org/icu/releases/download/release-73-2/icu4c-73_2-data.zip",
)
archives = [archive_src, archive_data]
def _extract(self, context):
context.try_skip(self.extract_path)
if os.path.exists(self.extract_path):
shutil.rmtree(self.extract_path)
extract_archive(
pj(neutralEnv("archive_dir"), self.archive_src.name),
neutralEnv("source_dir"),
topdir=None,
name=self.source_dir,
)
shutil.rmtree(
pj(neutralEnv("source_dir"), self.source_dir, "source", "data")
)
extract_archive(
pj(neutralEnv("archive_dir"), self.archive_data.name),
pj(neutralEnv("source_dir"), self.source_dir, "source"),
topdir="data",
name="data",
)
patches = [
"icu4c_fix_static_lib_name_mingw.patch",
"icu4c_rpath.patch",
"icu4c_wasm.patch",
]
class Builder(MakeBuilder):
subsource_dir = "source"
make_install_targets = ["install"]
@classmethod
def get_dependencies(cls, configInfo, allDeps):
plt = "native_static" if configInfo.static else "native_dyn"
return [(plt, "icu4c")]
@property
def configure_options(self):
yield "--disable-samples"
yield "--disable-tests"
yield "--disable-extras"
yield "--disable-dyload"
yield "--enable-rpath"
yield "--disable-icuio"
yield "--disable-layoutex"
configInfo = self.buildEnv.configInfo
if configInfo.build != "native":
icu_native_builder = get_target_step(
"icu4c", "native_static" if configInfo.static else "native_dyn"
)
yield f"--with-cross-build={icu_native_builder.build_path}"
yield "--disable-tools"
if configInfo.build in ("android", "wasm"):
yield "--with-data-packaging=archive"
def set_env(self, env):
env["ICU_DATA_FILTER_FILE"] = pj(
os.path.dirname(os.path.realpath(__file__)),
"icu4c_data_filter.json",
)
def _post_configure_script(self, context):
if self.buildEnv.configInfo.build != "wasm":
context.skip()
context.try_skip(self.build_path)
for line in fileinput.input(
pj(self.build_path, "Makefile"), inplace=True
):
if line == "#DATASUBDIR = data\n":
print("DATASUBDIR = data")
else:
print(line, end="")

View File

@ -0,0 +1,14 @@
{
"strategy": "additive",
"featureFilters": {
"lang_tree": "include",
"locales_tree": "include",
"translit": "include",
"misc": {
"includelist": [
"likelySubtags",
"metadata"
]
}
}
}

View File

@ -0,0 +1,50 @@
import os
from kiwixbuild.configs import ConfigInfo
from kiwixbuild.utils import pj, copy_tree, run_command
from kiwixbuild._global import option
from .base import Dependency, NoopSource, Builder as BaseBuilder
class IOSFatLib(Dependency):
name = "_ios_fat_lib"
Source = NoopSource
class Builder(BaseBuilder):
@classmethod
def get_dependencies(self, platfomInfo, alldeps):
base_target = option("target")
return [("iOS_{}".format(arch), base_target) for arch in option("ios_arch")]
def _copy_headers(self, context):
plt = ConfigInfo.get_config("iOS_{}".format(option("ios_arch")[0]))
include_src = pj(plt.buildEnv.install_dir, "include")
include_dst = pj(self.buildEnv.install_dir, "include")
copy_tree(include_src, include_dst)
def _merge_libs(self, context):
lib_dirs = []
for arch in option("ios_arch"):
plt = ConfigInfo.get_config("iOS_{}".format(arch))
lib_dirs.append(pj(plt.buildEnv.install_dir, "lib"))
libs = []
for f in os.listdir(lib_dirs[0]):
if os.path.islink(pj(lib_dirs[0], f)):
continue
if f.endswith(".a") or f.endswith(".dylib"):
libs.append(f)
os.makedirs(pj(self.buildEnv.install_dir, "lib"), exist_ok=True)
for l in libs:
command = [
"lipo",
"-create",
*[pj(d, l) for d in lib_dirs],
"-output",
pj(self.buildEnv.install_dir, "lib", l),
]
run_command(command, self.buildEnv.install_dir, context)
def build(self):
self.command("copy_headers", self._copy_headers)
self.command("merge_libs", self._merge_libs)

View File

@ -0,0 +1,39 @@
from kiwixbuild._global import option
from .base import Dependency, GitClone, QMakeBuilder
import platform
class KiwixDesktop(Dependency):
name = "kiwix-desktop"
force_build = True
class Source(GitClone):
git_remote = "https://github.com/kiwix/kiwix-desktop.git"
git_dir = "kiwix-desktop"
class Builder(QMakeBuilder):
dependencies = ["qt", "qtwebengine", "libkiwix", "aria2"]
configure_env = None
flatpack_build_options = {"env": {"QMAKEPATH": "/app"}}
@property
def make_targets(self):
if platform.system() == "Windows":
yield "release-all"
else:
yield from super().make_targets
@property
def make_install_targets(self):
if platform.system() == "Windows":
yield "release-install"
else:
yield "install"
@property
def configure_options(self):
if self.buildEnv.configInfo.name != "flatpak":
yield f"PREFIX={self.buildEnv.install_dir}"
if self.buildEnv.configInfo.static:
yield "CONFIG+=static"

View File

@ -0,0 +1,18 @@
from .base import Dependency, GitClone, MesonBuilder
class KiwixTools(Dependency):
name = "kiwix-tools"
force_build = True
class Source(GitClone):
git_remote = "https://github.com/kiwix/kiwix-tools.git"
git_dir = "kiwix-tools"
class Builder(MesonBuilder):
dependencies = ["libkiwix", "docoptcpp"]
@property
def configure_options(self):
if self.buildEnv.configInfo.static:
yield "-Dstatic-linkage=true"

View File

@ -0,0 +1,61 @@
import os
from .base import (
Dependency,
ReleaseDownload,
MesonBuilder,
)
from kiwixbuild.utils import Remotefile, pj, Defaultdict, SkipCommand, run_command
from kiwixbuild._global import get_target_step
class LibCurl(Dependency):
name = "libcurl"
class Source(ReleaseDownload):
name = "libcurl"
src_archive = Remotefile(
"curl-8.4.0.tar.xz",
"16c62a9c4af0f703d28bda6d7bbf37ba47055ad3414d70dec63e2e6336f2a82d",
"https://curl.se/download/curl-8.4.0.tar.xz",
)
meson_archive = Remotefile(
"curl_8.4.0-2_patch.zip",
"bbb6ae75225c36ef9bb336cface729794c7c070c623a003fff40bd416042ff6e",
"https://dev.kiwix.org/libkiwix/curl_8.4.0-2_patch.zip",
)
archives = [src_archive, meson_archive]
class Builder(MesonBuilder):
dependencies = ["zlib"]
configure_options = [
f"-D{p}=disabled"
for p in (
"psl",
"kerberos-auth",
"gss-api",
"ssh",
"rtmp",
"http2",
"idn",
"brotli",
"ftp",
"file",
"ldap",
"ldaps",
"rtsp",
"dict",
"telnet",
"tftp",
"pop3",
"imap",
"smb",
"smtp",
"gopher",
"tool",
)
]
def _test(self, context):
context.skip("No Test")

View File

@ -0,0 +1,52 @@
import shutil, os
from .base import Dependency, GitClone, MesonBuilder
from kiwixbuild.utils import pj, copy_tree
from kiwixbuild._global import option, get_target_step, neutralEnv
class Libkiwix(Dependency):
name = "libkiwix"
force_build = True
class Source(GitClone):
git_remote = "https://github.com/kiwix/libkiwix.git"
git_dir = "libkiwix"
class Builder(MesonBuilder):
dependencies = [
"pugixml",
"libzim",
"zlib",
"libcurl",
"libmicrohttpd",
"icu4c",
"mustache",
"xapian-core",
]
strip_options = []
@property
def build_type(self):
if self.buildEnv.configInfo.build == "android":
return "debug"
return super().build_type
@property
def configure_options(self):
configInfo = self.buildEnv.configInfo
if configInfo.build == "android":
yield "-Dstatic-linkage=true"
yield "-Dwerror=false"
if configInfo.build == "iOS":
yield "-Db_bitcode=true"
if configInfo.name == "flatpak":
yield "--wrap-mode=nodownload"
if configInfo.mixed and option("target") == "libkiwix":
yield "-Dstatic-linkage=true"
@property
def library_type(self):
if self.buildEnv.configInfo.build == "android":
return "shared"
return super().library_type

View File

@ -0,0 +1,50 @@
import os
from .base import (
Dependency,
ReleaseDownload,
MakeBuilder,
)
from kiwixbuild.utils import Remotefile, pj, SkipCommand, run_command
from kiwixbuild._global import get_target_step
class LibMagic(Dependency):
name = "libmagic"
class Source(ReleaseDownload):
name = "libmagic"
source_dir = "libmagic"
archive_top_dir = "file-5.44"
archive = Remotefile(
"file-5.44.tar.gz",
"3751c7fba8dbc831cb8d7cc8aff21035459b8ce5155ef8b0880a27d028475f3b",
)
class Builder(MakeBuilder):
@property
def configure_options(self):
yield "--disable-bzlib"
yield "--disable-xzlib"
yield "--disable-zstdlib"
yield "--disable-lzlib"
@classmethod
def get_dependencies(cls, configInfo, allDeps):
if configInfo.build != "native":
return [("native_static", "libmagic")]
return []
def _compile(self, context):
configInfo = self.buildEnv.configInfo
if configInfo.build == "native":
return super()._compile(context)
context.try_skip(self.build_path)
command = ["make", "-j4", *self.make_targets, *self.make_options]
env = self.buildEnv.get_env(
cross_comp_flags=True, cross_compilers=True, cross_path=True
)
libmagic_native_builder = get_target_step("libmagic", "native_static")
env["PATH"].insert(0, pj(libmagic_native_builder.build_path, "src"))
run_command(command, self.build_path, context, env=env)

View File

@ -0,0 +1,33 @@
from .base import Dependency, ReleaseDownload, MesonBuilder
from kiwixbuild.utils import Remotefile
class MicroHttpd(Dependency):
name = "libmicrohttpd"
class Source(ReleaseDownload):
src_archive = Remotefile(
"libmicrohttpd-0.9.76.tar.gz",
"f0b1547b5a42a6c0f724e8e1c1cb5ce9c4c35fb495e7d780b9930d35011ceb4c",
"https://ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-0.9.76.tar.gz",
)
meson_archive = Remotefile(
"libmicrohttpd_0.9.16-3_patch.zip",
"0954c094a0d4cfe0dd799d8df8a04face6669f7b4d51a7386a9c3e2d37b9c3b3",
"https://wrapdb.mesonbuild.com/v2/libmicrohttpd_0.9.76-3/get_patch",
)
archives = [src_archive, meson_archive]
patches = [
"libmicrohttpd_meson_pkgconfig.patch",
"libmicrohttpd_meson_timeval_tvsec_size.patch",
"libmicrohttpd_meson_winet6.patch",
]
class Builder(MesonBuilder):
configure_options = [
"-Dgnutls=disabled",
"-Dgcrypt=disabled",
"-Dcurl=disabled",
"-Dexpat=disabled",
]

View File

@ -0,0 +1,57 @@
from .base import Dependency, GitClone, MesonBuilder
from kiwixbuild._global import option, get_target_step, neutralEnv
class Libzim(Dependency):
name = "libzim"
force_build = True
class Source(GitClone):
git_remote = "https://github.com/openzim/libzim.git"
git_dir = "libzim"
class Builder(MesonBuilder):
test_options = ["-t", "8"]
strip_options = []
@property
def build_type(self):
if self.buildEnv.configInfo.build == "android":
return "debug"
return super().build_type
@classmethod
def get_dependencies(cls, configInfo, allDeps):
if neutralEnv("distname") == "Windows":
return ["zstd", "xapian-core", "icu4c", "zim-testing-suite"]
deps = ["lzma", "zstd", "xapian-core", "icu4c"]
if configInfo.name not in ("flatpak", "wasm"):
deps.append("zim-testing-suite")
return deps
@property
def configure_options(self):
configInfo = self.buildEnv.configInfo
if neutralEnv("distname") == "Windows":
yield "-Dwith_xapian_fuller=false"
yield "-Dwerror=false"
if configInfo.build == "android":
yield "-DUSE_BUFFER_HEADER=false"
yield "-Dstatic-linkage=true"
if configInfo.mixed and option("target") == "libzim":
yield "-Dstatic-linkage=true"
if configInfo.name == "flatpak":
yield "--wrap-mode=nodownload"
yield "-Dtest_data_dir=none"
if configInfo.name == "wasm":
yield "-Dexamples=false"
yield "-DUSE_MMAP=false"
if configInfo.name not in ("flatpak", "wasm"):
zim_testing_suite = get_target_step("zim-testing-suite", "source")
yield "-Dtest_data_dir={}".format(zim_testing_suite.source_path)
@property
def library_type(self):
if self.buildEnv.configInfo.build == "android":
return "shared"
return super().library_type

View File

@ -0,0 +1,26 @@
from .base import (
Dependency,
ReleaseDownload,
MesonBuilder)
from kiwixbuild.utils import Remotefile
class lzma(Dependency):
name = 'lzma'
class Source(ReleaseDownload):
src_archive = Remotefile(
"xz-5.2.6.tar.gz",
"a2105abee17bcd2ebd15ced31b4f5eda6e17efd6b10f921a01cda4a44c91b3a0",
"https://altushost-swe.dl.sourceforge.net/project/lzmautils/xz-5.2.6.tar.gz",
)
meson_patch = Remotefile(
"liblzma_5.2.6-3_patch.zip",
"1c71536d364e1a3ce6bea61266576f89cc5cce4d3b9e11f3494417dafa29780b",
"https://wrapdb.mesonbuild.com/v2/liblzma_5.2.6-3/get_patch",
)
archives = [src_archive, meson_patch]
patches = ['lzma_meson_install.patch']
Builder = MesonBuilder

View File

@ -0,0 +1,30 @@
from .base import Dependency, ReleaseDownload, Builder as BaseBuilder
from kiwixbuild.utils import Remotefile, pj
from shutil import copy2
class Mustache(Dependency):
name = "mustache"
class Source(ReleaseDownload):
archive = Remotefile(
"Mustache-4.1.tar.gz",
"acd66359feb4318b421f9574cfc5a511133a77d916d0b13c7caa3783c0bfe167",
"https://github.com/kainjow/Mustache/archive/v4.1.tar.gz",
)
class Builder(BaseBuilder):
def build(self):
self.command("copy_header", self._copy_header)
def _copy_header(self, context):
context.try_skip(self.build_path)
copy2(
pj(self.source_path, "mustache.hpp"),
pj(self.buildEnv.install_dir, "include"),
)
def set_flatpak_buildsystem(self, module):
module["buildsystem"] = "simple"
module["build-commands"] = ["cp mustache.hpp /app/include"]

View File

@ -0,0 +1,18 @@
from .base import Dependency, ReleaseDownload, MesonBuilder
from kiwixbuild.utils import Remotefile
class Pugixml(Dependency):
name = "pugixml"
class Source(ReleaseDownload):
archive = Remotefile(
"pugixml-1.2.tar.gz",
"0f422dad86da0a2e56a37fb2a88376aae6e931f22cc8b956978460c9db06136b",
)
patches = ["pugixml_meson.patch"]
flatpak_dest = "src"
class Builder(MesonBuilder):
strip_options = []

View File

@ -0,0 +1,25 @@
import shutil
from .base import Dependency, NoopBuilder, NoopSource
from kiwixbuild.utils import SkipCommand, colorize
class Qt(Dependency):
name = "qt"
Source = NoopSource
class Builder(NoopBuilder):
def build(self):
error_msg = f"""WARNING: kiwix-build cannot build {self.name} for you.
You must install it yourself using official Qt installer or your distribution system."""
print(colorize(error_msg, "WARNING"))
class QtWebEngine(Dependency):
name = "qtwebengine"
Source = NoopSource
Builder = Qt.Builder

View File

@ -0,0 +1,93 @@
import os
from .base import Dependency, ReleaseDownload, Builder
from kiwixbuild.utils import Remotefile, add_execution_right, run_command
pj = os.path.join
class android_ndk(Dependency):
dont_skip = True
neutral = False
name = "android-ndk"
gccver = "4.9.x"
api = "24"
class Source(ReleaseDownload):
archive = Remotefile(
"android-ndk-r21e-linux-x86_64.zip",
"ad7ce5467e18d40050dc51b8e7affc3e635c85bd8c59be62de32352328ed467e",
"https://dl.google.com/android/repository/android-ndk-r21e-linux-x86_64.zip",
)
@property
def source_dir(self):
return self.target.full_name()
patches = [
"android-ndk-r21e-linux-x86_64-python3.12+.patch",
]
class Builder(Builder):
@property
def install_path(self):
return pj(self.buildEnv.toolchain_dir, self.target.full_name())
@property
def api(self):
return self.target.api
@property
def config(self):
return "android-" + self.api
@property
def arch(self):
return self.buildEnv.configInfo.arch
@property
def arch_full(self):
return self.buildEnv.configInfo.arch_full
def _build_toolchain(self, context):
context.try_skip(self.build_path)
script = pj(self.source_path, "build/tools/make_standalone_toolchain.py")
add_execution_right(script)
command = [
script,
f"--arch={self.arch}",
f"--api={self.api}",
f"--install-dir={self.install_path}",
"--force",
]
env = self.buildEnv.get_env(
cross_comp_flags=False, cross_compilers=False, cross_path=False
)
run_command(command, self.build_path, context, env=env)
def _fix_permission_right(self, context):
context.try_skip(self.build_path)
bin_dirs = [
pj(self.install_path, "bin"),
pj(self.install_path, self.arch_full, "bin"),
pj(
self.install_path,
"libexec",
"gcc",
self.arch_full,
self.target.gccver,
),
]
for root, dirs, files in os.walk(self.install_path):
if not root in bin_dirs:
continue
for file_ in files:
file_path = pj(root, file_)
if os.path.islink(file_path):
continue
add_execution_right(file_path)
def build(self):
self.command("build_toolchain", self._build_toolchain)
self.command("fix_permission_right", self._fix_permission_right)

View File

@ -0,0 +1,55 @@
from .base import Dependency, ReleaseDownload, TcCopyBuilder
from kiwixbuild.utils import Remotefile
# The arm toolchains
# This is based on toolchains published here : https://github.com/tttapa/docker-arm-cross-toolchain
base_url = (
"https://github.com/tttapa/docker-arm-cross-toolchain/releases/download/0.1.0/"
)
class armv6_toolchain(Dependency):
dont_skip = True
neutral = True
name = "armv6"
class Source(ReleaseDownload):
archive = Remotefile(
"x-tools-armv6-rpi-linux-gnueabihf.tar.xz",
"4c371c4c5b55ebd1f3d7dd26b14703632d9ba47423f901bcd9303d83ad444434",
base_url + "x-tools-armv6-rpi-linux-gnueabihf.tar.xz",
)
class Builder(TcCopyBuilder):
src_subdir = "armv6-rpi-linux-gnueabihf"
class armv8_toolchain(Dependency):
dont_skip = True
neutral = True
name = "armv8"
class Source(ReleaseDownload):
archive = Remotefile(
"x-tools-armv8-rpi-linux-gnueabihf.tar.xz",
"cc28f5c3f6a3e7d9985f98779c4e72224b4eb5a7e4dc2bcdefd90cb241fb94a5",
base_url + "x-tools-armv8-rpi3-linux-gnueabihf.tar.xz",
)
class Builder(TcCopyBuilder):
src_subdir = "armv8-rpi3-linux-gnueabihf"
class aarch64_toolchain(Dependency):
dont_skip = True
neutral = True
name = "aarch64"
class Source(ReleaseDownload):
archive = Remotefile(
"cross-gcc-6.3.0-pi_64.tar.gz",
"1b048bb8886ad63d21797cd9129fc37b9ea0dfaac7e3c36f888aa16fbec1d320",
)
Builder = TcCopyBuilder

View File

@ -0,0 +1,47 @@
import os
from .base import Dependency, ReleaseDownload, Builder
from kiwixbuild.utils import Remotefile, run_command, copy_tree
pj = os.path.join
class emsdk(Dependency):
dont_skip = True
neutral = False
name = "emsdk"
class Source(ReleaseDownload):
archive = Remotefile(
"emsdk-3.1.41.tar.gz",
"147a2d72df34227bdb4ffedc587a8cb674a42269c40458f3f69ae37e8966cdc6",
"https://codeload.github.com/emscripten-core/emsdk/tar.gz/refs/tags/3.1.41",
)
@property
def source_dir(self):
return self.target.full_name()
class Builder(Builder):
@property
def install_path(self):
return pj(self.buildEnv.toolchain_dir, self.target.full_name())
def _copy_source(self, context):
context.try_skip(self.build_path)
copy_tree(self.source_path, self.install_path)
def _install(self, context):
context.try_skip(self.build_path)
command = ["./emsdk", "install", "3.1.24"]
run_command(command, self.install_path, context)
def _activate(self, context):
context.try_skip(self.build_path)
command = ["./emsdk", "activate", "3.1.24"]
run_command(command, self.install_path, context)
def build(self):
self.command("copy_source", self._copy_source)
self.command("install", self._install)
self.command("activate", self._activate)

View File

@ -0,0 +1,89 @@
import os
from .base import Dependency, NoopSource, Builder
from kiwixbuild.utils import Remotefile, add_execution_right, run_command
pj = os.path.join
class org_kde(Dependency):
neutral = False
name = "org.kde"
Source = NoopSource
class Builder(Builder):
def _setup_remote(self, context):
command = [
"flatpak",
"--user",
"remote-add",
"--if-not-exists",
"flathub",
"https://flathub.org/repo/flathub.flatpakrepo",
]
env = self.buildEnv.get_env(
cross_comp_flags=False, cross_compilers=False, cross_path=False
)
run_command(command, self.buildEnv.build_dir, context, env=env)
def _install_sdk(self, context):
command = [
"flatpak",
"--user",
"install",
"--noninteractive",
"--verbose",
"-y",
"flathub",
f"{self.target.name}.Sdk//{self.target.version()}",
f"{self.target.name}.Platform//{self.target.version()}",
]
env = self.buildEnv.get_env(
cross_comp_flags=False, cross_compilers=False, cross_path=False
)
run_command(command, self.buildEnv.build_dir, context, env=env)
def build(self):
self.command("setup_remote", self._setup_remote)
self.command("install_sdk", self._install_sdk)
class io_qt_qtwebengine(Dependency):
neutral = False
name = "io.qt.qtwebengine"
Source = NoopSource
class Builder(Builder):
def _setup_remote(self, context):
command = [
"flatpak",
"--user",
"remote-add",
"--if-not-exists",
"flathub",
"https://flathub.org/repo/flathub.flatpakrepo",
]
env = self.buildEnv.get_env(
cross_comp_flags=False, cross_compilers=False, cross_path=False
)
run_command(command, self.buildEnv.build_dir, context, env=env)
def _install_sdk(self, context):
command = [
"flatpak",
"--user",
"install",
"-y",
"flathub",
f"{self.target.name}.BaseApp//{self.target.version()}",
]
env = self.buildEnv.get_env(
cross_comp_flags=False, cross_compilers=False, cross_path=False
)
run_command(command, self.buildEnv.build_dir, context, env=env)
def build(self):
self.command("setup_remote", self._setup_remote)
self.command("install_sdk", self._install_sdk)

View File

@ -0,0 +1,32 @@
from .base import Dependency, ReleaseDownload, TcCopyBuilder
from kiwixbuild.utils import Remotefile
class aarch64_musl_toolchain(Dependency):
dont_skip = True
neutral = True
name = "aarch64_musl"
class Source(ReleaseDownload):
archive = Remotefile(
"aarch64-linux-musl-cross.tgz",
"0f18a885b161815520bbb5757a4b4ab40d0898c29bebee58d0cddd6112e59cc6",
"https://more.musl.cc/10/x86_64-linux-musl/aarch64-linux-musl-cross.tgz",
)
Builder = TcCopyBuilder
class x86_64_musl_toolchain(Dependency):
dont_skip = True
neutral = True
name = "x86-64_musl"
class Source(ReleaseDownload):
archive = Remotefile(
"x86_64-linux-musl-cross.tgz",
"a3d55de8105739fcfb8b10eaa72cdb5d779319726bacff24149388d7608d1ed8",
"https://more.musl.cc/10/x86_64-linux-musl/x86_64-linux-musl-cross.tgz",
)
Builder = TcCopyBuilder

View File

@ -0,0 +1,30 @@
from .base import Dependency, ReleaseDownload, MakeBuilder
from kiwixbuild.utils import Remotefile
class UUID(Dependency):
name = "uuid"
class Source(ReleaseDownload):
archive = Remotefile(
"e2fsprogs-libs-1.43.4.tar.gz",
"eed4516325768255c9745e7b82c9d7d0393abce302520a5b2cde693204b0e419",
"https://www.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/v1.43.4/e2fsprogs-libs-1.43.4.tar.gz",
)
extract_dir = "e2fsprogs-libs-1.43.4"
class Builder(MakeBuilder):
configure_options = [
"--enable-libuuid",
"--disable-debugfs",
"--disable-imager",
"--disable-resizer",
"--disable-defrag",
"--enable-fsck",
"--disable-uuidd",
]
configure_env = {"_format_CFLAGS": "{env.CFLAGS} -O3 -fPIC"}
static_configure_options = dynamic_configure_options = []
make_targets = ["libs"]
make_install_targets = ["install-libs"]

View File

@ -0,0 +1,55 @@
from .base import Dependency, GitClone, ReleaseDownload, MakeBuilder, MesonBuilder
from kiwixbuild.utils import Remotefile
from kiwixbuild._global import neutralEnv
import platform
class Xapian(Dependency):
name = "xapian-core"
if platform.system() == "Windows":
class Source(GitClone):
git_remote = "https://github.com/openzim/xapian-meson.git"
git_dir = "xapian-core"
class Builder(MesonBuilder):
configure_options = [
"-Denable-sse=false",
"-Denable-backend-chert=false",
"-Denable-backend-remote=false",
]
subsource_dir = "xapian-core"
@classmethod
def get_dependencies(cls, configInfo, allDeps):
return ["zlib"]
else:
class Source(ReleaseDownload):
archive = Remotefile(
"xapian-core-1.4.23.tar.xz",
"30d3518172084f310dab86d262b512718a7f9a13635aaa1a188e61dc26b2288c",
)
class Builder(MakeBuilder):
configure_options = [
"--disable-sse",
"--disable-backend-chert",
"--disable-backend-remote",
"--disable-documentation",
]
configure_env = {
"_format_LDFLAGS": "{env.LDFLAGS} -L{buildEnv.install_dir}/{buildEnv.libprefix}",
"_format_CXXFLAGS": "{env.CXXFLAGS} -I{buildEnv.install_dir}/include",
}
@classmethod
def get_dependencies(cls, configInfo, allDeps):
deps = ["zlib", "lzma"]
if configInfo.build == "wasm" or neutralEnv("distname") == "Darwin":
return deps
return deps + ["uuid"]

View File

@ -0,0 +1,17 @@
from .base import Dependency, ReleaseDownload, NoopBuilder
from kiwixbuild.utils import Remotefile
class ZimTestingSuite(Dependency):
name = "zim-testing-suite"
dont_skip = True
class Source(ReleaseDownload):
archive = Remotefile(
"zim-testing-suite-0.8.0.tar.gz",
"28f51449a3f9aea02652ca21f32c5598fd610d6cec3810fa552bd0c0f7a2d5fc",
"https://github.com/openzim/zim-testing-suite/releases/download/0.8.0/zim-testing-suite-0.8.0.tar.gz",
)
Builder = NoopBuilder

View File

@ -0,0 +1,27 @@
from .base import Dependency, GitClone, MesonBuilder
from kiwixbuild._global import neutralEnv
class ZimTools(Dependency):
name = "zim-tools"
force_build = True
class Source(GitClone):
git_remote = "https://github.com/openzim/zim-tools.git"
git_dir = "zim-tools"
class Builder(MesonBuilder):
@classmethod
def get_dependencies(cls, configInfo, allDeps):
base_deps = ["libzim", "docoptcpp", "mustache"]
if neutralEnv("distname") != "Windows":
base_deps += ["libmagic", "gumbo"]
return base_deps
@property
def configure_options(self):
# We don't build zimwriterfs on Windows, and so we don't have magic
if neutralEnv("distname") != "Windows":
yield f"-Dmagic-install-prefix={self.buildEnv.install_dir}"
if self.buildEnv.configInfo.static:
yield "-Dstatic-linkage=true"

View File

@ -0,0 +1,27 @@
import shutil
from .base import (
Dependency,
ReleaseDownload,
MesonBuilder)
from kiwixbuild.utils import Remotefile, pj, SkipCommand
from kiwixbuild._global import neutralEnv
class zlib(Dependency):
name = "zlib"
class Source(ReleaseDownload):
src_archive = Remotefile(
"zlib-1.2.12.tar.gz",
"91844808532e5ce316b3c010929493c0244f3d37593afd6de04f71821d5136d9"
)
meson_patch = Remotefile(
"zlib_1.2.12-1_patch.zip",
"8ec8344f3fe7b06ad4be768fd416694bc56cb4545ce78b0f1c18b3e72b3ec936",
"https://wrapdb.mesonbuild.com/v2/zlib_1.2.12-1/get_patch")
archives = [src_archive, meson_patch]
#patches = ['zlib_std_libname.patch']
Builder = MesonBuilder

View File

@ -0,0 +1,20 @@
from .base import Dependency, ReleaseDownload, MesonBuilder
from kiwixbuild.utils import Remotefile
class zstd(Dependency):
name = "zstd"
class Source(ReleaseDownload):
archive = Remotefile(
"zstd-1.5.5.tar.gz",
"98e9c3d949d1b924e28e01eccb7deed865eefebf25c2f21c702e5cd5b63b85e1",
"https://github.com/facebook/zstd/archive/refs/tags/v1.5.5.tar.gz",
)
class Builder(MesonBuilder):
subsource_dir = "build/meson"
build_type = "release"
strip_options = []
configure_options = ["-Dbin_programs=false", "-Dbin_contrib=false"]

View File

@ -0,0 +1,8 @@
[Flatpak Repo]
Title=Flathub
Url=https://dl.flathub.org/repo/
Homepage=https://flathub.org/
Comment=Central repository of Flatpak applications
Description=Central repository of Flatpak applications
Icon=https://dl.flathub.org/repo/logo.svg
GPGKey=mQINBFlD2sABEADsiUZUOYBg1UdDaWkEdJYkTSZD68214m8Q1fbrP5AptaUfCl8KYKFMNoAJRBXn9FbE6q6VBzghHXj/rSnA8WPnkbaEWR7xltOqzB1yHpCQ1l8xSfH5N02DMUBSRtD/rOYsBKbaJcOgW0K21sX+BecMY/AI2yADvCJEjhVKrjR9yfRX+NQEhDcbXUFRGt9ZT+TI5yT4xcwbvvTu7aFUR/dH7+wjrQ7lzoGlZGFFrQXSs2WI0WaYHWDeCwymtohXryF8lcWQkhH8UhfNJVBJFgCY8Q6UHkZG0FxMu8xnIDBMjBmSZKwKQn0nwzwM2afskZEnmNPYDI8nuNsSZBZSAw+ThhkdCZHZZRwzmjzyRuLLVFpOj3XryXwZcSefNMPDkZAuWWzPYjxS80cm2hG1WfqrG0Gl8+iX69cbQchb7gbEb0RtqNskTo9DDmO0bNKNnMbzmIJ3/rTbSahKSwtewklqSP/01o0WKZiy+n/RAkUKOFBprjJtWOZkc8SPXV/rnoS2dWsJWQZhuPPtv3tefdDiEyp7ePrfgfKxuHpZES0IZRiFI4J/nAUP5bix+srcIxOVqAam68CbAlPvWTivRUMRVbKjJiGXIOJ78wAMjqPg3QIC0GQ0EPAWwAOzzpdgbnG7TCQetaVV8rSYCuirlPYN+bJIwBtkOC9SWLoPMVZTwQARAQABtC5GbGF0aHViIFJlcG8gU2lnbmluZyBLZXkgPGZsYXRodWJAZmxhdGh1Yi5vcmc+iQJUBBMBCAA+FiEEblwF2XnHba+TwIE1QYTdTZB6fK4FAllD2sACGwMFCRLMAwAFCwkIBwIGFQgJCgsCBBYCAwECHgECF4AACgkQQYTdTZB6fK5RJQ/+Ptd4sWxaiAW91FFk7+wmYOkEe1NY2UDNJjEEz34PNP/1RoxveHDt43kYJQ23OWaPJuZAbu+fWtjRYcMBzOsMCaFcRSHFiDIC9aTp4ux/mo+IEeyarYt/oyKb5t5lta6xaAqg7rwt65jW5/aQjnS4h7eFZ+dAKta7Y/fljNrOznUp81/SMcx4QA5G2Pw0hs4Xrxg59oONOTFGBgA6FF8WQghrpR7SnEe0FSEOVsAjwQ13Cfkfa7b70omXSWp7GWfUzgBKyoWxKTqzMN3RQHjjhPJcsQnrqH5enUu4Pcb2LcMFpzimHnUgb9ft72DP5wxfzHGAWOUiUXHbAekfq5iFks8cha/RST6wkxG3Rf44Zn09aOxh1btMcGL+5xb1G0BuCQnA0fP/kDYIPwh9z22EqwRQOspIcvGeLVkFeIfubxpcMdOfQqQnZtHMCabV5Q/Rk9K1ZGc8M2hlg8gHbXMFch2xJ0Wu72eXbA/UY5MskEeBgawTQnQOK/vNm7t0AJMpWK26Qg6178UmRghmeZDj9uNRc3EI1nSbgvmGlpDmCxaAGqaGL1zW4KPW5yN25/qeqXcgCvUjZLI9PNq3Kvizp1lUrbx7heRiSoazCucvHQ1VHUzcPVLUKKTkoTP8okThnRRRsBcZ1+jI4yMWIDLOCT7IW3FePr+3xyuy5eEo9a25Ag0EWUPa7AEQALT/CmSyZ8LWlRYQZKYw417p7Z2hxqd6TjwkwM3IQ1irumkWcTZBZIbBgrSOg6CcXD2oWydCQHWi9qaxhuhEl2bJL5LskmBcMxVdQeD0LLHd8QUnbnnIby8ocvWN1alPfvJFjCUTrmD22U1ycOzRw2lIe4kiQONbOZtdWrVImQQSndjFlisitbmlWHvHm2lOOYy8+GJB7YffVV193hmnBSJffCy4bvkuLxsI+n1DhOzc7MPV3z6HGk4HiEcF0yyt9tCYhpsxHFdBoq2h771HfAcS0s98EVAqYMFnf9em+4cnYpdI6mhIfS1FQiKl6DBAYA8tT3ggla00DurPo0JwX/zN+PaO5h/6O9aCZwV7G6rbkgMuqMergXaf8oP38gr0z+MqWnkfM63Bodq68GP4l4hd02BoFBbDf38TMuGQB14+twJMdfbAxo2MbgluvQgfwHfZ2ca6gyEY+9s/YD1gugLjV+S6CB51WkFNe1z4tAPgJZNxUcKCbeaHNbthl8Hks/pY9RCEseX/EdfzF18epbSjJMPh4DPQXbUoFwmyuYcoBOPmvZHNl9hK7B/1RP8w1ZrXk8qdupC0SNbafX7270B7lMMVImzZetGsM9ypXJ6llhp3FwW09iseNyGJGPsr/dvTMGDXqOPfU/9SAS1LSTY4K9PbRtdrBE318YX8mIk5ABEBAAGJBHIEGAEIACYWIQRuXAXZecdtr5PAgTVBhN1NkHp8rgUCWUPa7AIbAgUJEswDAAJACRBBhN1NkHp8rsF0IAQZAQgAHRYhBFSmzd2JGfsgQgDYrFYnAunj7X7oBQJZQ9rsAAoJEFYnAunj7X7oR6AP/0KYmiAFeqx14Z43/6s2gt3VhxlSd8bmcVV7oJFbMhdHBIeWBp2BvsUf00I0Zl14ZkwCKfLwbbORC2eIxvzJ+QWjGfPhDmS4XUSmhlXxWnYEveSek5Tde+fmu6lqKM8CHg5BNx4GWIX/vdLi1wWJZyhrUwwICAxkuhKxuP2Z1An48930eslTD2GGcjByc27+9cIZjHKa07I/aLffo04V+oMT9/tgzoquzgpVV4jwekADo2MJjhkkPveSNI420bgT+Q7Fi1l0X1aFUniBvQMsaBa27PngWm6xE2ZYvh7nWCdd5g0c0eLIHxWwzV1lZ4Ryx4ITO/VL25ItECcjhTRdYa64sA62MYSaB0x3eR+SihpgP3wSNPFu3MJo6FKTFdi4CBAEmpWHFW7FcRmd+cQXeFrHLN3iNVWryy0HK/CUEJmiZEmpNiXecl4vPIIuyF0zgSCztQtKoMr+injpmQGC/rF/ELBVZTUSLNB350S0Ztvw0FKWDAJSxFmoxt3xycqvvt47rxTrhi78nkk6jATKGyvP55sO+K7Q7Wh0DXA69hvPrYW2eu8jGCdVGxi6HX7L1qcfEd0378S71dZ3g9o6KKl1OsDWWQ6MJ6FGBZedl/ibRfs8p5+sbCX3lQSjEFy3rx6n0rUrXx8U2qb+RCLzJlmC5MNBOTDJwHPcX6gKsUcXZrEQALmRHoo3SrewO41RCr+5nUlqiqV3AohBMhnQbGzyHf2+drutIaoh7Rj80XRh2bkkuPLwlNPf+bTXwNVGse4bej7B3oV6Ae1N7lTNVF4Qh+1OowtGjmfJPWo0z1s6HFJVxoIof9z58Msvgao0zrKGqaMWaNQ6LUeC9g9Aj/9Uqjbo8X54aLiYs8Z1WNc06jKP+gv8AWLtv6CR+l2kLez1YMDucjm7v6iuCMVAmZdmxhg5I/X2+OM3vBsqPDdQpr2TPDLX3rCrSBiS0gOQ6DwN5N5QeTkxmY/7QO8bgLo/Wzu1iilH4vMKW6LBKCaRx5UEJxKpL4wkgITsYKneIt3NTHo5EOuaYk+y2+Dvt6EQFiuMsdbfUjs3seIHsghX/cbPJa4YUqZAL8C4OtVHaijwGo0ymt9MWvS9yNKMyT0JhN2/BdeOVWrHk7wXXJn/ZjpXilicXKPx4udCF76meE+6N2u/T+RYZ7fP1QMEtNZNmYDOfA6sViuPDfQSHLNbauJBo/n1sRYAsL5mcG22UDchJrlKvmK3EOADCQg+myrm8006LltubNB4wWNzHDJ0Ls2JGzQZCd/xGyVmUiidCBUrD537WdknOYE4FD7P0cHaM9brKJ/M8LkEH0zUlo73bY4XagbnCqve6PvQb5G2Z55qhWphd6f4B6DGed86zJEa/RhS

View File

@ -0,0 +1,321 @@
import sys
from collections import OrderedDict
from .buildenv import *
from .configs import ConfigInfo
from .utils import remove_duplicates, run_command, StopBuild, Context
from .dependencies import Dependency
from .packages import PACKAGE_NAME_MAPPERS
from .versions import base_deps_versions
from ._global import (
neutralEnv,
option,
add_target_step,
get_target_step,
target_steps,
)
from . import _global
from .dependencies.base import (
Source,
Builder,
ReleaseDownload,
GitClone,
MesonBuilder,
CMakeBuilder,
QMakeBuilder,
MakeBuilder,
SCRIPT_DIR,
)
import json
from shutil import copyfile
from urllib.parse import urlparse
from urllib.request import urlopen
import json
MANIFEST = {
"app-id": "org.kiwix.desktop",
"runtime": "org.kde.Platform",
"runtime-version": base_deps_versions["org.kde"],
"base": "io.qt.qtwebengine.BaseApp",
"base-version": base_deps_versions["io.qt.qtwebengine"],
"sdk": "org.kde.Sdk",
"command": "kiwix-desktop",
"rename-icon": "kiwix-desktop",
"finish-args": [
"--device=dri",
"--env=QTWEBENGINEPROCESS_PATH=/app/bin/QtWebEngineProcess",
"--socket=wayland",
"--socket=fallback-x11",
"--socket=pulseaudio",
"--share=network",
"--share=ipc",
"--filesystem=host:ro",
],
"cleanup": [
"/include",
"/lib/pkgconfig",
"/lib/cmake",
"/lib/*.la",
"/bin/curl",
"/bin/copydatabase",
"/bin/kiwix-compile-resources",
"/bin/kiwix-manage",
"/bin/kiwix-read",
"/bin/kiwix-search",
"/bin/quest",
"/bin/simple*",
"/bin/xapian-*",
"/share/aclocal",
"/share/doc",
"/share/man",
],
"cleanup-commands": ["/app/cleanup-BaseApp.sh"],
}
GET_REF_URL_API_TEMPLATE = "https://api.github.com/repos{repo}/git/refs/tags/{ref}"
class FlatpakBuilder:
def __init__(self):
self._targets = {}
ConfigInfo.get_config("neutral", self._targets)
self.config = ConfigInfo.get_config("flatpak", self._targets)
if neutralEnv("distname") not in self.config.compatible_hosts:
print(
(
"ERROR: The config {} cannot be build on host {}.\n"
"Select another config or change your host system."
).format(self.config.name, neutralEnv("distname"))
)
self.targetDefs = self.config.add_targets(option("target"), self._targets)
def finalize_target_steps(self):
steps = []
for targetDef in self.targetDefs:
steps += self.order_steps(targetDef)
steps = list(remove_duplicates(steps))
for cfgName in ConfigInfo.all_running_configs:
cfg = ConfigInfo.all_configs[cfgName]
for tlcName in cfg.toolchain_names:
tlc = Dependency.all_deps[tlcName]
src_cfg_step = ("source", tlcName)
add_target_step(src_cfg_step, self._targets[src_cfg_step])
blt_cfg_step = ("neutral" if tlc.neutral else cfgName, tlcName)
add_target_step(blt_cfg_step, self._targets[blt_cfg_step])
for dep in steps:
add_target_step(dep, self._targets[dep])
self.instanciate_steps()
def order_steps(self, targetDef):
_targets = dict(self._targets)
yield from self.order_dependencies(targetDef, _targets)
def order_dependencies(self, targetDef, targets):
targetConfigName, targetName = targetDef
if targetConfigName == "source":
# Do not try to order sources, they will be added as dep by the
# build step two lines later.
return
try:
target = targets.pop(targetDef)
except KeyError:
return
targetConfig = ConfigInfo.get_config(targetConfigName)
for dep in target.get_dependencies(targetConfig, True):
if isinstance(dep, tuple):
depConfig, depName = dep
else:
depConfig, depName = targetConfigName, dep
if (depConfig, depName) in targets:
yield from self.order_dependencies((depConfig, depName), targets)
yield ("source", targetName)
yield targetDef
def instanciate_steps(self):
for stepDef in list(target_steps()):
stepConfig, stepName = stepDef
stepClass = Dependency.all_deps[stepName]
if stepConfig == "source":
source = get_target_step(stepDef)(stepClass)
add_target_step(stepDef, source)
else:
source = get_target_step(stepName, "source")
env = ConfigInfo.get_config(stepConfig).buildEnv
builder = get_target_step(stepDef)(stepClass, source, env)
add_target_step(stepDef, builder)
def configure(self):
steps = remove_duplicates(target_steps())
modules = OrderedDict()
for stepDef in steps:
module = modules.setdefault(stepDef[1], {})
module["name"] = stepDef[1]
if stepDef[0] == "source":
source = get_target_step(stepDef)
if getattr(source, "flatpak_no_autogen", False):
module["no-autogen"] = True
module_sources = module.setdefault("sources", [])
if isinstance(source, ReleaseDownload):
for archive in source.archives:
src = {
"type": "archive",
"dest-filename": archive.name,
"sha256": archive.sha256,
"url": archive.url,
}
if hasattr(source, "flatpak_dest"):
src["dest"] = source.flatpak_dest
module_sources.append(src)
elif isinstance(source, GitClone):
src = {
"type": "git",
"url": source.git_remote,
"tag": source.git_ref,
}
try:
parsed = urlparse(source.git_remote)
if parsed.hostname == "github.com":
repo = parsed.path[:-4]
api_url = GET_REF_URL_API_TEMPLATE.format(
repo=repo, ref=source.git_ref
)
with urlopen(api_url) as r:
ret = json.loads(r.read())
src["commit"] = ret["object"]["sha"]
except:
pass
module_sources.append(src)
for p in getattr(source, "patches", []):
patch = {"type": "patch", "path": "patches/" + p}
module_sources.append(patch)
if hasattr(source, "flatpak_command"):
command = {"type": "shell", "commands": [source.flatpak_command]}
module_sources.append(command)
else:
builder = get_target_step(stepDef)
builder.set_flatpak_buildsystem(module)
print(module["name"])
manifest = MANIFEST.copy()
modules = [m for m in modules.values() if m.get("sources")]
for m in modules:
temp = m["sources"]
del m["sources"]
m["sources"] = temp
manifest["modules"] = modules
manifest_name = "{}.json".format(MANIFEST["app-id"])
manifest_path = pj(self.config.buildEnv.build_dir, manifest_name)
with open(manifest_path, "w") as f:
f.write(json.dumps(manifest, indent=4))
def copy_patches(self):
sourceDefs = (tDef for tDef in target_steps() if tDef[0] == "source")
for sourceDef in sourceDefs:
source = get_target_step(sourceDef)
if not hasattr(source, "patches"):
continue
for p in source.patches:
path = pj(SCRIPT_DIR, "patches", p)
os.makedirs(
pj(self.config.buildEnv.build_dir, "patches"), exist_ok=True
)
dest = pj(self.config.buildEnv.build_dir, "patches", p)
copyfile(path, dest)
def build(self):
log = pj(self.config.buildEnv.log_dir, "cmd_build_flatpak.log")
context = Context("build", log, False)
command = [
"flatpak-builder",
"--user",
"--ccache",
"--force-clean",
"--keep-build-dirs",
"--disable-rofiles-fuse",
"--repo=repo",
"builddir",
f"{MANIFEST['app-id']}.json",
]
try:
run_command(
command,
self.config.buildEnv.build_dir,
context,
env=self.config.get_env(),
)
context._finalise()
except subprocess.CalledProcessError:
with open(log, "r") as f:
print(f.read())
raise StopBuild()
def bundle(self):
log = pj(self.config.buildEnv.log_dir, "cmd_bundle_flatpak.log")
context = Context("bundle", log, False)
app_id = MANIFEST["app-id"]
command = ["flatpak", "build-bundle", "repo", f"{app_id}.flatpak", app_id]
try:
run_command(
command,
self.config.buildEnv.build_dir,
context,
env=self.config.get_env(),
)
context._finalise()
except subprocess.CalledProcessError:
with open(log, "r") as f:
print(f.read())
raise StopBuild()
def _get_packages(self):
package_name_mapper = PACKAGE_NAME_MAPPERS.get("flatpak", {})
to_drop = []
for builderDef in self._targets:
configName, builderName = builderDef
packages = package_name_mapper.get(builderName)
if packages:
to_drop.append(builderDef)
for dep in to_drop:
del self._targets[dep]
def run(self):
try:
# This is a small hack, we don't need the list of packages to
# install in a flatpak sdk, but _get_packages() will drop the
# dependencies we already have in the sdk.
self._get_packages()
self.finalize_target_steps()
print("[SETUP TOOLCHAINS]")
for config in ConfigInfo.all_running_configs.values():
config.finalize_setup()
for cfgName in ConfigInfo.all_running_configs:
cfg = ConfigInfo.all_configs[cfgName]
for tlcName in cfg.toolchain_names:
tlc = Dependency.all_deps[tlcName]
builderDef = (cfgName, tlcName)
builder = get_target_step(builderDef)
print("build {} ({}):".format(builder.name, cfgName))
add_target_step(builderDef, builder)
builder.build()
print("[GENERATE FLATPAK MANIFEST]")
self.configure()
self.copy_patches()
print("[BUILD FLATBACK]")
self.build()
print("[BUNDLE]")
self.bundle()
# No error, clean intermediate file at end of build if needed.
print("[CLEAN]")
if option("clean_at_end"):
for config in ConfigInfo.all_running_configs.values():
config.clean_intermediate_directories()
else:
print("SKIP")
except StopBuild:
sys.exit("Stopping build due to errors")

102
kiwixbuild/packages.py Normal file
View File

@ -0,0 +1,102 @@
_fedora_common = [
"automake",
"libtool",
"cmake",
"git",
"subversion",
"ccache",
"pkgconf-pkg-config",
"gcc-c++",
"gettext-devel",
]
_debian_common = [
"automake",
"libtool",
"cmake",
"git",
"subversion",
"ccache",
"pkg-config",
"gcc",
"autopoint",
]
PACKAGE_NAME_MAPPERS = {
"flatpak": {
"zlib": True,
"lzma": True,
"icu4c": True,
"qt": True,
"qtwebengine": True,
"uuid": True,
"libxml2": True,
"libssl": True,
"libcurl": True,
},
"fedora_native_dyn": {
"COMMON": _fedora_common,
"uuid": ["libuuid-devel"],
"xapian-core": None, # Not the right version on fedora 25
"pugixml": None, # ['pugixml-devel'] but package doesn't provide pkg-config file
"libmicrohttpd": ["libmicrohttpd-devel"],
"zlib": ["zlib-devel"],
"lzma": ["xz-devel"],
"icu4c": None,
"zimlib": None,
"file": ["file-devel"],
"gumbo": ["gumbo-parser-devel"],
"aria2": ["aria2"],
"qt": ["qt5-qtbase-devel", "qt5-qtsvg"],
"qtwebengine": ["qt5-qtwebengine-devel"],
},
"fedora_native_static": {
"COMMON": _fedora_common + ["glibc-static", "libstdc++-static"],
"lzma": ["xz-devel", "xz-static"],
# Either there is no packages, or no static or too old
},
"fedora_i586_dyn": {
"COMMON": _fedora_common + ["glibc-devel.i686", "libstdc++-devel.i686"],
},
"fedora_i586_static": {
"COMMON": _fedora_common + ["glibc-devel.i686"],
},
"fedora_armhf_static": {"COMMON": _fedora_common},
"fedora_armhf_dyn": {"COMMON": _fedora_common},
"fedora_android": {"COMMON": _fedora_common},
"debian_native_dyn": {
"COMMON": _debian_common + ["libbz2-dev", "libmagic-dev"],
"zlib": ["zlib1g-dev"],
"uuid": ["uuid-dev"],
"libmicrohttpd": ["libmicrohttpd-dev", "ccache"],
"qt": ["libqt5gui5", "qtbase5-dev", "qt5-default"],
"qtwebengine": ["qtwebengine5-dev"],
"aria2": ["aria2"],
},
"debian_native_static": {
"COMMON": _debian_common + ["libbz2-dev", "libmagic-dev"],
},
"debian_i586_dyn": {
"COMMON": _debian_common
+ ["libc6-dev-i386", "lib32stdc++6", "gcc-multilib", "g++-multilib"],
},
"debian_i586_static": {
"COMMON": _debian_common
+ ["libc6-dev-i386", "lib32stdc++6", "gcc-multilib", "g++-multilib"],
},
"debian_armhf_static": {
"COMMON": _debian_common,
},
"debian_armhf_dyn": {
"COMMON": _debian_common,
},
"debian_android": {
"COMMON": _debian_common,
},
"Darwin_native_dyn": {
"COMMON": ["autoconf", "automake", "libtool", "cmake", "pkg-config"],
"file": ["libmagic"],
},
"Darwin_iOS": {
"COMMON": ["autoconf", "automake", "libtool", "cmake", "pkg-config"],
"file": ["libmagic"],
},
}

View File

@ -0,0 +1,33 @@
diff -ur android-ndk-r21e/build/tools/make_standalone_toolchain.py android-ndk-r21e.patched/build/tools/make_standalone_toolchain.py
--- android-ndk-r21e/build/tools/make_standalone_toolchain.py 2025-03-04 20:48:14.681288830 +0400
+++ android-ndk-r21e.patched/build/tools/make_standalone_toolchain.py 2025-03-05 12:10:47.252578915 +0400
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
#
# Copyright (C) 2016 The Android Open Source Project
#
@@ -21,7 +21,6 @@
"""
import argparse
import atexit
-from distutils.dir_util import copy_tree
import inspect
import logging
import os
@@ -221,13 +220,13 @@
def create_toolchain(install_path, arch, api, toolchain_path, host_tag):
"""Create a standalone toolchain."""
- copy_tree(toolchain_path, install_path)
+ shutil.copytree(toolchain_path, install_path)
triple = get_triple(arch)
make_clang_scripts(install_path, arch, api, host_tag == 'windows-x86_64')
replace_gcc_wrappers(install_path, triple, host_tag == 'windows-x86_64')
prebuilt_path = os.path.join(NDK_DIR, 'prebuilt', host_tag)
- copy_tree(prebuilt_path, install_path)
+ shutil.copytree(prebuilt_path, install_path, dirs_exist_ok=True)
gdbserver_path = os.path.join(
NDK_DIR, 'prebuilt', 'android-' + arch, 'gdbserver')

View File

@ -0,0 +1,31 @@
diff '--color=auto' -ur docoptcpp-0.6.2/meson.build docoptcpp-0.6.2_patched/meson.build
--- docoptcpp-0.6.2/meson.build 2024-08-26 14:28:47.553448529 +0200
+++ docoptcpp-0.6.2_patched/meson.build 2024-08-26 14:10:47.232603427 +0200
@@ -10,11 +10,25 @@
# bug with missing dllexport. fixed in next version.
if cpp.get_argument_syntax() == 'msvc'
- doclib = static_library('docopt', 'docopt.cpp')
+ doclib = static_library('docopt', 'docopt.cpp', install: true)
else
- doclib = library('docopt', 'docopt.cpp')
+ doclib = library('docopt', 'docopt.cpp', install: true)
endif
executable('docopt_example', 'examples/naval_fate.cpp', link_with: doclib)
docopt_dep = declare_dependency(include_directories: include_directories('.'),
link_with: doclib)
+
+install_headers(
+ 'docopt.h',
+ 'docopt_value.h',
+ subdir: 'docopt'
+)
+
+pkg_mod = import('pkgconfig')
+pkg_mod.generate(
+ doclib,
+ version: meson.project_version(),
+ name: 'docopt',
+ filebase: 'docopt'
+)

View File

@ -0,0 +1,14 @@
diff -ur docoptcpp-0.6.2/meson.build docoptcpp-0.6.2_boostregex/meson.build
--- docoptcpp-0.6.2/meson.build 2024-08-28 17:22:46.256716100 +0200
+++ docoptcpp-0.6.2_boostregex/meson.build 2024-08-28 17:02:47.932681000 +0200
@@ -8,6 +8,10 @@
add_project_arguments('-DDOCOPT_DLL', '-DDOCOPT_EXPORTS', language: 'cpp')
endif
+if cpp.get_id() =='msvc'
+ add_project_arguments('-DDOCTOPT_USE_BOOST_REGEX', '-DBOOST_REGEX_STANDALONE', language: 'cpp')
+endif
+
# bug with missing dllexport. fixed in next version.
if cpp.get_argument_syntax() == 'msvc'
doclib = static_library('docopt', 'docopt.cpp', install: true)

View File

@ -0,0 +1,36 @@
diff -ur icu4c/source/common/unicode/platform.h icu4c.patched/source/common/unicode/platform.h
--- icu4c/source/common/unicode/platform.h 2018-04-17 17:20:31.048946098 +0200
+++ icu4c.patched/source/common/unicode/platform.h 2018-06-11 11:22:40.692327158 +0200
@@ -644,7 +644,7 @@
#elif U_PLATFORM == U_PF_ANDROID || U_PLATFORM_IS_DARWIN_BASED
# define U_CHARSET_IS_UTF8 1
#else
-# define U_CHARSET_IS_UTF8 0
+# define U_CHARSET_IS_UTF8 1
#endif
/** @} */
diff -ur icu4c/source/common/unicode/uconfig.h icu4c.patched/source/common/unicode/uconfig.h
--- icu4c/source/common/unicode/uconfig.h 2018-04-17 17:20:31.072946266 +0200
+++ icu4c.patched/source/common/unicode/uconfig.h 2018-06-11 11:26:24.512936322 +0200
@@ -107,7 +107,7 @@
defined(U_TOOLUTIL_IMPLEMENTATION)
# define U_NO_DEFAULT_INCLUDE_UTF_HEADERS 1
#else
-# define U_NO_DEFAULT_INCLUDE_UTF_HEADERS 0
+# define U_NO_DEFAULT_INCLUDE_UTF_HEADERS 1
#endif
/**
diff -ur icu4c/source/common/unicode/uversion.h icu4c.patched/source/common/unicode/uversion.h
--- icu4c/source/common/unicode/uversion.h 2018-04-17 17:20:31.086946363 +0200
+++ icu4c.patched/source/common/unicode/uversion.h 2018-06-11 11:20:27.093375709 +0200
@@ -122,7 +122,7 @@
# define U_NAMESPACE_QUALIFIER U_ICU_NAMESPACE::
# ifndef U_USING_ICU_NAMESPACE
-# define U_USING_ICU_NAMESPACE 1
+# define U_USING_ICU_NAMESPACE 0
# endif
# if U_USING_ICU_NAMESPACE
U_NAMESPACE_USE

View File

@ -34,13 +34,12 @@ diff -ur icu4c/source/data/Makefile.in icu4c.patched/source/data/Makefile.in
## RES files
--include $(LOCSRCDIR)/resfiles.mk
--include $(CURRSRCDIR)/resfiles.mk
--include $(LANGSRCDIR)/resfiles.mk
+#-include $(LOCSRCDIR)/resfiles.mk
+#-include $(CURRSRCDIR)/resfiles.mk
-include $(LANGSRCDIR)/resfiles.mk
--include $(REGIONSRCDIR)/resfiles.mk
--include $(ZONESRCDIR)/resfiles.mk
--include $(UNITSRCDIR)/resfiles.mk
+#-include $(LOCSRCDIR)/resfiles.mk
+#-include $(CURRSRCDIR)/resfiles.mk
+#-include $(LANGSRCDIR)/resfiles.mk
+#-include $(REGIONSRCDIR)/resfiles.mk
+#-include $(ZONESRCDIR)/resfiles.mk
+#-include $(UNITSRCDIR)/resfiles.mk

View File

@ -0,0 +1,13 @@
diff -ur icu4c/source/config/mh-linux icu4c.rpath/source/config/mh-linux
--- icu4c/source/config/mh-linux 2018-04-17 11:31:50.674012676 +0200
+++ icu4c.rpath/source/config/mh-linux 2018-04-17 11:28:57.776134587 +0200
@@ -19,7 +19,7 @@
LIBCPPFLAGS =
## Compiler switch to embed a runtime search path
-LD_RPATH= -Wl,-zorigin,-rpath,'$$'ORIGIN
+LD_RPATH= '-Wl,-zorigin,-rpath,\$ORIGIN'
LD_RPATH_PRE = -Wl,-rpath,
## These are the library specific LDFLAGS
Les fichiers binaires icu4c/.svn/wc.db et icu4c.rpath/.svn/wc.db sont différents

View File

@ -0,0 +1,153 @@
diff '--color=auto' -ur icu4c-71.1/source/config/mh-unknown icu4c-71.1.wasm/source/config/mh-unknown
--- icu4c-71.1/source/config/mh-unknown 2022-04-08 00:41:55.000000000 +0200
+++ icu4c-71.1.wasm/source/config/mh-unknown 2023-10-25 14:00:18.035718690 +0200
@@ -1,29 +1,87 @@
## -*-makefile-*-
## Copyright (C) 2016 and later: Unicode, Inc. and others.
## License & terms of use: http://www.unicode.org/copyright.html
-## Copyright (c) 2003, International Business Machines Corporation and
+## Linux-specific setup
+## Copyright (c) 1999-2013, International Business Machines Corporation and
## others. All Rights Reserved.
-##
-# Note, this is not a real mh- file. You got here because configure
-# (specifically, aclocal.m4) could not determine a suitable mh- file.
-#
-# Perhaps your platform wasn't detected- try changing aclocal.m4 and
-# re-running autoconf.
-#
-# If your platform is truly new/different:
-# As a start, try copying mh-linux (which is fairly generic) over this
-# file, and re-run config.status.
-
-%.$(STATIC_O) %.o %.$(STATIC_O) %.o ../data/%.o %.d %.d %.$(SO).$(SO_TARGET_VERSION_MAJOR) %.$(SO):
- @echo
- @echo
- @echo "*** ERROR - configure could not detect your platform"
- @echo "*** see the readme.html"
- @echo "*** or, try copying icu/source/config/mh-linux to mh-unknown"
- @echo "*** and editing it."
- @echo
- @echo
- exit 1
+## Commands to generate dependency files
+GEN_DEPS.c= $(CC) -E -MM $(DEFS) $(CPPFLAGS)
+GEN_DEPS.cc= $(CXX) -E -MM $(DEFS) $(CPPFLAGS) $(CXXFLAGS)
+## Flags for position independent code
+SHAREDLIBCFLAGS = -fPIC
+SHAREDLIBCXXFLAGS = -fPIC
+SHAREDLIBCPPFLAGS = -DPIC
+
+## Additional flags when building libraries and with threads
+THREADSCPPFLAGS = -D_REENTRANT
+LIBCPPFLAGS =
+
+## Compiler switch to embed a runtime search path
+LD_RPATH= -Wl,-zorigin,-rpath,'$$'ORIGIN
+LD_RPATH_PRE = -Wl,-rpath,
+
+## These are the library specific LDFLAGS
+LDFLAGSICUDT=-nodefaultlibs -nostdlib
+
+## Compiler switch to embed a library name
+# The initial tab in the next line is to prevent icu-config from reading it.
+ LD_SONAME = -Wl,-soname -Wl,$(notdir $(MIDDLE_SO_TARGET))
+#SH# # We can't depend on MIDDLE_SO_TARGET being set.
+#SH# LD_SONAME=
+
+## Shared library options
+LD_SOOPTIONS= -Wl,-Bsymbolic
+
+## Shared object suffix
+SO = so
+## Non-shared intermediate object suffix
+STATIC_O = ao
+
+## Compilation rules
+%.$(STATIC_O): $(srcdir)/%.c
+ $(call SILENT_COMPILE,$(strip $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS)) -o $@ $<)
+%.o: $(srcdir)/%.c
+ $(call SILENT_COMPILE,$(strip $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS)) -o $@ $<)
+
+%.$(STATIC_O): $(srcdir)/%.cpp
+ $(call SILENT_COMPILE,$(strip $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS)) -o $@ $<)
+%.o: $(srcdir)/%.cpp
+ $(call SILENT_COMPILE,$(strip $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS)) -o $@ $<)
+
+
+## Dependency rules
+%.d: $(srcdir)/%.c
+ $(call ICU_MSG,(deps)) $<
+ @$(SHELL) -ec '$(GEN_DEPS.c) $< \
+ | sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \
+ [ -s $@ ] || rm -f $@'
+
+%.d: $(srcdir)/%.cpp
+ $(call ICU_MSG,(deps)) $<
+ @$(SHELL) -ec '$(GEN_DEPS.cc) $< \
+ | sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \
+ [ -s $@ ] || rm -f $@'
+
+## Versioned libraries rules
+
+%.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION)
+ $(RM) $@ && ln -s ${<F} $@
+%.$(SO): %.$(SO).$(SO_TARGET_VERSION_MAJOR)
+ $(RM) $@ && ln -s ${*F}.$(SO).$(SO_TARGET_VERSION) $@
+
+## Bind internal references
+
+# LDflags that pkgdata will use
+BIR_LDFLAGS= -Wl,-Bsymbolic
+
+# Dependencies [i.e. map files] for the final library
+BIR_DEPS=
+
+## Remove shared library 's'
+STATIC_PREFIX_WHEN_USED =
+STATIC_PREFIX =
+
+## End Linux-specific setup
diff '--color=auto' -ur icu4c-71.1/source/config.sub icu4c-71.1.wasm/source/config.sub
--- icu4c-71.1/source/config.sub 2022-04-08 00:41:55.000000000 +0200
+++ icu4c-71.1.wasm/source/config.sub 2023-10-25 13:58:23.711645708 +0200
@@ -312,7 +312,7 @@
| ubicom32 \
| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
| visium \
- | wasm32 \
+ | wasm32 | wasm64 \
| x86 | xc16x | xstormy16 | xtensa \
| z8k | z80)
basic_machine=$basic_machine-unknown
@@ -443,7 +443,7 @@
| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
| vax-* \
| visium-* \
- | wasm32-* \
+ | wasm32-* | wasm64-* \
| we32k-* \
| x86-* | x86_64-* | xc16x-* | xps100-* \
| xstormy16-* | xtensa*-* \
@@ -1247,6 +1247,9 @@
wasm32)
basic_machine=wasm32-unknown
;;
+ wasm64)
+ basic_machine=wasm64-unknown
+ ;;
w65*)
basic_machine=w65-wdc
os=-none
@@ -1416,7 +1419,7 @@
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
| -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
- | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox*)
+ | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -emscripten*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)

View File

@ -0,0 +1,29 @@
diff '--color=auto' -ur libmicrohttpd-0.9.76_orig/meson.build libmicrohttpd-0.9.76/meson.build
--- libmicrohttpd-0.9.76_orig/meson.build 2024-08-18 14:55:29.372805433 +0200
+++ libmicrohttpd-0.9.76/meson.build 2024-08-18 17:19:44.087444728 +0200
@@ -6,6 +6,8 @@
default_options: ['warning_level=1'],
)
+pkg = import('pkgconfig')
+
add_project_arguments('-D_GNU_SOURCE', language: 'c')
incdirs = include_directories('src/include')
@@ -267,6 +269,16 @@
install: true,
)
+install_headers(
+ 'src/include/microhttpd.h',
+)
+
+pkg.generate(
+ libmicrohttpd,
+ description: 'Libmicrohttpd',
+ name: 'libmicrohttpd',
+)
+
depinc = include_directories('.', 'src/include')
libmicrohttpd_dep = declare_dependency(
include_directories: depinc,

View File

@ -0,0 +1,31 @@
diff '--color=auto' -ur libmicrohttpd-0.9.76/meson.build libmicrohttpd-0.9.76_patched/meson.build
--- libmicrohttpd-0.9.76/meson.build 2024-08-22 15:17:59.217715872 +0200
+++ libmicrohttpd-0.9.76_patched/meson.build 2024-08-22 15:20:23.755358647 +0200
@@ -126,7 +126,26 @@
foreach s : sizes
cdata.set('SIZEOF_@0@'.format(s.underscorify().to_upper()), cc.sizeof(s))
endforeach
-cdata.set('SIZEOF_STRUCT_TIMEVAL_TV_SEC', cc.sizeof('time_t'))
+
+cdata.set(
+ 'SIZEOF_STRUCT_TIMEVAL_TV_SEC',
+ cc.sizeof(
+ 'test_var.tv_sec',
+ prefix: '''#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif /* HAVE_SYS_TIME_H */
+#ifdef HAVE_TIME_H
+#include <time.h>
+#endif /* HAVE_TIME_H */
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif /* HAVE_SYS_TYPES_H */
+#ifdef _WIN32
+#include <winsock.h>
+#endif /* _WIN32 */
+struct timeval test_var;'''
+ )
+)
cdata.set('SIZEOF_UINT64_T', 8)
cdata.set('HAVE_PIPE2_FUNC', cc.has_function('pipe2'))

View File

@ -0,0 +1,15 @@
--- libmicrohttpd-0.9.76_orig/meson.build 2024-10-08 15:53:53.370828250 +0400
+++ libmicrohttpd-0.9.76/meson.build 2024-10-08 16:23:24.985668690 +0400
@@ -77,7 +77,11 @@
endforeach
cdata.set('HAVE_ASSERT', cc.has_header_symbol('assert.h', 'assert'))
-cdata.set10('HAVE_INET6', cc.has_header_symbol('netinet/in.h', 'struct in6_addr'))
+if host_machine.system() == 'windows'
+ cdata.set10('HAVE_INET6', 1)
+else
+ cdata.set10('HAVE_INET6', cc.has_header_symbol('netinet/in.h', 'struct in6_addr'))
+endif
functions = [
'accept4',

View File

@ -0,0 +1,54 @@
diff '--color=auto' -ur lzma-5.2.6_orig/src/liblzma/meson.build lzma-5.2.6/src/liblzma/meson.build
--- lzma-5.2.6_orig/src/liblzma/meson.build 2023-11-23 14:31:26.110195070 +0100
+++ lzma-5.2.6/src/liblzma/meson.build 2023-12-06 17:04:49.325148650 +0100
@@ -1,3 +1,5 @@
+pkg = import('pkgconfig')
+
lzma_sources = [
'../common/tuklib_physmem.c',
'common/common.c',
@@ -121,12 +123,44 @@
lzmainc = include_directories('api', 'common',
'check', 'lz', 'rangecoder', 'lzma', 'delta', 'simple', '../common')
+
+install_headers(
+ 'api/lzma.h',
+)
+
+install_headers(
+ 'api/lzma/version.h',
+ 'api/lzma/base.h',
+ 'api/lzma/vli.h',
+ 'api/lzma/check.h',
+ 'api/lzma/filter.h',
+ 'api/lzma/bcj.h',
+ 'api/lzma/delta.h',
+ 'api/lzma/lzma12.h',
+ 'api/lzma/container.h',
+ 'api/lzma/stream_flags.h',
+ 'api/lzma/block.h',
+ 'api/lzma/index.h',
+ 'api/lzma/index_hash.h',
+ 'api/lzma/hardware.h',
+ subdir: 'lzma'
+)
+
liblzma = library('lzma', lzma_sources,
main_dec_sources, main_enc_sources, check_sources,
simplefilter_sources, lzma1_sources,
lz_sources, delta_sources,
include_directories : [confinc, lzmainc],
c_args : ['-DHAVE_CONFIG_H', '-DTUKLIB_SYMBOL_PREFIX=lzma_'],
+ install: true
+)
+
+pkg.generate(liblzma,
+ name: 'liblzma',
+ filebase: 'liblzma',
+ description: 'The liblzma compression library',
+ version: meson.project_version(),
+ url: 'http://tukaani.org/xz/'
)
lzma_dep = declare_dependency(link_with : liblzma,

View File

@ -0,0 +1,8 @@
SET(CMAKE_SYSTEM_NAME {host_machine[system]})
SET(CMAKE_ANDROID_STANDALONE_TOOLCHAIN {install_path})
SET(CMAKE_C_COMPILER "{binaries[CC]}")
SET(CMAKE_CXX_COMPILER "{binaries[CXX]}")
SET(CMAKE_FIND_ROOT_PATH {root_path})

Some files were not shown because too many files have changed in this diff Show More