Compare commits

...

192 Commits
r_64 ... 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
74 changed files with 1096 additions and 1130 deletions

12
.github/FUNDING.yml vendored
View File

@ -1,12 +0,0 @@
# These are supported funding model platforms
github: kiwix # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # https://kiwix.org/support-us/

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/

View File

@ -22,9 +22,9 @@ BUILD_DEF = """
| 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 | | | | | win-x86_64 | win-x86_64-static |
| 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 | | | | | win-x86_64 | win-x86_64-mixed |
| 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 |
@ -38,34 +38,33 @@ BUILD_DEF = """
| macos | macOS_x86_64 | B | B | | | | | |
| macos | apple_all_static | | BP | | | | xcframework | |
----------------------------------------------------------------------------------------------------------------------------------------------
| | flatpak | | | | | BP | | |
| | native_static | d | d | dBPSD | dBPSD | | linux-x86_64 | linux-x86_64-static |
| | native_mixed | BPS | BPS | | | | linux-x86_64 | |
| | native_dyn | d | d | dB | dB | dBPS | | linux-x86_64-dyn |
| 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
| | android_arm | dBP | dBP | | | | android-arm | android-arm |
| | android_arm64 | dBP | dBP | | | | android-arm64 | android-arm64 |
| | android_x86 | BP | BP | | | | android-x86 | |
| | android_x86_64 | BP | BP | | | | android-x86_64 | |
| | armv6_static | | | BP | BP | | linux-armv6 | |
| | armv6_mixed | BP | | | | | linux-armv6 | |
| | armv6_dyn | | | B | B | | | |
| | armv8_static | | | BP | BP | | linux-armv8 | |
| | armv8_mixed | BP | | | | | linux-armv8 | |
| | armv8_dyn | | | B | B | | | |
| | aarch64_static | | | BP | BP | | linux-aarch64 | |
| | aarch64_mixed | BP | | | | | linux-aarch64 | |
| | aarch64_dyn | d | | B | B | | | linux-aarch64-dyn |
| | aarch64_musl_static| | | BP | BP | | linux-aarch64-musl | |
| | aarch64_musl_mixed | BP | | | | | linux-aarch64-musl | |
| | aarch64_musl_dyn | d | | B | B | | | linux-aarch64-musl-dyn |
| | x86-64_musl_static | | | BP | BP | | linux-x86_64-musl | |
| | x86-64_musl_mixed | BP | | | | | linux-x86_64-musl | |
| | win32_static | d | dB | dBP | dBP | | win-i686 |win32-static |
| | win32_dyn | d | dB | dB | dB | | |win32-dyn |
| | i586_static | | | BP | BP | | linux-i586 | |
| | i586_dyn | | | B | B | | | |
| | wasm | dBP | | | | | wasm-emscripten | wasm |
| 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 |
"""

View File

@ -21,16 +21,15 @@ from common import (
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 = select_build_targets(PUBLISH)
def release_filter(project):
return release_versions.get(project) is not None
TARGETS = tuple(filter(release_filter, TARGETS))
else:
TARGETS = select_build_targets(BUILD)
for target in TARGETS:
run_kiwix_build(target, config=COMPILE_CONFIG, make_release=MAKE_RELEASE)

View File

@ -42,9 +42,15 @@ 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"
default_tmp_dir = os.getenv("TEMP") if platform.system() == "Windows" else "/tmp"
TMP_DIR = Path(os.getenv("TMP_DIR", default_tmp_dir))
KBUILD_SOURCE_DIR = HOME / "kiwix-build"
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
@ -58,18 +64,25 @@ else:
FLATPAK_HTTP_GIT_REMOTE = "https://github.com/flathub/org.kiwix.desktop.git"
FLATPAK_GIT_REMOTE = "git@github.com:flathub/org.kiwix.desktop.git"
BIN_EXT = ".exe" if COMPILE_CONFIG.startswith("win32_") else ""
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")],
[f + BIN_EXT for f in ("kiwix-manage", "kiwix-search", "kiwix-serve")]
+ ["icu*.dll"],
),
"zim-tools": (
INSTALL_DIR / "bin",
@ -86,23 +99,40 @@ EXPORT_FILES = {
"zimwriterfs",
"zimrecreate",
)
],
]
+ ["icu*.dll"],
),
"libzim": (
INSTALL_DIR,
(
## Linux
# We need to package all dependencies (`*.a`) on wasm
"lib/*/libzim.a" if COMPILE_CONFIG != "wasm" else "lib/*.a",
"lib/*/libzim.so",
"lib/*/libzim.so.{version}".format(version=main_project_versions["libzim"]),
"lib/*/libzim.so.{version}".format(
version=major_version(main_project_versions["libzim"])
*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"])
@ -123,6 +153,14 @@ EXPORT_FILES = {
"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",
@ -197,6 +235,7 @@ def run_kiwix_build(
subprocess.check_call(command, cwd=str(HOME), env=env)
print_message("Build ended")
try:
import paramiko
@ -209,8 +248,8 @@ try:
host, port = host.split(":", 1)
else:
port = "22"
if '@' in host:
user, host = host.split('@', 1)
if "@" in host:
user, host = host.split("@", 1)
else:
user = None
@ -221,7 +260,14 @@ try:
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)
client.connect(
host,
port=port,
username=user,
key_filename=_environ.get("SSH_KEY"),
look_for_keys=False,
compress=True,
)
try:
yield client
finally:
@ -250,7 +296,6 @@ try:
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.
@ -265,7 +310,10 @@ except ModuleNotFoundError:
else:
port = "22"
# sending SFTP mkdir command to the sftp interactive mode and not batch (-b) mode
# 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(
@ -276,6 +324,8 @@ except ModuleNotFoundError:
)
command = [
"sftp",
"-c",
"aes128-ctr",
"-i",
_environ.get("SSH_KEY"),
"-P",
@ -343,10 +393,10 @@ def filter_install_dir(path):
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.xz)
# Full: False if we are creating a archive to be used as pre-cached dependencies for project's CI (deps_{config}_{target}.tar.xz)
# 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.xz".format(
archive_name = name or "deps_{}_{}.tar.gz".format(
get_dependency_archive_name(), target
)
print_message("Create archive {}.", archive_name)
@ -395,7 +445,7 @@ def make_deps_archive(target=None, name=None, full=False):
files_to_archive += SOURCE_DIR.glob("zim-testing-suite-*/*")
archive_file = TMP_DIR / archive_name
with tarfile.open(str(archive_file), "w:xz") as tar:
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)))
@ -411,6 +461,25 @@ def get_postfix(project):
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:
@ -432,7 +501,13 @@ def make_archive(project, make_release):
files_to_archive = []
for export_file in export_files:
files_to_archive.extend(base_dir.glob(export_file))
if platform_name == "win-i686":
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
)
@ -466,11 +541,27 @@ def create_desktop_image(make_release):
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 = [
"kiwix-build/scripts/create_kiwix-desktop_appImage.sh",
KBUILD_SOURCE_DIR / "scripts" / "create_kiwix-desktop_appImage.sh",
str(INSTALL_DIR),
str(src_dir),
str(HOME / "AppDir"),
@ -504,7 +595,7 @@ def update_flathub_git():
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"]:
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", "."]

View File

@ -15,6 +15,7 @@ from common import (
HOME,
COMPILE_CONFIG,
OS_NAME,
MAKE_RELEASE,
)
@ -32,29 +33,40 @@ def download_base_archive(base_name):
return file_path
ARCHIVE_NAME_TEMPLATE = "base_deps_{os}_{config}_{version}.tar.xz"
def get_archive_name():
ARCHIVE_NAME_TEMPLATE = "base_deps_{os}_{config}_{version}.tar.gz"
if COMPILE_CONFIG == "flatpak":
base_dep_archive_name = "base_deps_flatpak.tar.xz"
else:
base_dep_archive_name = ARCHIVE_NAME_TEMPLATE.format(
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,
)
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")
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:
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))
main()

15
.github/stale.yml vendored
View File

@ -1,15 +0,0 @@
daysUntilClose: false
staleLabel: stale
issues:
daysUntilStale: 60
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be now be reviewed manually. Thank you
for your contributions.
pulls:
daysUntilStale: 7
markComment: >
This pull request has been automatically marked as stale because it has not had
recent activity. It will be now be reviewed manually. Thank you
for your contributions.

View File

@ -1,13 +1,109 @@
name: Release&Nigthly
name: CD
on:
push:
tags:
- r_[0-9]+
schedule:
- cron: '0 1 * * *'
- 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
@ -38,14 +134,14 @@ jobs:
image_variant: manylinux
- config: aarch64_mixed
image_variant: manylinux
- config: win32_static
image_variant: f35
- 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-06-03"
image: "ghcr.io/kiwix/kiwix-build_ci_${{matrix.image_variant}}:2024-11-30"
options: "--device /dev/fuse --privileged"
steps:
- name: Checkout code
@ -77,11 +173,9 @@ jobs:
kiwix-build/.github/scripts/build_release_nightly.py
env:
COMPILE_CONFIG: ${{matrix.config}}
BINTRAY_USER: kiwix
BINTRAY_PASS: ${{secrets.bintray_pass}}
- name: Upload failure logs
if: failure()
run: $HOME/kiwix-build/.github/scripts/upload_failure_logs.sh
run: $HOME/kiwix-build/.github/scripts/upload_failure_logs.py
env:
COMPILE_CONFIG: ${{matrix.config}}
@ -126,7 +220,7 @@ jobs:
kiwix-build/.github/scripts/build_release_nightly.py
- name: Upload failure logs
if: failure()
run: $HOME/kiwix-build/.github/scripts/upload_failure_logs.sh
run: $HOME/kiwix-build/.github/scripts/upload_failure_logs.py
Macos:
strategy:
@ -160,7 +254,7 @@ jobs:
python-version: '3.10'
- name: Install packages
run:
brew install pkg-config ninja automake autoconf
brew install automake # ninja
- name: Install python modules
run: |
pip3 install meson pytest requests distro
@ -205,7 +299,7 @@ jobs:
COMPILE_CONFIG: ${{matrix.config}}
- name: Upload failure logs
if: failure()
run: $GITHUB_WORKSPACE/.github/scripts/upload_failure_logs.sh
run: $GITHUB_WORKSPACE/.github/scripts/upload_failure_logs.py
env:
COMPILE_CONFIG: ${{matrix.config}}
@ -215,7 +309,7 @@ jobs:
runs-on: ubuntu-22.04
env:
COMPILE_CONFIG: native_static
OS_NAME: linux
OS_NAME: focal
steps:
- name: Checkout code
uses: actions/checkout@v4

View File

@ -9,18 +9,23 @@ jobs:
Windows:
strategy:
fail-fast: false
runs-on: windows-latest
matrix:
config:
- native_mixed
- native_dyn
- native_static
runs-on: windows-2022
env:
OS_NAME: windows
COMPILE_CONFIG: native_dyn
COMPILE_CONFIG: ${{matrix.config}}
HOME: 'C:\\Users\\runneradmin'
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup python 3.8
uses: actions/setup-python@v3
uses: actions/checkout@v4
- name: Setup python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.8'
python-version: '3.12'
- name: Install packages
run: |
choco.exe install pkgconfiglite ninja
@ -29,6 +34,15 @@ jobs:
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:
@ -96,16 +110,15 @@ jobs:
image_variant: manylinux
- config: aarch64_mixed
image_variant: manylinux
- config: win32_static
image_variant: f35
- config: win32_dyn
image_variant: f35
- 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-06-03"
image: "ghcr.io/kiwix/kiwix-build_ci_${{matrix.image_variant}}:2024-11-30"
options: "--device /dev/fuse --privileged"
steps:
- name: Checkout code
@ -229,7 +242,7 @@ jobs:
python-version: '3.10'
- name: Install packages
run:
brew install pkg-config ninja automake autoconf
brew install automake # ninja
- name: Install python modules
run: |
pip3 install meson pytest requests distro paramiko

View File

@ -12,7 +12,7 @@ Kiwix Build audience is:
* Kiwix developer team for its own CI/CD
[![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/releaseNigthly.yml/badge.svg?branch=main)](https://github.com/kiwix/kiwix-build/actions/workflows/releaseNigthly.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)
Prerequisites
@ -89,8 +89,6 @@ platforms:
- native_dyn
- native_mixed
- native_static
- win32_dyn
- win32_static
- android
- android_arm
- android_arm64
@ -101,11 +99,6 @@ platforms:
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.
If you want to compile `kiwix-tools` for win32 using static linkage:
```bash
kiwix-build --config win32_dyn
```
Android
-------

View File

@ -30500,17 +30500,17 @@ async function run() {
let archivePath;
try {
const archive_url = `${base_url}/dev_preview/${branch}/deps_${target}_${project}.tar.xz`;
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.xz`;
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, "x");
const archive_dir = await tc.extractTar(archivePath, extract_dir);
process.stdout.write("Extracted to " + archive_dir);
} catch (error) {
core.setFailed(error.message);

View File

@ -34,17 +34,17 @@ async function run() {
let archivePath;
try {
const archive_url = `${base_url}/dev_preview/${branch}/deps_${target}_${project}.tar.xz`;
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.xz`;
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, "x");
const archive_dir = await tc.extractTar(archivePath, extract_dir);
process.stdout.write("Extracted to " + archive_dir);
} catch (error) {
core.setFailed(error.message);

View File

@ -114,9 +114,9 @@
}
},
"node_modules/undici": {
"version": "5.28.2",
"resolved": "https://registry.npmjs.org/undici/-/undici-5.28.2.tgz",
"integrity": "sha512-wh1pHJHnUeQV5Xa8/kyQhO7WFa8M34l026L5P/+2TYiakvGy5Rdc8jWZVyG7ieht/0WgJLEd3kcU5gKx+6GC8w==",
"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"
},

View File

@ -1,69 +0,0 @@
image: Visual Studio 2019
version: '0.1.{build}'
environment:
EXTRA_DIR: 'C:\extra'
MINGW64_EXTRA_DIR: '/c/extra'
PATH: 'C:\\Python312\\Scripts;%PATH%;%EXTRA_DIR%\bin;C:\\Program Files (x86)\\Windows Kits\\10\\bin\\%platform%'
PKG_CONFIG_PATH: '%EXTRA_DIR%\lib\pkgconfig'
MSYS2_PATH_TYPE: 'inherit'
MSYS2_ARG_CONV_EXCL: '-Tp'
MINGW64_RUN: 'C:\msys64\usr\bin\bash.exe --login -c'
MSYSTEM: 'MINGW64'
KIWIX_DESKTOP_VERSION: '2.3.1-3'
KIWIX_DESKTOP_RELEASE: 0
init:
- cmd: |
echo %TEST_VAR%
REM Set VC 2019
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
mkdir C:\extra\bin
install:
- cmd: |
cd C:\projects
REM Install meson
C:\Python312\Scripts\pip install meson
REM Install ninja
curl -o ninja-win.zip -L https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-win.zip
7z e ninja-win.zip -o%EXTRA_DIR%\bin
REM Install pkg-config-lite
curl -o pkg-config-lite-0.28-1.zip -L https://deac-fra.dl.sourceforge.net/project/pkgconfiglite/0.28-1/pkg-config-lite-0.28-1_bin-win32.zip
7z e pkg-config-lite-0.28-1.zip -o%EXTRA_DIR%\bin pkg-config-lite-0.28-1/bin/pkg-config.exe
cd kiwix-build
REM Install openssh (scp) for deployement
choco install openssh openssl.light
- cmd: openssl enc -d -aes-256-cbc -md sha256 -pass pass:%ENC_PASSWD% -in appveyor\nightlybot_id_key.enc -out appveyor\nightlybot_id_key
build_script:
- IF "%USE_CACHE%" EQU "1" appveyor\setup_from_cache.cmd
- IF "%USE_CACHE%" NEQ "1" appveyor\install_zlib.cmd
- IF "%USE_CACHE%" NEQ "1" appveyor\install_lzma.cmd
- IF "%USE_CACHE%" NEQ "1" appveyor\install_zstd.cmd
- IF "%USE_CACHE%" NEQ "1" appveyor\install_libcurl.cmd
- IF "%USE_CACHE%" NEQ "1" appveyor\install_pthread.cmd
- IF "%USE_CACHE%" NEQ "1" appveyor\install_dirent.cmd
- IF "%USE_CACHE%" NEQ "1" appveyor\install_xapian.cmd
- IF "%USE_CACHE%" NEQ "1" appveyor\install_icu.cmd
- IF "%USE_CACHE%" NEQ "1" appveyor\install_pugixml.cmd
- IF "%USE_CACHE%" NEQ "1" appveyor\install_aria2.cmd
- IF "%USE_CACHE%" NEQ "1" appveyor\install_mustache.cmd
- IF "%USE_CACHE%" NEQ "1" appveyor\install_libmicrohttpd.cmd
- IF "%USE_CACHE%" NEQ "1" %MINGW64_RUN% "cd /c/projects/kiwix-build && appveyor/create_cache.sh"
- appveyor\install_libzim.cmd
- appveyor\install_libkiwix.cmd
- appveyor\install_kiwix-desktop.cmd
before_deploy:
- cmd: openssl enc -d -pbkdf2 -aes-256-cbc -md sha256 -pass pass:%win_certificate_secret% -in appveyor\kiwix.pfx.enc -out appveyor\kiwix.pfx
- cmd: '%MINGW64_RUN% "cd /c/projects/kiwix-build && appveyor/package_kiwix-desktop.sh"'
deploy_script:
- cmd: '%MINGW64_RUN% "cd /c/projects/kiwix-build && appveyor/deploy.sh"'

View File

@ -1,16 +0,0 @@
XAPIAN_SOURCE=$(pwd)/..
$XAPIAN_SOURCE/configure \
CC="cl -nologo" \
CXX="$XAPIAN_SOURCE/compile cl -nologo" \
CXXFLAGS="-EHsc -MD" AR=lib \
CPPFLAGS="-I${MINGW64_EXTRA_DIR}/include" \
LDFLAGS="-L${MINGW64_EXTRA_DIR}/lib" \
--disable-backend-remote \
--disable-documentation \
--prefix=${MINGW64_EXTRA_DIR}
make -j2
make install

View File

@ -1,11 +0,0 @@
set -e
ARCHIVE_NAME="deps_windows_windows.zip"
SSH_KEY=C:\\projects\\kiwix-build\\appveyor\\nightlybot_id_key
7z a -tzip $ARCHIVE_NAME $MINGW64_EXTRA_DIR
scp -P 30022 -vrp -i ${SSH_KEY} -o StrictHostKeyChecking=no \
${ARCHIVE_NAME} \
ci@tmp.kiwix.org:/data/tmp/ci

View File

@ -1,21 +0,0 @@
set -e
NIGHTLY_DATE=$(date +%Y-%m-%d)
NIGHTLY_KIWIX_ARCHIVES_DIR=/c/projects/NIGHTLY_KIWIX_ARCHIVES/${NIGHTLY_DATE}
RELEASE_KIWIX_ARCHIVES_DIR=/c/projects/RELEASE_KIWIX_ARCHIVES
SSH_KEY=C:\\projects\\kiwix-build\\appveyor\\nightlybot_id_key
if [[ "$APPVEYOR_SCHEDULED_BUILD" = "True" ]]
then
scp -P 30022 -vrp -i ${SSH_KEY} -o StrictHostKeyChecking=no \
${NIGHTLY_KIWIX_ARCHIVES_DIR} \
ci@master.download.kiwix.org:/data/download/nightly
fi
if [[ "$APPVEYOR_REPO_TAG" = "true" ]]
then
RELEASE_ARCHIVES=$(find $RELEASE_KIWIX_ARCHIVES_DIR -type f)
scp -P 30022 -vrp -i ${SSH_KEY} -o StrictHostKeyChecking=no \
${RELEASE_ARCHIVES} \
ci@master.download.kiwix.org:/data/download/release/kiwix-desktop
fi

View File

@ -1,29 +0,0 @@
import re, sys, os
makefile = sys.argv[-1]
print("Patching '{}'".format(makefile))
with open(makefile, 'r') as f:
lines = f.readlines()
with open(makefile, 'w') as f:
for line in lines:
# if "/SUBSYSTEM:WINDOWS" in line:
# line = line.replace("/SUBSYSTEM:WINDOWS", "/SUBSYSTEM:CONSOLE")
# f.write(line)
# continue
if not line.startswith('LIBS '):
f.write(line)
continue
print("-- INPUT : {}".format(line))
for lib in ('kiwix', 'zim', 'pugixml', 'z', 'zstd'):
line = line.replace('{}.lib'.format(lib), 'lib{}.a'.format(lib))
for lib in ('lzma', 'curl'):
line = line.replace('lib{}.lib'.format(lib), 'lib{}.a'.format(lib))
line = line.strip()
# line += " pthreadVC2.lib"
# line += " icuin.lib icudt.lib icuuc.lib"
line += " Rpcrt4.lib Ws2_32.lib winmm.lib Shlwapi.lib"
line += os.linesep
print("++ OUTPUT : {}".format(line))
f.write(line)

View File

@ -1,4 +0,0 @@
REM ========================================================
REM Install aria2
curl -fsSL -O https://github.com/aria2/aria2/releases/download/release-1.36.0/aria2-1.36.0-win-64bit-build1.zip || exit /b 1
7z e aria2-1.36.0-win-64bit-build1.zip -o%EXTRA_DIR% aria2-1.36.0-win-64bit-build1\aria2c.exe || exit /b 1

View File

@ -1,3 +0,0 @@
REM ========================================================
REM Install dirent.h
curl -fsSL -o%EXTRA_DIR%\include\dirent.h https://raw.githubusercontent.com/tronkko/dirent/master/include/dirent.h || exit /b 1

View File

@ -1,14 +0,0 @@
REM Set VC 2017
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
mkdir C:\extra\bin
cd C:\projects
C:\Python36\Scripts\pip install meson || exit /b 1
REM Set ninja
curl -fsSL -o ninja-win.zip https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-win.zip || exit /b 1
7z e ninja-win.zip -o%EXTRA_DIR%\bin || exit /b 1
REM Set pkg-config-lit
curl --insecure -fsSL -o pkg-config-lite-0.28-1.zip https://netix.dl.sourceforge.net/project/pkgconfiglite/0.28-1/pkg-config-lite-0.28-1_bin-win32.zip || exit /b 1
7z e pkg-config-lite-0.28-1.zip -o%EXTRA_DIR%\bin pkg-config-lite-0.28-1/bin/pkg-config.exe || exit /b 1
cd kiwix-build

View File

@ -1,7 +0,0 @@
REM ========================================================
REM Install icu
curl -SL -O http://public.kymeria.fr/KIWIX/windows/icu4c-62_1-Win64-MSVC2017.zip || exit /b 1
7z x icu4c-62_1-Win64-MSVC2017.zip -o%EXTRA_DIR% -r include || exit /b 1
7z e icu4c-62_1-Win64-MSVC2017.zip -o%EXTRA_DIR%\lib lib64\* || exit /b 1
7z e icu4c-62_1-Win64-MSVC2017.zip -o%EXTRA_DIR%\bin bin64\*.dll || exit /b 1
curl -fsSL -o%PKG_CONFIG_PATH%\icu-i18n.pc http://public.kymeria.fr/KIWIX/windows/icu-i18n.pc || exit /b 1

View File

@ -1,22 +0,0 @@
REM ========================================================
REM Install kiwix-desktop
git clone https://github.com/kiwix/kiwix-desktop || exit /b 1
cd kiwix-desktop
echo "Running qmake"
SET _WITH_CONSOLE=1
IF %KIWIX_DESKTOP_RELEASE% EQU 1 (
IF %APPVEYOR_REPO_TAG% == true (
SET _WITH_CONSOLE=0
)
)
IF %_WITH_CONSOLE% EQU 1 (
C:\Qt\5.15\msvc2019_64\bin\qmake.exe "CONFIG+=static console" || exit /b 1
) else (
C:\Qt\5.15\msvc2019_64\bin\qmake.exe "CONFIG+=static" || exit /b 1
)
echo "Running fix_desktop"
C:\Python312\Python ..\appveyor\fix_desktop_makefile.py Makefile.Release || exit /b 1
echo "Running nmake"
nmake || exit /b 1
cd ..

View File

@ -1,14 +0,0 @@
REM ========================================================
REM Install libcurl
curl -fsSL -O https://curl.haxx.se/download/curl-7.61.1.zip || exit /b 1
7z x curl-7.61.1.zip || exit /b 1
cd curl-7.61.1\winbuild
nmake /f Makefile.vc mode=static MACHINE=x64 DEBUG=no VC=15 ENABLE_IDN=no || exit /b 1
mkdir %EXTRA_DIR%\include\curl
copy ..\builds\libcurl-vc15-x64-release-static-ipv6-sspi-winssl\include\curl\*.h %EXTRA_DIR%\include\curl
copy ..\builds\libcurl-vc15-x64-release-static-ipv6-sspi-winssl\lib\libcurl_a.lib %EXTRA_DIR%\lib
move %EXTRA_DIR%\lib\libcurl_a.lib %EXTRA_DIR%\lib\libcurl.a
dir %EXTRA_DIR%\include\curl
dir %EXTRA_DIR%\lib
curl -fsSl -o%PKG_CONFIG_PATH%\libcurl.pc http://public.kymeria.fr/KIWIX/windows/libcurl.pc || exit /b 1
cd ..\..

View File

@ -1,10 +0,0 @@
REM ========================================================
REM Install libkiwix
git clone https://github.com/kiwix/libkiwix.git || exit /b 1
cd libkiwix
set CPPFLAGS="-I%EXTRA_DIR%/include"
meson . build --prefix %EXTRA_DIR% --default-library static --buildtype release || exit /b 1
cd build
ninja || exit /b 1
ninja install || exit /b 1
cd ..\..

View File

@ -1,11 +0,0 @@
REM ========================================================
REM Install libmicrohttpd
curl -fsSL -O https://ftpmirror.gnu.org/libmicrohttpd/libmicrohttpd-latest-w32-bin.zip || exit /b 1
7z e libmicrohttpd-latest-w32-bin.zip -o%EXTRA_DIR%/include libmicrohttpd-*-w32-bin/x86_64/VS2019/Release-static/microhttpd.h || exit /b 1
7z e libmicrohttpd-latest-w32-bin.zip -o%EXTRA_DIR%/lib libmicrohttpd-*-w32-bin/x86_64/VS2019/Release-static/libmicrohttpd.lib || exit /b 1
7z e libmicrohttpd-latest-w32-bin.zip -o%EXTRA_DIR%/lib/pkgconfig libmicrohttpd-*-w32-bin/x86_64/MinGW/static/mingw64/lib/pkgconfig/* || exit /b 1
rename %EXTRA_DIR%\lib\libmicrohttpd.lib microhttpd.lib
dir %EXTRA_DIR%
dir %EXTRA_DIR%\lib
dir %EXTRA_DIR%\lib\pkgconfig

View File

@ -1,9 +0,0 @@
REM ========================================================
REM Install libzim
git clone https://github.com/openzim/libzim.git || exit /b 1
cd libzim
meson . build --prefix %EXTRA_DIR% --default-library static --buildtype release || exit /b 1
cd build
ninja || exit /b 1
ninja install || exit /b 1
cd ..\..

View File

@ -1,6 +0,0 @@
REM ========================================================
REM Install lzma
curl -fsSL -O https://tukaani.org/xz/xz-5.2.4-windows.zip || exit /b 1
7z x xz-5.2.4-windows.zip -o%EXTRA_DIR% -r include || exit /b 1
7z e xz-5.2.4-windows.zip -o%EXTRA_DIR%\lib bin_x86-64\liblzma.a || exit /b 1
curl -fsSL -o%PKG_CONFIG_PATH%\liblzma.pc http://public.kymeria.fr/KIWIX/windows/liblzma.pc || exit /b 1

View File

@ -1,3 +0,0 @@
REM ========================================================
REM Install mustache.hpp
curl -fsSL -o%EXTRA_DIR%\include\mustache.hpp https://raw.githubusercontent.com/kainjow/mustache/v3.2.1/mustache.hpp || exit /b 1

View File

@ -1,14 +0,0 @@
REM ========================================================
REM Install pthread
curl -fsSL -O ftp://sourceware.org/pub/pthreads-win32/pthreads-w32-2-9-1-release.zip || exit /b 1
7z x pthreads-w32-2-9-1-release.zip -r pthreads.2 || exit /b 1
cd pthreads.2
REM Patch is pthread_timespec.patch
curl -fsSL -O http://public.kymeria.fr/KIWIX/windows/pthread.h || exit /b 1
nmake clean VC-inlined || exit /b 1
copy pthread.h %EXTRA_DIR%\include
copy sched.h %EXTRA_DIR%\include
copy pthreadVC2.lib %EXTRA_DIR%\lib
copy pthreadVC2.dll %EXTRA_DIR%\bin
curl -fsSL -o%PKG_CONFIG_PATH%\libpthreadVC2.pc http://public.kymeria.fr/KIWIX/windows/libpthreadVC2.pc || exit /b 1
cd ..

View File

@ -1,10 +0,0 @@
REM ========================================================
REM Install pugixml
curl -fsSL -O http://public.kymeria.fr/KIWIX/windows/pugixml-1.2-meson.zip || exit /b 1
7z x pugixml-1.2-meson.zip -o. || exit /b 1
cd pugixml-1.2-meson
meson . build --prefix %EXTRA_DIR% --default-library static --buildtype release || exit /b 1
cd build
ninja || exit /b 1
ninja install || exit /b 1
cd ..\..

View File

@ -1,9 +0,0 @@
REM ========================================================
REM Install xapian
curl -fsSL -O http://mirror.download.kiwix.org/dev/kiwix-build/xapian-core-1.4.18.zip || exit /b 1
7z x xapian-core-1.4.18.zip || exit /b 1
cd xapian-core-1.4.18
mkdir build
cd build
%MINGW64_RUN% "cd /c/Projects/kiwix-build/xapian-core-1.4.18/build && /c/Projects/kiwix-build/appveyor/build_xapian.sh" > build_xapian.log || exit /b 1
cd ..\..

View File

@ -1,10 +0,0 @@
REM ========================================================
REM Install zlib
curl -fsSL -O http://mirror.download.kiwix.org/dev/kiwix-build/zlib-1.2.12.meson.zip || exit /b 1
7z x zlib-1.2.12.meson.zip || exit /b 1
cd zlib-1.2.12
meson . build --prefix %EXTRA_DIR% --default-library static --buildtype release || exit /b 1
cd build
ninja || exit /b 1
ninja install || exit /b 1
cd ..\..

View File

@ -1,10 +0,0 @@
REM ========================================================
REM Install zstd
curl -fsSL -o zstd-v1.5.2.zip https://github.com/facebook/zstd/archive/refs/tags/v1.5.2.zip || exit /b 1
7z x zstd-v1.5.2.zip || exit /b 1
cd zstd-1.5.2/build/meson
meson . builddir --prefix %EXTRA_DIR% --default-library static --buildtype release -Dbin_programs=false -Dbin_contrib=false || exit /b 1
cd builddir
ninja || exit /b 1
ninja install || exit /b 1
cd ..\..\..\..

Binary file not shown.

Binary file not shown.

View File

@ -1,35 +0,0 @@
set -e
if [[ "$APPVEYOR_REPO_TAG" = "false" ]]
then
NIGHTLY_DATE=$(date +%Y-%m-%d)
KIWIX_ARCHIVES_DIR=/c/projects/NIGHTLY_KIWIX_ARCHIVES/${NIGHTLY_DATE}
KIWIX_DIR=kiwix-desktop_windows_x64_$NIGHTLY_DATE
else
if [ $KIWIX_DESKTOP_RELEASE -eq 1 ]
then
KIWIX_ARCHIVES_DIR=/c/projects/RELEASE_KIWIX_ARCHIVES
KIWIX_DIR=kiwix-desktop_windows_x64_${KIWIX_DESKTOP_VERSION}
fi
fi
if [[ "$KIWIX_DIR" ]]
then
KIWIX_ARCH_NAME=${KIWIX_DIR}.zip
mkdir $KIWIX_DIR
mkdir -p KIWIX_ARCHIVES_DIR
cp /c/projects/kiwix-build/kiwix-desktop/Release/kiwix-desktop.exe $KIWIX_DIR
/c/Qt/5.15/msvc2019_64/bin/windeployqt --compiler-runtime $KIWIX_DIR
cp $MINGW64_EXTRA_DIR/aria2c.exe $KIWIX_DIR
cp $MINGW64_EXTRA_DIR/bin/*.dll $KIWIX_DIR
cp /c/OpenSSL-v111-Win64/bin/libcrypto-1_1-x64.dll $KIWIX_DIR
cp /c/OpenSSL-v111-Win64/bin/libssl-1_1-x64.dll $KIWIX_DIR
signtool.exe sign -f appveyor/kiwix.pfx -p $win_certificate_password -t http://timestamp.digicert.com -d "Kiwix-desktop application" -fd SHA256 $KIWIX_DIR/kiwix-desktop.exe
7z a -tzip $KIWIX_ARCHIVES_DIR/$KIWIX_ARCH_NAME $KIWIX_DIR
fi

View File

@ -1,4 +0,0 @@
REM ========================================================
REM Setup from cache
curl -fsSL -O http://tmp.kiwix.org/ci/deps_windows_windows.zip || exit /b 1
7z x deps_windows_windows.zip -oc: -aoa || exit /b 1

View File

@ -30,9 +30,14 @@ class NeutralEnv:
self.mesontest_command = [*self.meson_command, "test"]
self.patch_command = self._detect_command("patch")
self.git_command = self._detect_command("git")
self.make_command = self._detect_command("make")
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)
self.qmake_command = self._detect_command(
"qmake", required=False, default=[["qmake"], ["qmake-qt5"]]
)
def detect_platform(self):
_platform = platform.system()

View File

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

View File

@ -35,10 +35,10 @@ class NativeDyn(NativeConfigInfo):
class NativeStatic(NativeConfigInfo):
name = "native_static"
static = True
compatible_hosts = ["fedora", "debian", "Darwin", "almalinux"]
compatible_hosts = ["fedora", "debian", "Darwin", "almalinux", "Windows"]
class NativeMixed(MixedMixin("native_static"), NativeConfigInfo):
name = "native_mixed"
static = False
compatible_hosts = ["fedora", "debian", "Darwin", "almalinux"]
compatible_hosts = ["fedora", "debian", "Darwin", "almalinux", "Windows"]

View File

@ -1,99 +0,0 @@
import subprocess
from .base import ConfigInfo
from kiwixbuild.utils import which, pj
from kiwixbuild._global import neutralEnv
class Win32ConfigInfo(ConfigInfo):
build = "win32"
compatible_hosts = ["fedora", "debian"]
arch_full = "i686-w64-mingw32"
extra_libs = ["-lwinmm", "-lshlwapi", "-lws2_32", "-lssp"]
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",
*(
"-I{}".format(include_dir)
for include_dir in self.get_include_dirs()
),
],
"host_machine": {
"system": "Windows",
"lsystem": "windows",
"cpu_family": "x86",
"cpu": "i686",
"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/i686-w64-mingw32/sys-root/mingw",
"debian": "/usr/i686-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):
yield 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 Win32Dyn(Win32ConfigInfo):
name = "win32_dyn"
static = False
class Win32Static(Win32ConfigInfo):
name = "win32_static"
static = True

View File

@ -1,6 +1,7 @@
from .base import *
from . import (
all_dependencies,
boostregex,
tc_android_ndk,
aria2,
tc_armhf,

View File

@ -13,32 +13,49 @@ class AllBaseDependencies(Dependency):
class Builder(NoopBuilder):
@classmethod
def get_dependencies(cls, configInfo, allDeps):
if neutralEnv("distname") == "Windows":
return ["zlib", "zstd", "icu4c", "zim-testing-suite"]
if configInfo.build == "wasm" or environ.get("OS_NAME") == "manylinux":
return ["zlib", "lzma", "zstd", "icu4c", "xapian-core"]
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"]
if configInfo.build != "win32":
# zimwriterfs
base_deps += ["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"]
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

@ -1,27 +1,53 @@
from .base import Dependency, ReleaseDownload, MakeBuilder
from .base import Dependency, ReleaseDownload, MakeBuilder, NoopBuilder
from kiwixbuild.utils import Remotefile, run_command
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"
class Source(ReleaseDownload):
archive = Remotefile(
"aria2-1.37.0.tar.xz",
"60a420ad7085eb616cb6e2bdf0a7206d68ff3d37fb5a956dc44242eb2f79b66b",
"https://github.com/aria2/aria2/releases/download/release-1.37.0/aria2-1.37.0.tar.xz",
)
if platform.system() == "Windows":
def _post_prepare_script(self, context):
context.try_skip(self.extract_path)
command = ["autoreconf", "-i"]
run_command(command, self.extract_path, context)
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(MakeBuilder):
dependencies = ["zlib"]
configure_options = [
"--disable-libaria2",
"--disable-websocket",
"--without-sqlite3",
]
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

@ -2,6 +2,7 @@ import subprocess
import os
import shutil
import time
import platform
from kiwixbuild.utils import (
pj,
@ -323,8 +324,8 @@ class Builder:
module["subdir"] = self.subsource_dir
if getattr(self, "flatpack_build_options", None):
module["build-options"] = self.flatpack_build_options
if getattr(self, "configure_option", ""):
module["config-opts"] = self.configure_option.split(" ")
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(
@ -379,7 +380,7 @@ class MakeBuilder(Builder):
configure_options = []
dynamic_configure_options = ["--enable-shared", "--disable-static"]
static_configure_options = ["--enable-static", "--disable-shared"]
make_options = []
make_options = ["-j4"]
install_options = []
configure_script = "configure"
configure_env = {
@ -435,7 +436,6 @@ class MakeBuilder(Builder):
command = [
*self.buildEnv.make_wrapper,
*neutralEnv("make_command"),
"-j4",
*self.make_targets,
*self.make_options,
]
@ -492,6 +492,12 @@ 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:
@ -502,7 +508,7 @@ class QMakeBuilder(MakeBuilder):
def _configure(self, context):
context.try_skip(self.build_path)
command = [
"qmake",
*neutralEnv("qmake_command"),
*self.configure_options,
*self.env_options,
self.source_path,
@ -518,8 +524,8 @@ class QMakeBuilder(MakeBuilder):
*neutralEnv("git_command"),
"archive",
"-o",
f"{self.build_path}/{self.target_full_name()}.tar.gz",
f"--prefix={self.target_full_name()}/",
f"{self.build_path}/{self.target.full_name()}.tar.gz",
f"--prefix={self.target.full_name()}/",
"HEAD",
]
run_command(command, self.source_path, context)
@ -532,6 +538,9 @@ class MesonBuilder(Builder):
@property
def build_type(self):
if platform.system() == "Windows":
return "release"
return "release" if option("make_release") else "debug"
@property

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

@ -1,16 +1,34 @@
from .base import Dependency, GitClone, CMakeBuilder
from .base import Dependency, ReleaseDownload, MesonBuilder
from kiwixbuild.utils import Remotefile
from kiwixbuild._global import neutralEnv
class docoptcpp(Dependency):
name = "docoptcpp"
class Source(GitClone):
git_remote = "https://github.com/docopt/docopt.cpp.git"
git_dir = "docopt.cpp"
force_full_clone = True
git_ref = "3dd23e3280f213bacefdf5fcb04857bf52e90917"
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",
)
class Builder(CMakeBuilder):
make_install_targets = ["install"]
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

@ -1,4 +1,9 @@
from .base import Dependency, ReleaseDownload, MakeBuilder, MesonBuilder
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
@ -6,71 +11,138 @@ import os, shutil
import fileinput
import platform
if platform.system() == "Windows":
class Icu(Dependency):
name = "icu4c"
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",
)
meson_patch = Remotefile(
"icu_73.2-2_patch.zip",
"218a5f20b58b6b2372e636c2eb2d611a898fdc11be17d6c4f35a3cd54d472010",
"https://wrapdb.mesonbuild.com/v2/icu_73.2-2/get_patch",
)
archives = [archive_src, archive_data, meson_patch]
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",
)
extract_archive(
pj(neutralEnv("archive_dir"), self.meson_patch.name),
neutralEnv("source_dir"),
topdir="icu",
name=self.source_dir,
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",
)
patches = [
"icu4c_fix_static_lib_name_mingw.patch",
"icu4c_rpath.patch",
"icu4c_wasm.patch",
]
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)
if platform.system() == "Windows":
class Builder(MesonBuilder):
def set_env(self, env):
env["ICU_DATA_FILTER_FILE"] = pj(
os.path.dirname(os.path.realpath(__file__)),
"icu4c_data_filter.json",
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"),
)
else:
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"

View File

@ -1,4 +1,6 @@
from kiwixbuild._global import option
from .base import Dependency, GitClone, QMakeBuilder
import platform
class KiwixDesktop(Dependency):
@ -11,18 +13,27 @@ class KiwixDesktop(Dependency):
class Builder(QMakeBuilder):
dependencies = ["qt", "qtwebengine", "libkiwix", "aria2"]
make_install_targets = ["install"]
configure_env = None
flatpack_build_options = {"env": ["QMAKEPATH=/app/lib"]}
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 "QMAKE_INCDIR+=/app/include/QtWebEngine"
yield "QMAKE_INCDIR+=/app/include/QtWebEngineCore"
yield "QMAKE_INCDIR+=/app/include/QtWebEngineWidgets"
else:
if self.buildEnv.configInfo.name != "flatpak":
yield f"PREFIX={self.buildEnv.install_dir}"
if self.buildEnv.configInfo.static:
yield "CONFIG+=static"

View File

@ -10,7 +10,7 @@ class KiwixTools(Dependency):
git_dir = "kiwix-tools"
class Builder(MesonBuilder):
dependencies = ["libkiwix"]
dependencies = ["libkiwix", "docoptcpp"]
@property
def configure_options(self):

View File

@ -3,7 +3,7 @@ import os
from .base import (
Dependency,
ReleaseDownload,
MakeBuilder,
MesonBuilder,
)
from kiwixbuild.utils import Remotefile, pj, Defaultdict, SkipCommand, run_command
@ -15,44 +15,47 @@ class LibCurl(Dependency):
class Source(ReleaseDownload):
name = "libcurl"
archive = Remotefile(
"curl-7.67.0.tar.xz",
"f5d2e7320379338c3952dcc7566a140abb49edb575f9f99272455785c40e536c",
"https://curl.haxx.se/download/curl-7.67.0.tar.xz",
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(MakeBuilder):
class Builder(MesonBuilder):
dependencies = ["zlib"]
configure_options = [
*[
f"--without-{p}"
for p in (
"libssh2",
"ssl",
"libmetalink",
"librtmp",
"nghttp2",
"libidn2",
"brotli",
)
],
*[
f"--disable-{p}"
for p in (
"ftp",
"file",
"ldap",
"ldaps",
"rtsp",
"dict",
"telnet",
"tftp",
"pop3",
"imap",
"smb",
"smtp",
"gopher",
"manual",
)
],
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

@ -1,4 +1,4 @@
from .base import Dependency, ReleaseDownload, MakeBuilder
from .base import Dependency, ReleaseDownload, MesonBuilder
from kiwixbuild.utils import Remotefile
@ -7,17 +7,27 @@ class MicroHttpd(Dependency):
name = "libmicrohttpd"
class Source(ReleaseDownload):
archive = Remotefile(
src_archive = Remotefile(
"libmicrohttpd-0.9.76.tar.gz",
"f0b1547b5a42a6c0f724e8e1c1cb5ce9c4c35fb495e7d780b9930d35011ceb4c",
"https://ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-0.9.76.tar.gz",
)
class Builder(MakeBuilder):
configure_options = [
"--disable-https",
"--without-libgcrypt",
"--without-libcurl",
"--disable-doc",
"--disable-examples",
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

@ -23,7 +23,7 @@ class Libzim(Dependency):
@classmethod
def get_dependencies(cls, configInfo, allDeps):
if neutralEnv("distname") == "Windows":
return ["zstd", "icu4c", "zim-testing-suite"]
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")
@ -33,7 +33,7 @@ class Libzim(Dependency):
def configure_options(self):
configInfo = self.buildEnv.configInfo
if neutralEnv("distname") == "Windows":
yield "-Dwith_xapian=false"
yield "-Dwith_xapian_fuller=false"
yield "-Dwerror=false"
if configInfo.build == "android":
yield "-DUSE_BUFFER_HEADER=false"

View File

@ -15,5 +15,4 @@ class Pugixml(Dependency):
flatpak_dest = "src"
class Builder(MesonBuilder):
build_type = "release"
strip_options = []

View File

@ -1,87 +1,25 @@
import shutil
from .base import Dependency, ReleaseDownload, MakeBuilder, QMakeBuilder
from .base import Dependency, NoopBuilder, NoopSource
from kiwixbuild.utils import Remotefile, pj, SkipCommand
from kiwixbuild.utils import SkipCommand, colorize
class Qt(Dependency):
name = "qt"
class Source(ReleaseDownload):
name = "qt"
source_dir = "qt-5.10.1"
archive = Remotefile(
"qt-everywhere-src-5.10.1.tar.xz",
"",
"http://ftp.oregonstate.edu/.1/blfs/conglomeration/qt5/qt-everywhere-src-5.10.1.tar.xz",
)
Source = NoopSource
class Builder(MakeBuilder):
dependencies = ["icu4c", "zlib"]
dynamic_configure_options = ["-shared"]
static_configure_options = ["-static"]
@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),
)
@property
def configure_options(self):
skip_modules = [
"qt3d",
"qtcanvas3d",
"qtcharts",
"qtconnectivity",
"qtdatavis3d",
# 'qtdeclarative',
"qtdoc",
"qtgamepad",
"qtgraphicaleffects",
"qtlocation",
"qtmultimedia",
"qtnetworkauth",
"qtpurchasing",
# 'qtquickcontrols',
"qtquickcontrols2",
"qtremoteobjects",
"qtscript",
"qtscxml",
"qtsensors",
"qtserialbus",
"qtserialport",
"qtspeech",
"qtvirtualkeyboard",
"qtwayland",
"qtwebglplugin",
"qtwebsockets",
# 'qtwebview',
]
yield "-recheck"
yield "-opensource"
yield "-confirm-license"
yield "-ccache"
yield from ("-make", "libs")
for module in skip_modules:
yield from ("-skip", module)
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 = Qt.Source
Source = NoopSource
class Builder(QMakeBuilder):
dependencies = ["qt"]
subsource_dir = "qtwebengine"
Builder = Qt.Builder

View File

@ -24,6 +24,10 @@ class android_ndk(Dependency):
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):

View File

@ -9,9 +9,6 @@ base_url = (
)
aarch_base_url = "https://master.dl.sourceforge.net/project/raspberry-pi-cross-compilers/Bonus%20Raspberry%20Pi%20GCC%2064-Bit%20Toolchains/Raspberry%20Pi%20GCC%2064-Bit%20Cross-Compiler%20Toolchains/Stretch/GCC%206.3.0/"
class armv6_toolchain(Dependency):
dont_skip = True
neutral = True
@ -53,7 +50,6 @@ class aarch64_toolchain(Dependency):
archive = Remotefile(
"cross-gcc-6.3.0-pi_64.tar.gz",
"1b048bb8886ad63d21797cd9129fc37b9ea0dfaac7e3c36f888aa16fbec1d320",
aarch_base_url + "cross-gcc-6.3.0-pi_64.tar.gz",
)
Builder = TcCopyBuilder

View File

@ -1,38 +1,55 @@
from .base import Dependency, ReleaseDownload, MakeBuilder
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"
class Source(ReleaseDownload):
archive = Remotefile(
"xapian-core-1.4.23.tar.xz",
"30d3518172084f310dab86d262b512718a7f9a13635aaa1a188e61dc26b2288c",
)
if platform.system() == "Windows":
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} -O3 -I{buildEnv.install_dir}/include",
}
class Source(GitClone):
git_remote = "https://github.com/openzim/xapian-meson.git"
git_dir = "xapian-core"
@classmethod
def get_dependencies(cls, configInfo, allDeps):
if neutralEnv("distname") == "Windows":
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"]
deps = ["zlib", "lzma"]
if (
configInfo.build in ("win32", "wasm")
or neutralEnv("distname") == "Darwin"
):
return deps
return deps + ["uuid"]
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

@ -9,9 +9,9 @@ class ZimTestingSuite(Dependency):
class Source(ReleaseDownload):
archive = Remotefile(
"zim-testing-suite-0.6.0.tar.gz",
"5aa91349a2791c862217b4d2ddd002f08589146ec047f10d5fa1f5fd85d0ea92",
"https://github.com/openzim/zim-testing-suite/releases/download/0.6.0/zim-testing-suite-0.6.0.tar.gz",
"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

@ -1,4 +1,5 @@
from .base import Dependency, GitClone, MesonBuilder
from kiwixbuild._global import neutralEnv
class ZimTools(Dependency):
@ -13,14 +14,14 @@ class ZimTools(Dependency):
@classmethod
def get_dependencies(cls, configInfo, allDeps):
base_deps = ["libzim", "docoptcpp", "mustache"]
if configInfo.build != "win32":
if neutralEnv("distname") != "Windows":
base_deps += ["libmagic", "gumbo"]
return base_deps
@property
def configure_options(self):
# We don't build zimwriterfs on win32, and so we don't have magic
if self.buildEnv.configInfo.build != "win32":
# 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

@ -37,19 +37,19 @@ MANIFEST = {
"runtime": "org.kde.Platform",
"runtime-version": base_deps_versions["org.kde"],
"base": "io.qt.qtwebengine.BaseApp",
"base-version": base_deps_versions[
"org.kde"
], # keep BaseApp (qwebengine) in sync with org.kde
"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=x11",
"--socket=fallback-x11",
"--socket=pulseaudio",
"--share=network",
"--share=ipc",
"--device=dri",
"--socket=pulseaudio",
"--filesystem=host:ro",
],
"cleanup": [
"/include",
@ -69,6 +69,7 @@ MANIFEST = {
"/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}"
@ -158,14 +159,16 @@ class FlatpakBuilder:
module["no-autogen"] = True
module_sources = module.setdefault("sources", [])
if isinstance(source, ReleaseDownload):
src = {
"type": "archive",
"sha256": source.archive.sha256,
"url": source.archive.url,
}
if hasattr(source, "flatpak_dest"):
src["dest"] = source.flatpak_dest
module_sources.append(src)
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",
@ -297,7 +300,7 @@ class FlatpakBuilder:
tlc = Dependency.all_deps[tlcName]
builderDef = (cfgName, tlcName)
builder = get_target_step(builderDef)
print("build {} ({}):".format(builder.name, cfgName[0]))
print("build {} ({}):".format(builder.name, cfgName))
add_target_step(builderDef, builder)
builder.build()
print("[GENERATE FLATPAK MANIFEST]")

View File

@ -50,7 +50,7 @@ PACKAGE_NAME_MAPPERS = {
},
"fedora_native_static": {
"COMMON": _fedora_common + ["glibc-static", "libstdc++-static"],
"lzma": ["xz-devel", "xz-static"]
"lzma": ["xz-devel", "xz-static"],
# Either there is no packages, or no static or too old
},
"fedora_i586_dyn": {
@ -59,33 +59,6 @@ PACKAGE_NAME_MAPPERS = {
"fedora_i586_static": {
"COMMON": _fedora_common + ["glibc-devel.i686"],
},
"fedora_win32_dyn": {
"COMMON": _fedora_common
+ [
"mingw32-gcc-c++",
"mingw32-bzip2",
"mingw32-win-iconv",
"mingw32-winpthreads",
"wine",
],
"zlib": ["mingw32-zlib"],
"lzma": ["mingw32-xz-libs"],
"libmicrohttpd": ["mingw32-libmicrohttpd"],
},
"fedora_win32_static": {
"COMMON": _fedora_common
+ [
"mingw32-gcc-c++",
"mingw32-bzip2-static",
"mingw32-win-iconv-static",
"mingw32-winpthreads-static",
"wine",
],
"zlib": ["mingw32-zlib-static"],
"lzma": ["mingw32-xz-libs-static"],
"libmicrohttpd": None, # ['mingw32-libmicrohttpd-static'] packaging dependecy seems buggy, and some static lib are name libfoo.dll.a and
# gcc cannot found them.
},
"fedora_armhf_static": {"COMMON": _fedora_common},
"fedora_armhf_dyn": {"COMMON": _fedora_common},
"fedora_android": {"COMMON": _fedora_common},
@ -109,24 +82,6 @@ PACKAGE_NAME_MAPPERS = {
"COMMON": _debian_common
+ ["libc6-dev-i386", "lib32stdc++6", "gcc-multilib", "g++-multilib"],
},
"debian_win32_dyn": {
"COMMON": _debian_common
+ [
"g++-mingw-w64-i686",
"gcc-mingw-w64-i686",
"gcc-mingw-w64-base",
"mingw-w64-tools",
],
},
"debian_win32_static": {
"COMMON": _debian_common
+ [
"g++-mingw-w64-i686",
"gcc-mingw-w64-i686",
"gcc-mingw-w64-base",
"mingw-w64-tools",
],
},
"debian_armhf_static": {
"COMMON": _debian_common,
},

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,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

@ -28,7 +28,7 @@ COLORS = {
}
REMOTE_PREFIX = "http://mirror.download.kiwix.org/dev/kiwix-build/"
REMOTE_PREFIX = "https://dev.kiwix.org/kiwix-build/"
def which(name):

View File

@ -1,11 +1,11 @@
# This file reference all the versions of the depedencies we use in kiwix-build.
main_project_versions = {
"libzim": "9.2.2",
"libkiwix": "13.1.0",
"libzim": "9.3.0",
"libkiwix": "14.0.0",
"kiwix-tools": "3.7.0",
"zim-tools": "3.4.1",
"kiwix-desktop": "2.3.1", # Also change KIWIX_DESKTOP_VERSION and KIWIX_DESKTOP_RELEASE in appveyor.yml
"zim-tools": "3.6.0",
"kiwix-desktop": "2.4.1",
}
# This dictionnary specify what we need to build at each release process.
@ -22,24 +22,18 @@ main_project_versions = {
# `(was ...)`.
# - Else, increment the value. If no value was present, see `(was ...)`.
# For kiwix-desktop, if this is not None:
# - set KIWIX_DESKTOP_RELEASE to 1
# - set KIWIX_DESKTOP_VERSION to the version of the release (including release_versions)
# If this is None:
# - set KIWIX_DESKTOP_RELEASE to 0
release_versions = {
"libzim": None, # Depends of base deps (was 0)
"libkiwix": 4, # Depends of libzim (was 3)
"libzim": 1, # Depends of base deps (was 0)
"libkiwix": None, # Depends of libzim (was 1)
"kiwix-tools": None, # Depends of libkiwix and libzim (was 2)
"zim-tools": None, # Depends of libzim (was 0)
"kiwix-desktop": None, # Depends of libkiwix and libzim (was 4)
"zim-tools": 0, # Depends of libzim (was None)
"kiwix-desktop": None, # Depends of libkiwix and libzim (was 0)
}
# This is the "version" of the whole base_deps_versions dict.
# Change this when you change base_deps_versions.
base_deps_meta_version = "01"
base_deps_meta_version = "12"
base_deps_versions = {
"zlib": "1.2.12",
@ -47,7 +41,7 @@ base_deps_versions = {
"zstd": "1.5.2",
"docoptcpp": "0.6.2",
"uuid": "1.43.4",
"xapian-core": "1.4.23",
"xapian-core": "1.4.26",
"mustache": "4.1",
"pugixml": "1.2",
"libmicrohttpd": "0.9.76",
@ -56,10 +50,8 @@ base_deps_versions = {
"libaria2": "1.37.0",
"libmagic": "5.44",
"android-ndk": "r21e",
"qt": "5.10.1",
"qtwebengine": "5.10.1",
"org.kde": "5.15-21.08",
"io.qt.qtwebengine": "5.15-21.08",
"zim-testing-suite": "0.6.0",
"org.kde": "6.7",
"io.qt.qtwebengine": "6.7",
"zim-testing-suite": "0.8.0",
"emsdk": "3.1.41",
}

View File

@ -14,98 +14,33 @@ fi
ICONFILE=$SOURCEDIR/resources/icons/kiwix/scalable/kiwix-desktop.svg
DESKTOPFILE=$SOURCEDIR/resources/org.kiwix.desktop.desktop
# Create structure
mkdir -p $APPDIR/usr/{bin,lib,share} $APPDIR/usr/share/applications $APPDIR/usr/share/icons/hicolor/48x48/apps
# Copy our files
cp $INSTALLDIR/bin/kiwix-desktop $APPDIR/usr/bin/
cp $INSTALLDIR/$SYSTEMLIBDIR/*.so* $APPDIR/usr/lib
# Remove it as it break with linuxdeployqt (should we compile without it) ?
rm -f $APPDIR/usr/lib/libmagic.so*
# Copy nss lib (to not conflict with host's ones)
cp -a /usr/$SYSTEMLIBDIR/nss $APPDIR/usr/lib
# Copy libthai.so (see kiwix-desktop issue#1016)
cp -a /usr/$SYSTEMLIBDIR/libthai.so* $APPDIR/usr/lib
# Copy ssl libs so that the appimage runs on newer systems
# that use a backward incompatible version of openssl
cp /usr/$SYSTEMLIBDIR/lib{crypto,ssl}.so.1.1 $APPDIR/usr/lib
patch_rodata()
{
local elffile=$1
local sedscript=$2
local rodatafile=$elffile.rodata
objcopy --dump-section .rodata="$rodatafile" "$elffile"
sed -i "$sedscript" "$rodatafile"
objcopy --update-section .rodata="$rodatafile" "$elffile"
rm $rodatafile
}
# copy and patch a couple of libs depending on ssl functionalty before
# linuxdeployqt copies and modifies them whereupon the patch_rodata procedure
# stops working on them correctly
cp -rL /usr/$SYSTEMLIBDIR/{libgnutls.so.30,libQt5Network.so.5} $APPDIR/usr/lib
# patch libQt5Network.so so that if it fails to load certificates from
# system paths the last path that it tries points to the certificate bundle
# included with the appimage
# !!! crt_bundle_new_path must have the same length as crt_bundle_old_path
crt_bundle_old_path=/usr/local/share/certs/ca-root-nss.crt
crt_bundle_new_path=/tmp/cert_bundle_provided_by_kiwix.crt
# !!! crt_bundle_new_path must have the same length as crt_bundle_old_path
libQtNetworkPatchingSedScript="s|$crt_bundle_old_path|$crt_bundle_new_path|"
patch_rodata $APPDIR/usr/lib/libQt5Network.so.5 "$libQtNetworkPatchingSedScript"
cp $ICONFILE $APPDIR/usr/share/icons/hicolor/48x48/apps/kiwix-desktop.svg
mkdir -p $APPDIR/usr/share/applications
cp $DESKTOPFILE $APPDIR/usr/share/applications/kiwix-desktop.desktop
# get the aria2
wget --continue https://github.com/q3aql/aria2-static-builds/releases/download/v1.36.0/aria2-1.36.0-linux-gnu-64bit-build1.tar.bz2
mkdir -p $APPDIR/usr/bin/ && tar -C $APPDIR/usr/bin/ -xf aria2-1.36.0-linux-gnu-64bit-build1.tar.bz2 aria2-1.36.0-linux-gnu-64bit-build1/aria2c --strip-components=1
mkdir -p $APPDIR/etc/ssl/certs/ && tar -C $APPDIR/etc/ssl/certs/ -xf aria2-1.36.0-linux-gnu-64bit-build1.tar.bz2 aria2-1.36.0-linux-gnu-64bit-build1/ca-certificates.crt --strip-components=1
# Get linuxdeployqt
# Dispite the 'continuous' in the file name, it IS release 8
wget --continue https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage -O linuxdeployqt
chmod u+x linuxdeployqt
# Get linuxdeploy
wget --continue https://github.com/linuxdeploy/linuxdeploy/releases/download/1-alpha-20240109-1/linuxdeploy-x86_64.AppImage
chmod u+x linuxdeploy-x86_64.AppImage
wget --continue https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/1-alpha-20240109-1/linuxdeploy-plugin-qt-x86_64.AppImage
chmod u+x linuxdeploy-plugin-qt-x86_64.AppImage
# Fill with all deps libs and so
./linuxdeployqt $APPDIR/usr/bin/kiwix-desktop -bundle-non-qt-libs -extra-plugins=imageformats,iconengines
LD_LIBRARY_PATH=$INSTALLDIR/lib/x86_64-linux-gnu ./linuxdeploy-x86_64.AppImage \
--plugin=qt \
--appdir="$APPDIR" \
--executable=$INSTALLDIR/bin/kiwix-desktop \
--desktop-file=$DESKTOPFILE \
--icon-file=$ICONFILE \
--library=/usr/lib/x86_64-linux-gnu/libthai.so.0 \
# Get the aria2c (https://github.com/abcfy2/aria2-static-build/releases/download/1.37.0/aria2-x86_64-linux-musl_libressl_static.zip)
wget --continue https://dev.kiwix.org/kiwix-desktop/aria2-1.37.0-x86_64-linux-musl_libressl_static.zip
mkdir -p $APPDIR/usr/bin/ && unzip aria2-1.37.0-x86_64-linux-musl_libressl_static.zip -d $APPDIR/usr/bin/
# Copy the CA trustore from the hosting system
mkdir -p $APPDIR/etc/ssl/certs/ && cp /etc/ssl/certs/ca-certificates.crt $APPDIR/etc/ssl/certs/
# Fix the RPATH of QtWebEngineProcess [TODO] Fill a issue ?
patchelf --set-rpath '$ORIGIN/../lib' $APPDIR/usr/libexec/QtWebEngineProcess
cp $DESKTOPFILE $APPDIR/kiwix-desktop.desktop
cp $ICONFILE $APPDIR/
cp $ICONFILE $APPDIR/.DirIcon
rm "$APPDIR"/AppRun
cat > "$APPDIR"/AppRun <<'END'
#!/usr/bin/env bash
mydir=$(dirname "$0")
mydir=$(cd "$mydir" && pwd)
crt_path=??? # this is set by postprocessing via sed
if [ ! -e "$crt_path" ]
then
ln -s "$mydir"/etc/ssl/certs/ca-certificates.crt "$crt_path"
trap "rm '$crt_path'" EXIT
fi
"$mydir"/usr/bin/kiwix-desktop "$@"
END
sed -i "s#^crt_path=.*#crt_path=$crt_bundle_new_path#" "$APPDIR"/AppRun
chmod 0755 "$APPDIR"/AppRun
mv $APPDIR/{AppRun.wrapped,kiwix-desktop}
sed -i 's/AppRun\.wrapped/kiwix-desktop/g' $APPDIR/AppRun
wget --continue https://github.com/AppImage/AppImageKit/releases/download/13/appimagetool-x86_64.AppImage
chmod u+x appimagetool-x86_64.AppImage

View File

@ -0,0 +1,77 @@
#!/usr/bin/env python3
import sys, subprocess, shutil, argparse, os
from pathlib import Path
parser = argparse.ArgumentParser()
parser.add_argument("install_dir")
parser.add_argument("out_dir")
parser.add_argument("--static_dir")
parser.add_argument("archive_path", help="The full path of the archive to create")
parser.add_argument("-s", "--sign", action="store_true")
args = parser.parse_args()
install_dir = Path(args.install_dir)
if args.static_dir:
static_dir = Path(args.static_dir)
else:
static_dir = install_dir
out_dir = Path(args.out_dir)
archive_path = Path(args.archive_path)
out_dir.mkdir(parents=True, exist_ok=True)
print(
f"""Packaging kiwix-desktop
- From {install_dir}
- Static dir is {static_dir}
- Working dir {out_dir}
- Archive path is {archive_path}
- Python version {sys.version}"""
)
shutil.copy2(install_dir / "bin" / "kiwix-desktop.exe", out_dir)
subprocess.run(["windeployqt", "--compiler-runtime", str(out_dir)], check=True)
shutil.copy2(static_dir / "bin" / "aria2c.exe", out_dir)
for dll in (static_dir / "bin").glob("*.dll"):
shutil.copy2(dll, out_dir)
# Copy ssl stuff
ssl_directory = Path("C:/") / "Program Files" / "OpenSSL"
shutil.copy2(ssl_directory / "libcrypto-1_1-x64.dll", out_dir)
shutil.copy2(ssl_directory / "libssl-1_1-x64.dll", out_dir)
if args.sign:
# 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(out_dir / "kiwix-desktop.exe"),
]
subprocess.run(command, check=True)
print(
f"""Create archive
- {archive_path.with_suffix('')}
- From {out_dir.parent}
- With {out_dir.name}"""
)
shutil.make_archive(
archive_path.with_suffix(""), "zip", root_dir=out_dir, base_dir=""
)

View File

@ -1,83 +0,0 @@
#!/usr/bin/env python3
import os, sys
import json
import requests
bintray_auth = (os.environ['BINTRAY_USER'], os.environ['BINTRAY_PASS'])
def create_version(version):
url = "https://api.bintray.com/packages/kiwix/kiwix/kiwixlib/versions"
payload = {
'name': version,
'desc': 'Release of libkiwix'
}
headers = {
'Content-Type': 'application/json'
}
r = requests.post(url, data=json.dumps(payload), headers=headers, auth=bintray_auth)
rcode = r.status_code
if rcode == 409:
print("Bintray version %s already exists, skipping." % version)
return True
rcode_family = rcode // 100
if rcode_family in (2, 3):
print("Bintray Version created!")
return True
print("ERROR : Bintray API response {}".format(rcode))
return False
def upload(version, filepath, artefact):
url_template = "https://api.bintray.com/content/kiwix/kiwix/kiwixlib/{version}/org/kiwix/kiwixlib/kiwixlib/{version}/{artefact}"
parameters = {
'publish': 1,
'override': 1
}
# Upload the main artefact
url = url_template.format(version=version, artefact=artefact)
with open(filepath, 'rb') as f:
r = requests.put(url, data=f, auth=bintray_auth, params=parameters)
rcode = r.status_code
rcode_family = rcode // 100
if rcode_family not in (2, 3):
print("ERROR: Fail to upload artefact")
print(r.text)
return False
return True
def upload_from_json(json_path):
basedir = os.path.dirname(json_path)
with open(str(json_path)) as f:
options = json.load(f)
if not create_version(options['version']):
raise RuntimeError("Cannot create version")
for file_ in options['files']:
path = os.path.join(basedir, file_)
if not upload(options['version'], path, file_):
raise RuntimeError("Cannot upload file {}".format(file_))
if __name__ == "__main__":
try:
info_file = sys.argv[1]
except IndexError:
print("Usage {} infofile".format(sys.argv[0]))
sys.exit(-1)
print("Use info file {}".format(info_file))
try:
upload_from_json(info_file)
except RuntimeError as e:
sys.exit(str(e))