Commit Graph

489 Commits

Author SHA1 Message Date
cm8 26e6b81924 rework fixenv-nonstd-libdir script
the script won't create another file (run-nonroot previously)
and instead carry out environment setup itself for the binary
links pointing at it - it's more readable and smaller this way

rework mips32r2.py file copy def - may be useful in other files,
eventually transport this functionality to base.py (!?) later
on, after this branch is merged to master
2018-06-24 08:48:38 +02:00
cm8 615e994d22 avoid heredoc expanding variables in fixenv-nonst-libdir script
necessary to output run-nonroot script correctly
2018-06-24 06:17:45 +02:00
cm8 2751616753 fix libdir name issue, copy tc libs for production targets
The following applies to mips32r2_uclibc_glibcxx_dyn target,
only:
  - libstdc++.so* tc libs are copied to INSTALL/lib/<full-arch>

  - i.e. there is an example showing how to copy other libs from
    the toolchain to supplement the installation files (in case
    they are found to be missing on a target machine)

  - if target already supplies libstdc++.so*, copied ones will be
    preferred for kiwix-tools binaries (when run from a non-std
    installation directory on the target), drawback in this case
    is extra space occupied by the lib, but the gain is less
    hazzle on target boxes that lack libstdc++.so*

  - comment or modify the lines in mips32r2.py accordingly to the
    setup of your mips target
2018-06-24 04:25:08 +02:00
cm8 4cbbf2325b cleanup mips32r2.py and use python class inheritance for flavors
added
  mips32r2_uclibc_gclibcxx_dyn,  (preferred atm, tested on prod hw)
  mips32r2_uclibc_gclibcxx_static
targets (shared) and renamed previous uclibc ones to
  mips32r2_uclibc_uclibcxx_dyn,
  mips32r2_uclibc_uclibcxx_static
for clarity (i.e. non-shared, pure ones)

reworked builder classes to use inheritance of properties and
methods (instead of copying boiler plate code)

mips32r2_uclibc_gclibcxx_dyn target compiles and tested to run on
production targets such as avm routers modified with a freetz env.

See cm8/freetz@41d97c3789 for one of
many possible projects to build a working toolchain with.  In short
- git clone
- umask 0022
- make menuconfig (choose expert, disable toolchain download and
let the toolchain/make scripts built a gcc-5.x one, do not forget
to set FREETZ_LIB_libuClibc__WITH_WCHAR=y)
- read the commit message for further info on long double math
peculiarities
- tested here with 0.9.33.2

Remember that swap will need to be running on the box, or else
kiwix-serve is likely to quit with "invalid lzma stream in cluster"
errors (if memory is too low).

If the box lacks library support such as libstdc++.so*, you can
copy them from the target toolchain libdir over to
BUILD_mips32r2_uclibc_gclibcxx_dyn/INSTALL/lib if there are
unsatisfied dependencies at runtime.  (Which libraries need to be
supplemented this way depends on your firmware and/or freetz
configuration).

Another issue is the execution in non-standard installation
directories.  LD_LIBRARY_PATH env needs to point to "our" lib
directory.  If you tar INSTALL/ dir, transport the result to
an embedded device, untar and wan't to run from there, it is
best to wrap all the elf binaries with a shell script that
correctly sets LD_LIBRARY_PATH.  This step has been automated,
but needs testing, see
kiwixbuild/patches/fixenv-run-in-nonstd-installdir.sh
for details.

This fixenv script is copied to INSTALL/bin during the
build and it should be run on the box, if kiwix-tools is to
reside in nonstd location (i.e. if files are not installed
or installable to /bin, /lib or their usr/ pendants).

