mirror of https://github.com/kiwix/libkiwix.git
More simple/robus README
This commit is contained in:
parent
25a55acdae
commit
d2c3eeb337
|
@ -1,112 +0,0 @@
|
|||
Howto build kiwix-lib on Ubuntu 16.04 (LTS)
|
||||
===========================================
|
||||
|
||||
Some dependencies packaged on Ubuntu 16.04 are too old or don't provide
|
||||
pkg-config files.
|
||||
|
||||
The [kiwix-build](https://github.com/kiwix/kiwix-build) script takes care of
|
||||
downloading, compiling and installing all the dependencies and kiwix-* projects.
|
||||
We recommend you to use this script.
|
||||
|
||||
If you still want to compile yourself kiwix-lib... here we go !
|
||||
|
||||
This script describe step by step how to compile kiwix-lib on a fresh
|
||||
Ubuntu 16.04 system.
|
||||
|
||||
# Install needed packages
|
||||
|
||||
```
|
||||
sudo apt install uuid-dev libicu-dev libctpp2-dev automake libtool
|
||||
```
|
||||
|
||||
# Prepare the environment
|
||||
|
||||
We will install all our custom dependencies in a separated directory to avoid
|
||||
polluting the system.
|
||||
|
||||
```
|
||||
KIWIX_DIR=</some/dir>
|
||||
mkdir $KIWIX_DIR
|
||||
virtualenv -p python3 $KIWIX_DIR
|
||||
# Activate the virtualenv
|
||||
source $KIWIX_DIR/bin/activate
|
||||
# The virtualenv can be deactivated at anytime with
|
||||
deactivate
|
||||
```
|
||||
|
||||
## Libzim
|
||||
|
||||
```
|
||||
git clone https://gerrit.wikimedia.org/r/p/openzim.git
|
||||
cd openzim/zimlib
|
||||
./autoconf.sh
|
||||
./configure --prefix=$KIWIX_DIR
|
||||
make
|
||||
make install
|
||||
```
|
||||
|
||||
## libpugixml
|
||||
|
||||
```
|
||||
wget http://github.com/zeux/pugixml/releases/download/v1.8/pugixml-1.8.tar.gz && tar xf pugixml-1.8.tar.gz
|
||||
cd pugixml-1.8
|
||||
cmake -DCMAKE_INSTALL_PREFIX=$KIWIX_DIR -DBUILD_PKGCONFIG=1 -DBUILD_SHARED_LIBS=1
|
||||
make
|
||||
make install
|
||||
```
|
||||
|
||||
## Xapian
|
||||
|
||||
The libxapian provided by ubuntu package is too old and do not have the GLASS_BACKEND we use.
|
||||
So we need to compile our own xapian version:
|
||||
|
||||
```
|
||||
wget http://download.kiwix.org/dev/xapian-core-1.4.0.tar.xz && tar xf xapian-core-1.4.0.tar.xz
|
||||
cd xapian-core-1.4.0
|
||||
./configure --enable-shared --enable-static --disable-sse --disable-backend-inmemory --disable-documentation --prefix=$KIWIX_DIR
|
||||
make
|
||||
make install
|
||||
```
|
||||
|
||||
## meson
|
||||
|
||||
Meson is a python package, just install it with pip.
|
||||
(Be sure you are using the virtualenv created before)
|
||||
|
||||
```
|
||||
pip install meson
|
||||
hash -r # let's bash renew its hashes and use the meson we've just installed
|
||||
```
|
||||
|
||||
## ninja
|
||||
|
||||
```
|
||||
git clone git://github.com/ninja-build/ninja.git && cd ninja
|
||||
git checkout release
|
||||
./configure.py --bootstrap
|
||||
cp ninja $KIWIX_DIR/bin
|
||||
```
|
||||
|
||||
The virtualenv automatically add the $KIWIX_DIR/bin in PATH, so there
|
||||
is nothing more to do.
|
||||
|
||||
|
||||
# Compile kiwix-lib
|
||||
|
||||
|
||||
Then, it's time to compile kiwix-lib :
|
||||
|
||||
```
|
||||
$ cd kiwix-lib
|
||||
$ mkdir build
|
||||
$ PKG_CONFIG_PATH=~/KIWIX/lib/pkgconfig meson . build --prefix=$KIWIX_DIR
|
||||
$ cd build
|
||||
$ ninja
|
||||
$ ninja install
|
||||
```
|
||||
|
||||
By default, it will compile dynamic linked libraries.
|
||||
If you want statically linked libraries, you can add `--default-library=static`
|
||||
option to the meson command.
|
||||
|
||||
Licensed as GPLv3 or later, see COPYING for more details.
|
135
README.md
135
README.md
|
@ -1,53 +1,116 @@
|
|||
libkiwix
|
||||
========
|
||||
Kiwix library
|
||||
=============
|
||||
|
||||
libkiwix contains the common code base for all kiwix ports.
|
||||
The Kiwix library provides the Kiwix software core. It contains the
|
||||
code shared by all Kiwix ports (Windows, Linux, OSX, Android, ...).
|
||||
|
||||
Build kiwix-lib
|
||||
---------------
|
||||
Disclaimer
|
||||
----------
|
||||
|
||||
This document assumes you have a little knowledge about software
|
||||
compilation. If you experience difficulties with the dependencies or
|
||||
with the Kiwix libary compilation itself, we recommend to have a look
|
||||
to [kiwix-build](https://github.com/kiwix/kiwix-build).
|
||||
|
||||
Most of the compilation steps (including download and
|
||||
compilation of dependencies and other tools (kiwix-tools)) are handle
|
||||
by [kiwix-build](https://github.com/kiwix/kiwix-build) script.
|
||||
If you don't have any special need, we recommend you to use kiwix-build
|
||||
instead of doing all the steps yourself.
|
||||
Preamble
|
||||
--------
|
||||
|
||||
Dependencies:
|
||||
Although the Kiwix library can be compiled/cross-compiled on/for many
|
||||
sytems, the following documentation explains how to do it on POSIX
|
||||
ones. It is primarly though for GNU/Linux systems and has been tested
|
||||
on recent releases of Ubuntu and Fedora.
|
||||
|
||||
You'll need the following dependencies to build libkiwix:
|
||||
Dependencies
|
||||
------------
|
||||
|
||||
* icu
|
||||
* libzim
|
||||
* pugixml
|
||||
* ctpp2
|
||||
* xapian (optional) (>=1.4)
|
||||
* meson build system (>=0.34)(and so, ninja, pkg-config, ...)
|
||||
The Kiwix library relies on many third parts software libraries. They
|
||||
are prerequisites to the Kiwix library compilation. Following
|
||||
libraries need to be available:
|
||||
|
||||
* ICU ................................... http://site.icu-project.org/
|
||||
** Package libicu-dev on Ubuntu
|
||||
|
||||
* ZIM ........................................ http://www.openzim.org/
|
||||
** Packge libzim-dev on Ubuntu
|
||||
|
||||
* Pugixml ........................................ http://pugixml.org/
|
||||
** Package libpugixml-dev on Ubuntu
|
||||
|
||||
* ctpp2 ........................................ http://ctpp.havoc.ru/
|
||||
** Package libctpp2-dev on Ubuntu
|
||||
|
||||
* Xapian ......................................... https://xapian.org/
|
||||
** Package libxapian-dev on Ubuntu
|
||||
|
||||
These dependencies may or may not be packaged by your operating
|
||||
system. They may also be packaged but only in an older version. The
|
||||
compilation script will tell you if one of them is missing or too old.
|
||||
In the worse case, you will have to download and compile bleeding edge
|
||||
version by hand.
|
||||
|
||||
Environnement
|
||||
-------------
|
||||
|
||||
The Kiwix library builds using [Meson](http://mesonbuild.com/) version
|
||||
0.34 or higher. Meson relies itself on Ninja, pkg-config and few other
|
||||
compilation tools.
|
||||
|
||||
Install first the few common compilation tools:
|
||||
* Automake
|
||||
* Libtool
|
||||
* Virtualenv
|
||||
|
||||
Then install Meson itself:
|
||||
```
|
||||
virtualenv -p python3 ./ # Create virtualenv
|
||||
source bin/activate # Activate the virtualenv
|
||||
pip install meson # Install Meson
|
||||
hash -r # Refresh bash paths
|
||||
```
|
||||
|
||||
Finally download and build Ninja 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
|
||||
-----------
|
||||
|
||||
Once all dependencies are installed, you can compile kiwix-lib with:
|
||||
|
||||
```
|
||||
$ cd kiwix-lib
|
||||
$ mkdir build
|
||||
$ meson . build
|
||||
$ cd build
|
||||
$ ninja
|
||||
$ ninja install
|
||||
mkdir build
|
||||
meson . build
|
||||
cd build
|
||||
ninja
|
||||
```
|
||||
|
||||
By default, it will compile dynamic linked libraries.
|
||||
If you want statically linked libraries, you can add `--default-library=static`
|
||||
option to the meson command.
|
||||
By default, it will compile dynamic linked libraries. If you want
|
||||
statically linked libraries, you can add `--default-library=static`
|
||||
option to the Meson command.
|
||||
|
||||
(You may need to set PKG_CONFIG_PATH before running meson depending of where
|
||||
and how you've install dependencies)
|
||||
(Depending of you system, `ninja` may be called `ninja-build`)
|
||||
Depending of you system, `ninja` may be called `ninja-build`.
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
Howto build kiwix-lib on Ubuntu 16.04 (LTS)
|
||||
-------------------------------------------
|
||||
If you want to install the libraries you just have compiled on your
|
||||
system, here we go:
|
||||
|
||||
If you want to compile yourself kiwix-lib see the specific readme to
|
||||
[compile kiwix-lib on Ubuntu 16.04](COMPILE_ubuntu-16.04.md).
|
||||
```
|
||||
ninja install
|
||||
cd ..
|
||||
```
|
||||
|
||||
Licensed as GPLv3 or later, see COPYING for more details.
|
||||
You might need to run the command as root, depending where you want to
|
||||
install the libraries.
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
GPLv3 or later, see COPYING for more details.
|
||||
|
|
Loading…
Reference in New Issue