ICU seems to be buggy when generating pkg_config file if we compile static
and shared libs with mingw target.
As icu mingw target definition seems a bit complex it is simpler to just
compile the libs we want.
As side effect, it reduces compilation time a bit.
When cross-compiling, icu need to be build two times :
- Once in 'native' mode.
- Once cross-compiling.
This is needed as the cross-compiling need to launch executable that are
build in the first step.
Icu dependency become a bit more complex as the second compilation needs to
reference the first compilation and that configure options and buildEnv
change.
- No more target_arch but a more generic build-target.
- The buildEnv can now have custom options depending of the target.
Mixins will use those options.
We now specify the working directory instead of the install directory.
So all created files/directories will be under the the working directory.
By default, working dir is the current one.
The ninja command may relaunch meson if meson files have changed.
As we need a proper environment (PKG_CONFIG_PATH, PATH) to let meson
configure properly, we also need to pass the environment to ninja.
zimlib doesn't use github but gerrit to handle changes.
As this patches to review, there is no meson branche for now.
Use a personal fork for now. As soon as the meson scripts have been
integrated in openzim repository, we should revert this commit.
Ubuntu on 64 bits install lib in lib/x86_64-linux-gnu and meson correctly
detect this.
Thus it install libs (zimlib, kiwix) in this directory. However we
look for pkgconfig files in $INTALL_DIR/lib64. And so, the lib is not
found.
We could force meson to install in $INSTALL_DIR/lib64 all the time but
it is just better to follow the correct convention on Ubuntu.
Reuse the algorithm used in meson to correctly detect the libprefix,
use it and force all build script (autotools, cmake, meson) to install there.
In the same way, ninja may be called ninja-build depending of the distribution.
Or depending of how meson is installed, we may have to launch meson or meson.py.
So we detect the command to launch to try to be as most as possible portable.
This script download and compile all depedencies and subproject for
kiwix-tools.
Ideally it should be as simple as run the script with the install dir as
argument.
This script compile a dynamic or a static build of kiwix-tools (kiwix-serve)
This as been tested on Fedora.