Commit Graph

129 Commits

Author SHA1 Message Date
Matthieu Gautier 1c8b8ef99b Stop using the deprecated (and broken) `mesontest`.
`mesontest` command is deprecated since meson 0.42.0 and broken with last
release (0.44.0) (see mesonbuild/meson#2761).

Fix #97.
2017-12-12 11:19:07 +00:00
Matthieu Gautier a9ce8ee8c1 Add a `--make-dist` command to kiwix-build.
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.
2017-12-05 09:32:47 +00:00
Matthieu Gautier e4f8b6c7a9 Add a option to kiwix-build.py to build release version of subproject.
With `--make-release` option, kiwix-build.py will build the tagged
version of the subproject.
2017-11-28 22:42:16 +00:00
Matthieu Gautier 53ecc65b9d Zimwriterfs need libmagic-dev.
Install the package `libmagic-dev`.

There is no precompiled libmagic package from cross-compilation and we
are mainly using zimwriterfs only on linux.
2017-11-28 13:11:39 +00:00
Matthieu Gautier d9be1808c7 Fix android sdk license change. 2017-10-17 15:25:18 +02:00
Matthieu Gautier dc00fcd297 Avoid rename the meson cross compilation file.
This file is exported in CI archive for other projects.
If we change its name, it will not be exported and other projects will
break.
2017-10-10 11:19:14 +02:00
Matthieu Gautier 4997017be2 Run meson test when possible.
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.
2017-10-02 16:05:06 +02:00
Matthieu Gautier a9eaa71357 Check that target platform is compatible with current host.
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.
2017-07-17 14:13:31 +02:00
Chris Li c40cce4f82 Add a patch for iOS cross-platform static 2017-07-17 14:13:31 +02:00
Chris Li 3e835d0c74 Add a patch for macOS native dyn 2017-07-17 14:13:31 +02:00
Matthieu Gautier 0671712753 Install ctpp2-utils to have ctpp2 compiler installed.
ctpp2c is available in debian, so no need to compile it.
2017-07-12 14:51:00 +02:00
Matthieu Gautier e27f170472 Fix package name for pkg-config on Fedora. 2017-06-26 14:32:04 +02:00
Matthieu Gautier bf0bc08b6e Remove -fPIE option.
"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.
2017-06-26 14:32:04 +02:00
Matthieu Gautier 4f0b2ec376 Set the right env variable when necessary.
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.
2017-06-26 14:32:04 +02:00
Matthieu Gautier 22fffcee51 Add script to build customapp 2017-06-25 15:49:49 +02:00
Matthieu Gautier 0e01aa0cee Set the android_abi variable in the meson_cross_file.txt
Kiwix-lib need to know want is the android abi to copy the lib in the
right directory.
2017-06-13 17:37:58 +02:00
Matthieu Gautier d43e6d3c70 Correctly declare dependencies of kiwix-build and projects we are building.
Factorize a bit the code also.

Fixes #49.
2017-06-12 10:42:11 +02:00
Matthieu Gautier 0e5fb294f6 Better argument parse for better help text.
(And one clean line :) )
2017-05-09 14:13:43 +02:00
Matthieu Gautier 317bc207fb Do not force specific arguments when compiling for win32.
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.
2017-05-09 14:02:37 +02:00
Matthieu Gautier c42883753a Add an option to hide intermediate progress information. 2017-05-09 10:24:17 +02:00
Matthieu Gautier f044fd15bf Add support to build kiwix android custom app.
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.
2017-05-02 17:30:07 +02:00
Matthieu Gautier c8f5acb41f Add better progress information output for long operation.
Checking sha256sum and downloading file can be pretty long.
Let's print few information to the user.
2017-05-02 17:30:07 +02:00
Matthieu Gautier 570170a92a Add armhf cross-compilation support.
We directly use the cross-compilator provided by the raspberrypi project at
https://github.com/raspberrypi/tools
2017-04-28 17:22:25 +02:00
Matthieu Gautier 5957720a7d Rename cross_env to cross_config.
The dictionary is no more a environment. It is a full configuration
dict. Rename it accordingly.
2017-04-28 11:41:59 +02:00
Matthieu Gautier 71c52d9ee4 Use the system declared in the cross-env in the cmake_cross_file template.
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.
2017-04-28 11:37:26 +02:00
Matthieu Gautier f26c2274b4 Remove CROSS_ENV global variable (and fix android compilation).
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.
2017-04-28 10:40:31 +02:00
Matthieu Gautier 3beb6d81f2 Add a option to kiwix-build.py to clean intermediate directories.
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.
2017-04-24 15:29:52 +02:00
Matthieu Gautier 86c1547f88 Allow kiwix-build to build android APK.
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.
2017-04-24 15:26:51 +02:00
Matthieu Gautier 56862b09d6 Add (and use) the utility function `add_execution_right`. 2017-04-24 14:53:50 +02:00
Matthieu Gautier a49fb15964 BuildEnv.run_command now take a str as input instead of a file object.
We can get a str from a file object. The contrary is more difficult.
2017-04-24 14:53:50 +02:00
Matthieu Gautier 73669f59c8 Use the `urllib.request.urlopen`'s `context` argument only if available.
The `context` argument has been added to python 3.4.3 version.
We must not use it for older version.

