Common code base for all Kiwix ports
Go to file
Steve Wills 4f57e765e5
Fix type error in build
Compilation fails on clang 3.4.1 (and presumably later, tho I haven't tested) with

```
src/reader.cpp:131:59: error: no viable conversion from 'iterator' (aka '__map_iterator<typename __base::iterator>') to 'std::map<std::string, unsigned int>::const_iterator' (aka '__map_const_iterator<typename __base::const_iterator>')
      std::map<std::string, unsigned int>::const_iterator it = counterMap.find("text/html");
                                                          ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/v1/map:713:29: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'iterator' (aka '__map_iterator<typename __base::iterator>') to 'const std::__1::__map_const_iterator<std::__1::__tree_const_iterator<std::__1::__value_type<std::__1::basic_string<char>, unsigned int>, std::__1::__tree_node<std::__1::__value_type<std::__1::basic_string<char>, unsigned int>, void *> *, long> > &' for 1st argument
class _LIBCPP_TYPE_VIS_ONLY __map_const_iterator
                            ^
```

because we are not using the right type for the map iterator. As we are using
C++11, let's use `auto` and make compiler set the right type for us.
2017-06-16 08:47:59 -04:00
include Re-add xapian searcher in kiwix-lib. 2017-05-24 16:08:00 +02:00
scripts Use correct include in generated resource file. 2017-01-24 15:36:01 +01:00
src Fix type error in build 2017-06-16 08:47:59 -04:00
static Add a new script to compile resources. 2016-12-23 13:06:12 +01:00
travis Get dependencies from http server, not from ssh. 2017-04-24 17:10:41 +02:00
.travis.yml Get dependencies from http server, not from ssh. 2017-04-24 17:10:41 +02:00
COPYING + GPL license 2016-12-31 09:29:53 +01:00
README.md Fix typo in the README 2017-02-06 20:52:47 +01:00
kiwix.pc.in Make use of ctpp2 optional. 2017-02-22 12:05:44 +01:00
meson.build Re-add xapian searcher in kiwix-lib. 2017-05-24 16:08:00 +02:00
meson_options.txt [ANDROID] Deactivate some features if we are compiling for android. 2017-02-22 16:56:21 +01:00

README.md

Kiwix library

The Kiwix library provides the Kiwix software core. It contains the code shared by all Kiwix ports (Windows, Linux, OSX, Android, ...).

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.

Preamble

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.

Dependencies

The Kiwix library relies on many third parts software libraries. They are prerequisites to the Kiwix library compilation. Following libraries need to be available:

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.

If you want to install these dependencies locally, then use the kiwix-lib directory as install prefix.

If you compile ctpp2 from source and want to compile the Kiwix library statically then you will probably need to rename ctpp2 static library from ctpp2-st.a to ctpp2.a.

Environnement

The Kiwix library builds using Meson 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
  • Pkg-config

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:

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

GPLv3 or later, see COPYING for more details.