libaria2 needs a lot of dependencies to handle all protocol.
So this is a basic compilation of libaria2 :
No tls(https), no metalink and no bit-torrent.
If specified, kiwix-build will not "make/install" the target but make
the dist archive (source).
It will build dependencies, as the make dist will try to compile and test
the target.
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.
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.
"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.
Those option should be set by build system, not by kiwix-build.
Moreover, this impact other libraries (as icu) and generate pretty big
library binaries.
The custom app to build must be specified as an option when running
kiwix-build.
In the same way, the zim file to download must be specified in the
`info.json` (`zim_url` key) or given as option.
Cmake use the 'Windows' name to detect we are building to Windows but
meson use the lowered 'windows' string.
So we need to lower the system declared in the cross-env when generating
the meson cross_file.
The target (`platform_info.build`) is not enough to get a correct
cross_env. For android apk, the target is always "android" but we want
different cross_env depending of the target arch.
The `platform_info` already know for which arch we are building so
let's make platform_info generate the cross_env directly.
Travis fails if we try to build a lot of targets in the same job because
of quota limit. By removing intermediate build files, we limit our disk
usage.
Previous script (from kiwix repository) created a APK with all architecture embeded.
Now, we generated a APK per architecture. It simplify the build process and
generate smaller APKs.
By limiting the choices in the argument parser, we catch argument error
at parsing and we can provide useful output (the names of dependencies
we can handle) to user in the help or in the error message.
'properties' is too close of the meson definition and we need to duplicate
the entries for 'c_link_args' and 'cpp_link_args'.
By using 'extra_libs' we have a more functional definition of what we want.