We have to loop over the dependencies and their packages to know which
dependency we may skip.
So we must not skip the install_packages step too early.
Now that meson.build script add itself the needed link flags to link
static binaries, we don't need to add them by ourself.
Just pass the right option to meson.
By installing distribution packages we avoid us a lot of recompilation.
It also made use standard build, and it's just better :)
We also install all needed packages automatically so user has less work
to do.
Only Fedora packages are listed for now.
Ubuntu packages have to be done.
Duplicate sources must be detected from their classes.
So add a optional arguments key_function to remove_duplicates to use
a custom key to compare elems and use it to remove duplicate sources
using their classes.
By resolving a dependency graph, we avoid us to have a fixed list of
dependencies. This is even more usefull because now, we don't have to track
different dependencies lists dependending of the build_target.
The wrapper provided by Fedora properly configure cmake for
cross-compiling.
We have to check how this work with other distribution or other
cross-compilation target but for now, it's working.
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.