Kiwix & openZIM build engine
Go to file
Matthieu Gautier 4997017be2 Run meson test when possible.
To run unit-test (meson) on cross-compilation, we need a wrapper to run
the binary (wine, qemu, ...), but:

- We have no emulator for android (we have one for the system, but we can't
  simply run a binary)
- With dynamic compilation, it seems pretty complex to configure them
  correctly.
- For mingw32 compilation, `wine` need to be correctly configured to
  find dll from the system mingw32 installation.
2017-10-02 16:05:06 +02:00
patches [CTPP2] CMake should not install ctpp2c. 2017-07-17 10:34:17 +02:00
templates Run meson test when possible. 2017-10-02 16:05:06 +02:00
travis Fix installation of meson and pillow (pip3) in travis. 2017-09-11 11:13:45 +02:00
.gitignore Add a lot of common things to ignore to .gitignore 2017-08-14 09:57:00 -04:00
.travis.yml Enable build cache for gradle. 2017-09-04 10:49:37 +02:00
LICENSE Add a LICENSE file 2017-01-04 23:41:14 +01:00
README.md Improved README #3 2017-07-17 12:42:58 +02:00
build_custom_app.py [CUSTOM_APP] Small fixes of help of options. 2017-07-18 15:57:13 +02:00
dependencies.py Keep the symlinks. 2017-09-11 13:24:29 +02:00
dependency_utils.py Run meson test when possible. 2017-10-02 16:05:06 +02:00
kiwix-build.py Run meson test when possible. 2017-10-02 16:05:06 +02:00
kiwix-deploy.py Save nightlies at the right place #11 2017-02-26 21:39:58 +01:00
requirements_build_custom_app.txt Add script to build customapp 2017-06-25 15:49:49 +02:00
utils.py Add script to build customapp 2017-06-25 15:49:49 +02: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

Then install Meson:

virtualenv -p python3 ./ # Create virtualenv
source bin/activate      # Activate the virtualenv
pip3 install meson       # Install Meson
hash -r                  # Refresh bash paths

Finally we need the Ninja tool (available in the $PATH). Here is a solution to download, build and install it locally:

git clone git://github.com/ninja-build/ninja.git
cd ninja
git checkout release
./configure.py --bootstrap
mkdir ../bin
cp ninja ../bin
cd ..

Compilation

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

./kiwix-build.py -h

Target

By default, kiwix-build.py will build kiwix-tools. If you want to compile another target only (let's said kiwixlib), you can specify it:

./kiwix-build Kiwixlib

Target platform

By default, kiwix-build.py will build everything for the current (native) platform using dynamic linkage (hence the native_dyn of the BUILD_native_dyn directory).

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

  • native_dyn
  • native_static
  • win32_dyn
  • win32_static
  • android_arm
  • android_arm64
  • android_mips
  • android_mips64
  • android_x86
  • android_x86_64

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

./kiwix-build.py --target-platform win32_dyn

Outputs

Kiwix-build.py will create several directories:

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

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