Feel free to improve on automation of the necessary setup
steps to make mips port build and deployment easier.
2018-06-23 11:44:05 +02:00
cm8 2024187891 mips uclibc target mips32r2_uclibc_dyn added
ATM the uclibc toolchain buildable by freetz (see
https://github.com/freetz/freetz) is used.  When
configuring freetz make sure

FREETZ_LIB_libuClibc__WITH_WCHAR=y
FREETZ_BUILD_TOOLCHAIN=y

are set, so uClibc++ as part of the toolchain is built with wchar_t
support.  Eventually root_path definition in mips32r2.py (hardcoded
for now) needs to be adjusted.  Some (all?) prebuilt, downloadable
tcs of the freetz project do not have wchar support in uClibc++ (but
uclibc does).

KNOWN PROBLEMS:

xapian-core currently does not compile with uClibc++
2018-06-21 11:22:41 +02:00
cm8 c1f281eedf initial mips platform support, import from issue 48
The target mips32r2_dyn is tested to fully compile, but untested to
run.  Target mips32r2_static reaches kiwix-lib and fails linking
pthread.  For further details see the comments in #48.

Some known problems:

* hardcoded values of icudt58l in some dependent packages
  unnoticable during compile, but will affect runtimes

* the libdir name problem
  x86_64-linux-gnu <> mips-linux-gnu

* pthread linking problem when compiling kiwix-lib statically
  may be a meson issue, since it somewhat claims to properly
  handle pthread linking in cross-compile situations; there
  are some url links in #48 laying out a proper workaround.
2018-06-19 17:56:53 +02:00
Matthieu Gautier d0ecf70284
Merge pull request #196 from kiwix/fix_release_build_bis
[TRAVIS] Fix release dist.
2018-06-19 11:46:54 +02:00
Matthieu Gautier d5b81294ca [TRAVIS] Fix release dist.
- Correctly make dist.
- zimwriterfs is now using meson, we don't need a special case.
2018-06-19 10:39:07 +02:00
Matthieu Gautier aeffb90f1f
Merge pull request #195 from kiwix/fix_release_build
Fix release build
2018-06-18 19:25:23 +02:00
Matthieu Gautier d076c6b8d7 Do not set zimwriterfs version directly in the dependency.
The version is tracked in `kiwixbuild/versions.py`, so we must no set
it in `kiwixbuild/dependencies/zimwriterfs.py`.
2018-06-18 17:56:13 +02:00
Matthieu Gautier 37e2b709f8 [TRAVIS] Use target_only only if we are building in a cron.
The deps will be build only if we are in a cron.
In this case, we can directly build only the target.

But in other case, we have to build the target and its dependencies.
2018-06-18 17:54:44 +02:00
Matthieu Gautier c3cacb387f
Merge pull request #194 from kiwix/fix_typos_release
Fix a small typo breaking the release build process.
2018-06-18 16:32:06 +02:00
Matthieu Gautier fbb84f8df2 Fix a small typo breaking the release build process. 2018-06-18 14:17:06 +02:00
Matthieu Gautier 14f2de9664
Merge pull request #189 from kiwix/update_versions
Update to new versions of libzim, kiwix-lib, kiwix-tools, zim-tools, …
2018-06-15 22:09:46 +02:00
Matthieu Gautier d53f1aad4a Update to new versions of libzim, kiwix-lib, kiwix-tools, zim-tools, zimwriterfs. 2018-06-15 19:39:45 +02:00
Matthieu Gautier 1ad0b35987
Merge pull request #187 from kiwix/no_kiwix-desktop_travis_trusty
Do not try to compile kiwix-desktop on travis trusty
2018-06-15 17:07:35 +02:00
Matthieu Gautier c9c7d86ca8 Do not try to compile kiwix-desktop on travis trusty 2018-06-15 16:39:14 +02:00
Matthieu Gautier 9decfa6226
Merge pull request #186 from kiwix/docker_only_for_qt
Use Docker to build kiwix-desktop only.
2018-06-15 16:28:57 +02:00
Matthieu Gautier 37ebcf83ae Use Docker to build kiwix-desktop only.
Keep default travis env for everything else.
2018-06-15 15:57:57 +02:00
Matthieu Gautier 829ad7ca61
Merge pull request #185 from kiwix/fix_buildnodeps_crosscompile
Add toolchains steps even if we are building with `--build-nodeps`.
2018-06-14 23:28:39 +02:00
Matthieu Gautier b3d9ff5a6b Add toolchains steps even if we are building with `--build-nodeps`.
Toolchains are not really a deps, they have to be build everytime.
2018-06-14 22:58:43 +02:00
Matthieu Gautier 428fe7efa0
Merge pull request #184 from kiwix/native_gcc4.8
Native gcc4.8
2018-06-14 20:07:08 +02:00
Matthieu Gautier b090353001 Do not use the system ctpp2 in native_dyn debian.
The CI is using ubuntu artful and the deb package is compiled with another
compiler that gcc-4.8 (used in other project CI).

As we compile everything with gcc-4.8, we must compile our own ctpp2.
2018-06-14 18:18:46 +02:00
Matthieu Gautier 9ad07fe550 Travis, do not try to compile deps if not needed. 2018-06-14 18:18:46 +02:00
Matthieu Gautier 1cbfcef9ce Fix kiwix-desktop dependencies. 2018-06-14 18:18:45 +02:00
Matthieu Gautier eed80c1ff9 Correctly associate the source with the builder. 2018-06-14 18:18:45 +02:00
Matthieu Gautier 8506cdeffd Correctly pass CMAKE_* to qmake.
qmake doesn't use the env variables, we must pass the variables in the
command line.
2018-06-14 18:18:45 +02:00
Matthieu Gautier 4047ec20dd Add xapian patch to correctly include sys types. 2018-06-14 18:18:45 +02:00
Matthieu Gautier e441b847b5 Use gcc-4.8 to compile in Docker.
Other travis-CI will use the default gcc version of ubuntu trusty.
We must compile with the same compiler to ensure that we don't break ABI.
2018-06-14 14:53:16 +02:00
Matthieu Gautier 8b8d24d662
Merge pull request #183 from kiwix/no_kiwix-desktop_static
Do not try to compile kiwix-desktop on native_static.
2018-06-13 18:44:14 +02:00
Matthieu Gautier d74cd1d50a Do not try to compile kiwix-desktop on native_static.
QtWebEngine is not compatible with static compilation so we should not
try to compile kiwix-desktop on native_static.
2018-06-13 17:39:06 +02:00
Matthieu Gautier 5ba66db13d
Merge pull request #182 from kiwix/no_gcc
Do not build with gcc-5.
2018-06-13 12:34:49 +02:00
Matthieu Gautier 2a18f74786 Do not build with gcc-5.
We build with gcc-5 because of zimSplit using ofstream.swap method.
Latest version of zimSplit doesn't use it anymore so let's compile
everything with default gcc.

See openzim/zim-tools@a959609839

We also explicitly set the list of package to install per job, so
less packages are installed.
2018-06-13 10:57:32 +02:00
Matthieu Gautier 2f058d239b
Merge pull request #181 from kiwix/no_travis_deploy
Do not deploy on native_dyn linux platform.
2018-06-12 19:19:30 +02:00
Matthieu Gautier 8db9def67d Do not deploy on native_dyn linux platform.
The deployement is already made in the Docker.
"Classic" deploy will fail because there will be no archive to deploy.
2018-06-12 18:03:28 +02:00
Matthieu Gautier 69fce5923a
Merge pull request #176 from kiwix/desktop
Desktop
2018-06-12 18:02:53 +02:00
Matthieu Gautier 269e2b39a6 Build the kiwix-desktop app image in Travis. 2018-06-12 16:31:57 +02:00
Matthieu Gautier 894ab4ba06 Add a script to package kiwix-desktop in a AppImage.
AppImage is a tools to create application running in all linux.
See https://appimage.org/
2018-06-12 16:29:00 +02:00
Matthieu Gautier 8c3a8be65d Build kiwix-desktop in travis. 2018-06-12 16:29:00 +02:00
Matthieu Gautier 398f77f9f3 Add kiwix-desktop dependency. 2018-06-12 16:12:31 +02:00
Matthieu Gautier cf8f303362 Add qt(webengine) dependency.
Add qt dependency and QMakeBuilder.
2018-06-12 16:12:15 +02:00
Matthieu Gautier 63003d5bce Correctly extract platform from the dependency.
If the `dep` is a two char string (as "qt"), the `platform, name = dep`
will split the string and search for 't' dependency in 'q' platform.

So, we have to be sure that the dep is a tuple before splitting it.
2018-06-12 16:12:15 +02:00
Matthieu Gautier fc61fbab3d
Merge pull request #180 from kiwix/icu_namespace
Better compilation of icu4c.
2018-06-11 21:12:13 +02:00
Matthieu Gautier 1109b6b155 Better compilation of icu4c.
- Disable icuio and layoutex.
- Hardcode UTF8 as charset (we always use utf8 and hardcoding him improve
  performances)
- Do not include default utf headers
- Do not use `using namespace icu`

See http://source.icu-project.org/repos/icu/trunk/icu4c/readme.html#RecBuild
for more information about options.

Increment base dependencies version as we are compiling icu differently.
2018-06-11 18:05:10 +02:00
Matthieu Gautier 007e78607e
Merge pull request #177 from kiwix/docker
Docker
2018-06-11 17:54:34 +02:00
Matthieu Gautier ded38889cf Use docker to build native_dyn.
As we want to use qt and packages are available only since ubuntu artful, we
need to use docker because travis-ci is ubuntu trusty.

We could also build qt, but it takes too many time and travis timeout.
2018-06-11 16:50:44 +02:00
Matthieu Gautier 312e734678
Merge pull request #175 from kiwix/multi-arch
Multi arch
2018-06-08 14:33:15 +02:00
Matthieu Gautier 4dea44d305 Fix travis CI 2018-06-08 10:29:26 +02:00
Matthieu Gautier daefadecc9 Better gradle option.
Enable `--no-daemon` : Using the daemon make gradle keep "configuration"
(like plugin path). If gradle installation path change, it will break
kiwix-android build.

Enable `--build-cache` : This is not the case by default :/
This should greatly improve compilation speed.
2018-06-07 10:50:30 +02:00
Matthieu Gautier 369b805e59 Add ios_multi_arch fatlib.
Fix #113
2018-06-06 17:41:12 +02:00