Code Monkey home page Code Monkey logo

kiwix-build's Introduction

Kiwix Build

Kiwix Build provides advanced tools to (cross-)compile easily Kiwix & openZIM softwares and libraries and deploy them. They have been tested on Fedora 35+ & Ubuntu 20.04+.

Kiwix Build audience is:

  • Advanced users who don't want/can handle all the dependencies compilations manually
  • Kiwix developer team for its own CI/CD

CI Build Status CD Build Status License: GPL v3

Prerequisites

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
pip3 install .
hash -r # Refresh bash paths

Compilation

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

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 libkiwix # will build kiwix-build and its dependencies
kiwix-build kiwix-desktop # will build kiwix-desktop and its dependencies
kiwix-build zim-tools # will build zim-tools and its dependencies

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

To see the whole list of available targets run with non existing target, ex:

kiwix-build not-existing-target
...
invalid choice: 'not-existing-target' (choose from 'alldependencies', 'android-ndk',
...

Config

If no config is specified, the default will be native_dyn.

You can select another config using the option --config. For now, there is ten different supported platforms:

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

All native_* config means using the native compiler without any cross-compilation option. Other may simply use cross-compilation or may download a specific toolchain to use.

If you want to compile kiwix-tools for win32 using static linkage:

kiwix-build --config win32_dyn

Android

kiwix-android (https://github.com/kiwix/kiwix-android) depends of the libkiwix project.

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

kiwix-build libkiwix --config android_arm

You may directly use the special config android which will build different android architectures

kiwix-build --config android libkiwix

By default, it will build for all android architecture, you can limit this with option --android-arch:

kiwix-build libkiwix --config android --android-arch arm # aar with arm architecture
kiwix-build libkiwix --config android --android-arch arm --android-arch arm64 # aan with arm and arm64 architectures

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

iOS

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

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

kiwix-build --config iOS_multi libkiwix

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

kiwix-build --config iOS_multi libkiwix # all architetures
kiwix-build --config iOS_multi --ios-arch arm --ios-arch arm64 # arm and arm64 arch only

Outputs

Kiwix-build.py will create several directories:

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

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

Troubleshooting

If you need to install Meson "manually":

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

If you need to install Ninja "manually":

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

License

GPLv3 or later, see LICENSE for more details.

kiwix-build's People

Contributors

mgautierfr avatar kelson42 avatar rgaudin avatar automactic avatar veloman-yunkan avatar mhutti1 avatar miguelrocha avatar asashnov avatar jetownfeve21 avatar julianharty avatar jhbiggs avatar szymonpajzert avatar technologyclassroom avatar birros avatar probonopd avatar soloturn avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.