Kiwix & openZIM build engine
Go to file
Matthieu Gautier d4b2642eed Update README to compile kiwix-lib-app. 2019-12-05 12:32:13 +01:00
.github Create FUNDING.yml 2019-06-22 07:56:57 +02:00
appveyor Release Kiwix Desktop 2.0 rc4 2019-11-26 11:15:28 +01:00
kiwixbuild Remove support of kiwix-android and kiwix-custom-app. 2019-12-05 12:30:10 +01:00
scripts Use version 6 of linuxdeployqt instead of continuous. 2019-09-26 16:15:19 +02:00
travis Remove support of kiwix-android and kiwix-custom-app. 2019-12-05 12:30:10 +01:00
.gitignore Add a lot of common things to ignore to .gitignore 2017-08-14 09:57:00 -04:00
.travis.yml Use fedora 30 to cross compile kiwix-tools. 2019-09-06 12:25:51 +02:00
LICENSE Add a LICENSE file 2017-01-04 23:41:14 +01:00
MANIFEST.in Move ios cross file templates in the right directory. 2018-04-24 14:57:23 +02:00
README.md Update README to compile kiwix-lib-app. 2019-12-05 12:32:13 +01:00
appveyor.yml Release Kiwix Desktop 2.0 rc4 2019-11-26 11:15:28 +01:00
build_custom_app.pl Remove android mips platforms 2019-06-14 14:13:18 +02:00
build_custom_app.py New tmp.kiwix.org server 2018-11-07 03:51:13 +01:00
kiwix-deploy.py Save nightlies at the right place #11 2017-02-26 21:39:58 +01:00
requirements_build_custom_app.txt Update Python request to 2.20.0 2018-12-15 13:44:30 +01:00
setup.py Workaround for mesonbuild/meson#5097 2019-03-19 10:33:47 +01:00

README.md

Build status: Build Status

Kiwix is an offline reader for web content. It's especially thought to make Wikipedia available offline. This is done by reading the content of the project stored in a file format ZIM, a high compressed open format with additional meta-data.

This repository contains advanced tools to (cross-)compile easily Kiwix softwares and library and deploy them. They have been tested on Fedora 23 and Ubuntu 16.10.

Prerequesites

You will need a recent version of meson (0.34) and ninja (1.6) If your distribution provides a recent enough versions for them, just install them with your package manager. Continue to read the instructions otherwise.

Before anything else you need to install Python3 related tools. On Debian based systems:

sudo apt-get install python3-pip virtualenv

Create a virtual environment to install python module in it instead of modifying the system.

virtualenv -p python3 ./ # Create virtualenv
source bin/activate      # Activate the virtualenv

Then, download and install kiwix-build and its dependencies:

git clone https://github.com/kiwix/kiwix-build.git
cd kiwix-build
pip install .
hash -r                  # Refresh bash paths

If your distribution doesn't provide ninja version > 1.6 you can get it this way :

wget https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-linux.zip
unzip ninja-linux.zip ninja -d $HOME/bin

Compilation

The compilation is handled by the kiwix-build command. It will compile everything. If you are using a supported platform (Redhat or Debian based) it will install missing packages using sudo. You can get kiwix-build usage like this:

kiwix-build --help

Target

You may want to compile a specific target so you will have to specify it on the command line :

kiwix-build kiwix-lib # will build kiwix-build and its dependencies
kiwix-build zim-tools # will build zim-tools and its dependencies

By default, kiwix-build will build kiwix-tools .

Target platform

If no target platform is specified, a default one will be infered from the specified target :

  • kiwix-lib-app will be build using the platform android
  • Other targets will be build using the platform native_dyn

But you can select another target platform using the option --target-platform. For now, there is ten different supported platforms :

  • native_dyn
  • native_static
  • win32_dyn
  • win32_static
  • android
  • android_arm
  • android_arm64
  • android_x86
  • android_x86_64

So, if you want to compile kiwix-tools for win32 using static linkage:

kiwix-build --target-platform win32_dyn

Android

kiwix-android (https://github.com/kiwix/kiwix-android) depends of the kiwix-lib project. It uses a special .aar file that represent (and embed) the kiwix-lib for all supported android arch. This is a kind of fat archive we have for MacOs.

The .aar file is build using the kiwix-lib-app project. kiwix-lib-app itself is architecture independent (it is just a packaging of other archives) but it use kiwix-lib who is architecture dependent.

When building kiwix-lib, you should directly use the target-platform android_<arch>:

kiwix-build kiwix-lib --target-platform android_arm

But, kiwix-lib-app is mainly multi arch. To compile kiwix-lib-app, you must use the android platform:

$ kiwix-build --target-platform android kiwix-lib-app
$ kiwix-build kiwix-lib-app # because `android` platform is the default for `kiwix-lib-app`

By default, when using platform android, kiwix-lib will be build for all architectures. This can be changed by using the option --android-arch :

$ kiwix-build kiwix-lib-app # aar with all architectures
$ kiwix-build kiwix-lib-app --android-arch arm # aar with arm architecture
$ kiwix-build kiwix-lib-app --android-arch arm --android-arch arm64 # aan with arm and arm64 architectures

To build kiwix-android itself, you should see the documentation of kiwix-android.

IOS

When building for ios, we may want to compile a "fat library", a library for several architectures.

To do so, you should directly use the target-platfrom ios_multi. As for android, kiwix-build will build the library several times (once for each platform) and then create the fat library.

kiwix-build --target-platform iOS_multi kiwix-lib

You can specify the supported architectures with the option --ios-arch:

kiwix-build --target-platform iOS_multi kiwix-lib # all architetures
kiwix-build --target-platform iOS_multi --ios-arch arm --ios-arch arm64 # arm and arm64 arch only

Outputs

Kiwix-build.py will create several directories:

  • ARCHIVES: All the downloaded archives go there.
  • SOURCES: All the sources (extracted from archives and patched) go there.
  • BUILD_<target_platform>: All the build files go there.
  • BUILD_<target_platform>/INSTALL: The installed files go there.
  • BUILD_<target_platform>/LOGS: The logs files of the build.

If you want to install all those directories elsewhere, you can pass the --working-dir option to kiwix-build: