Update README

This commit is contained in:
Emmanuel Engelhart 2018-06-21 10:48:39 +02:00 committed by Kelson
parent 0c26b08dce
commit a66b178633
1 changed files with 59 additions and 35 deletions

100
README.md
View File

@ -38,6 +38,7 @@ libraries need to be available:
* Xapian ......................................... https://xapian.org/ * Xapian ......................................... https://xapian.org/
(package libxapian-dev on Ubuntu) (package libxapian-dev on Ubuntu)
* libaria2 .................................. https://aria2.github.io/ * libaria2 .................................. https://aria2.github.io/
(no package on Ubuntu)
These dependencies may or may not be packaged by your operating These dependencies may or may not be packaged by your operating
system. They may also be packaged but only in an older version. The system. They may also be packaged but only in an older version. The
@ -52,28 +53,76 @@ If you compile ctpp2 from source and want to compile the Kiwix library
statically then you will probably need to rename ctpp2 static library statically then you will probably need to rename ctpp2 static library
from ctpp2-st.a to ctpp2.a. from ctpp2-st.a to ctpp2.a.
Environnement Environment
------------- -------------
The Kiwix library builds using [Meson](http://mesonbuild.com/) version The Kiwix library builds using [Meson](http://mesonbuild.com/) version
0.34 or higher. Meson relies itself on Ninja, pkg-config and few other 0.39 or higher. Meson relies itself on Ninja, pkg-config and few other
compilation tools. compilation tools.
Install first the few common compilation tools: Install first the few common compilation tools:
* Automake * Meson
* Libtool * Ninja
* Virtualenv
* Pkg-config * Pkg-config
Then install Meson itself: These tools should be packaged if you use a cutting edge operating
system. If not, have a look to the "Troubleshooting" section.
Compilation
-----------
Once all dependencies are installed, you can compile the Kiwix library
with:
```
meson . build
ninja -C build
```
By default, it will compile dynamic linked libraries. All binary files
will be created in the "build" directory created automatically by
Meson. If you want statically linked libraries, you can add
`--default-library=static` option to the Meson command.
Depending of you system, `ninja` may be called `ninja-build`.
Installation
------------
If you want to install the Kiwix library and the headers you just have
compiled on your system, here we go:
```
ninja -C build install
```
You might need to run the command as root (or using 'sudo'), depending
where you want to install the libraries. After the installation
succeeded, you may need to run ldconfig (as root).
Uninstallation
------------
If you want to uninstall the Kiwix library:
```
ninja -C build uninstall
```
Like for the installation, you might need to run the command as root
(or using 'sudo').
Troubleshooting
---------------
If you need to install Meson "manually":
``` ```
virtualenv -p python3 ./ # Create virtualenv virtualenv -p python3 ./ # Create virtualenv
source bin/activate # Activate the virtualenv source bin/activate # Activate the virtualenv
pip3 install meson # Install Meson pip3 install meson # Install Meson
hash -r # Refresh bash paths hash -r # Refresh bash paths
``` ```
Finally download and build Ninja locally: If you need to install Ninja "manually":
``` ```
git clone git://github.com/ninja-build/ninja.git git clone git://github.com/ninja-build/ninja.git
cd ninja cd ninja
@ -84,36 +133,11 @@ cp ninja ../bin
cd .. cd ..
``` ```
Compilation If the compilation still fails, you might need to get a more recent
----------- version of a dependency than the one packaged by your Linux
distribution. Try then with a source tarball distributed by the
Once all dependencies are installed, you can compile kiwix-lib with: problematic upstream project or even directly from the source code
``` repository.
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.
Depending of you system, `ninja` may be called `ninja-build`.
Installation
------------
If you want to install the libraries you just have compiled on your
system, here we go:
```
ninja install
cd ..
```
You might need to run the command as root, depending where you want to
install the libraries.
License License
------- -------