The previous patch was overly complex and finally wrong.
We should simply use `@XAPIAN_LIBS` as `Libs.private`.
Next release of xapian will integrate this
(https://trac.xapian.org/ticket/751), but for now, we still a patch
on our side.
To run unit-test (meson) on cross-compilation, we need a wrapper to run
the binary (wine, qemu, ...), but:
- We have no emulator for android (we have one for the system, but we can't
simply run a binary)
- With dynamic compilation, it seems pretty complex to configure them
correctly.
- For mingw32 compilation, `wine` need to be correctly configured to
find dll from the system mingw32 installation.
It seems that shutil.copytree on travis fails to copy symlinks to
directory. It is probably due to last travis changes.
Let's keep the symlinks as they are.
I don't know why, but the travis build doesn't work since few days.
It seems that pip3 cannot install in `/usr/local` anymore.
Probably related to last travis change* as a lot of people seems to have
problem with this update and python (even if this is not the same problems)
Anyway, we should not install a dependencies in global environment without
a sudo. Let's install the pip3 dependencies for the user only.
[*] https://docs.travis-ci.com/user/build-environment-updates/2017-09-06/
If the user what to make a custom_app locally, he will need to download
the zim file before. As he has already the zim, it is better to give
the zim_path instead of give the zim_url and have `build_custom_app.py`
download a second time the zim.
Not all target platform can be compiled on all platform.
For instance, all `static` target or `win32`, `armhf` and `android` targets
cannot be compiled on macOS.
Simply check that the current host is supported by TargetInfo and exit
nicely if needed.
As we are compiling `ctpp2c` in static native and install it with a simple
`cp`, the default compilation of ctpp2 library should not install ctpp2c.
Else we would have a wrong `ctpp2c` in the path and later compilation will
fail.
We are using `ctpp2c` when building kiwix-lib to compile embedded resources.
As `ctpp2c` will be used in the host machine, it always need to be
compiled for the host (native).
But we still want tho ctpp2 library compiled for the target platform.
As we don't want handle the conflict between two dynamic lib with the same
name but for two different platforms, we build ctpp2c statically.
"PIE" option is for executable and we don't build a executable.
Using a combination of "pie", "pic", shared and static libraries makes the
compilation of `kiwix-lib` fails with a "undefined symbol main".
Removing the pie option solve the problem.
The `cross_path_only` option used in `cmake` and `meson` builder where
mainly here to avoid kiwix-build to set the env with `CC` and `CXX`
variable set.
This is needed as `cmake` and `meson` will find the correct compiler
from the cross-config file.
However, even for them, we need to set some environment variables
(especially PKG_CONFIG_LIBDIR)
So we need another level a configuration to be able to set a cross_env
without setting the compiler's env variables.