Fix #31
2017-04-17 12:09:10 +02:00
Matthieu Gautier 57ac912824 Add missing installation of packages on debian. 2017-04-12 01:44:34 +02:00
Matthieu Gautier 6a24b38169 Add WIN32 flag definition.
When switching to c++11, the WIN32 flags is no more automatically defined.
So let's define it in the meson crossfile itself.
2017-04-11 16:57:51 +02:00
Julian Harty 103a6aa5db Added the Debian automake package to the dependencies. 2017-04-08 22:44:08 +02:00
Matthieu Gautier bea2d13feb Add a option to compile the dependencies only of a target.
This is useful to generate directory (and archive) of dependencies for
a particular target.
2017-04-08 21:34:25 +02:00
Matthieu Gautier e816979d51 Limit the choice of the targets argument to target we know about.
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.
2017-04-08 18:19:42 +02:00
Matthieu Gautier 308cfa6986 Use dependency names as reference instead of class names.
Class names are implementation names.
Using the dependency names is better as it surprise less the user.
2017-04-08 18:19:17 +02:00
Matthieu Gautier 81796e7125 Add a option to skip the source installation.
It make the kiwix-build.py script run a bit father.
2017-04-08 17:58:26 +02:00
Matthieu Gautier 3d9ab94195 Add Zimwriterfs dependency.
Now kiwix-build.py can compile zimwriterfs.
2017-03-28 10:10:12 +02:00
Matthieu Gautier b62388bae1 Allow a dependency to declare extra_packages to install.
This is different from declaring a dependency as dependency may be build
by kiwix-build.py.
2017-03-28 10:10:12 +02:00
Matthieu Gautier fa17b5e200 Add the lib64 path to LDFLAGS. 2017-03-28 10:10:12 +02:00
Matthieu Gautier 9d45158f42 Add print of current directory for command in the log file. 2017-03-28 10:10:12 +02:00
Matthieu Gautier 411f861b13 Move log dir in a subdir of BUILD_* 2017-03-13 13:18:14 +01:00
Matthieu Gautier 600f1b55aa Add the android ndk toolchains and compile android on travis. 2017-03-13 13:18:14 +01:00
Matthieu Gautier e3c0c5db82 Toolchains now can have a builder and a source. 2017-03-13 13:18:14 +01:00
Matthieu Gautier 940cea290d Use a 'extra_libs' key instead of 'properties'.
'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.
2017-03-13 13:18:14 +01:00
Matthieu Gautier 29bba313bc [API change] Use just one option to specify the build target.
There is no more option for static or share build. This value is
integrated in the build-target.
2017-03-13 13:18:14 +01:00
Matthieu Gautier c31a29488a [API Change] User can specify the target to build.
This is a API change, the working directory is set using the
--working-dir option, not as an argument.
2017-03-13 13:18:14 +01:00
Matthieu Gautier 6d69f056a4 Rewrite how we set environment. (Simpler way to write the same thing) 2017-03-13 13:18:14 +01:00
Matthieu Gautier 00acba9ee9 Add the notion of toolschain.
- For now, only the win32 is here.
- There no more nativeBuilEnv as the buildEnv can launch command without
  using the toolschain.
2017-03-13 13:18:14 +01:00