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.
On android platform, we load the ICU data as external data, not embeded
in the kiwix-lib.
So we need to generate correctly the dat file and use it in kiwix-android.
We don't need all the ICU data and we need to reduce binaries' size
(Especially for android where we have a limit of 50Mo per APK).
By removing unwanted ICU data, we reduce a lot the data size and so
the final binaries' size.
There is also some "problems" to compile the `ja.txt` collfiles,
the "resource compiler" crashes.
As we don't need it, we also remove it.
ICU doesn't provide data sources in their release archives but directly
pre-compiled data.
As we need to compile ourselves our data to remove unwanted data, we need
to get the sources directly from the SVN.
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.
It seems that last meson version (0.40.0) do not pass cross compilation
extra_args to compiler when checking for headers.
Thus, the kiwix-lib check for ctpp2 headers fails because the WIN32
define is not present. So kiwix-lib is compiled without CTPP2 but
kiwix-tool compile as if kiwix-lib where compile with CTPP2 and fails.
By making CTPP2 headers check for `__WINGW32__` we workaround this problem.
I don't know if this is a bug in meson, ctpp2 or kiwix-lib but this small
fix allow to compile correctly with last meson version.
We may end in a deadlock if we publish dependencies archives at the end
of the compilation and if all compilation succeed.
For example project B may depend on project A.
If we change the project A API and the project B code to reflect the API
change and merge A' API in master and create a PR for B, the PR for B
will need a new archive with new project A' API.
However, as B' master fails with new A, the whole compilation fails and
nothing is publish. So B'PR is never compiled successfully.
By publish the archives as soons as generated, the A' new API will be
published and B'PR will compile correctly, even if master fails.
Will be able to merge B'PR without bypassing travisCI.
Those dependencies will be used by travis CI in other projects.
We want to avoid other project to need a ssh key to get them :
- To avoid spread(and maintenance) of ssh key.
- For PR coming from another repositories, ssh key is not available.
By making those dependencies available by http, we simplify the process.
Fix partially #34.
Archives download need to be updated in client projects.
Update dependencies tree.
This PR fails on travis but it is because of fix waiting to be merged in libzim.
But for the libzim PR to be validated by travis, we need to generate the libzim's dependencies archives here. But as master is broken, we do not generate the dependencies..
I've tested the two fixes together and it is working. So I merge this PR to solve this deadlock