Commit graph

218 commits

Author SHA1 Message Date
Dirk Hohndel
7dc3afba31 build-system: update to current OpenSSL version
This is required to compile it on ARM64 Macs (and of course also is
the right thing to do overall).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-03-12 08:28:32 -08:00
Dirk Hohndel
b40354c7f2 build-system: compile stats code on mobile OSs
Android and iOS use qmake, so add the code to the .pro file.
This also removes all remnants of QCharts includes and uses and all the
references to QCharts in our various build systems.

That was a brief but extremely useful detour.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-10 15:16:52 -08:00
Dirk Hohndel
4ebd8485f4 cleanup: remove obsolete Android scripts
These have all been replaced with the current qmake based build process.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-30 08:57:12 -08:00
Dirk Hohndel
dea1ef84d5 build-system/Android: adapt the Google maps plugin name
This appears to be needed only for Android with Qt 5.15. Which means
that this commit creates odd breakage in case someone were to try to
build for Android with an older Qt version - but given that the current
build process only works with Qt 5.14 or 5.15, I think this is an
acceptable flaw.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-23 18:10:11 +00:00
Dirk Hohndel
fb3d1b3073 Android: improve documentation and setup script
This has now been verified to work on a fresh clean Ubuntu 20.04 install, both
using the docker image route as well as the full local build system.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17 09:17:54 -08:00
Dirk Hohndel
4070c76501 build-system/Android: we need to collect the ABIs earlier
That's what happens if you develop a script like this sequentially.
We need to have the ABIs picked in order to build googlemaps, otherwise
this fails with the build container as that only includes the ARM
libraries and tools.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17 09:17:54 -08:00
Dirk Hohndel
6439a9b441 build-system/mobile: force using our own ECM build
If the OS has an older one installed, that is found first and the
build fails. This way we know that ours is used.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17 09:17:54 -08:00
Dirk Hohndel
2fd464893b android/build-system: build kirigami as library
Doing it this way using the cmake build system at least gets us to the point
where everything links and appears to fit together. It still doesn't work at
all, but hey, progress.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-17 09:17:54 -08:00
Dirk Hohndel
e3d4b91070 android: ensure that gradle can handle UTF8 files
This should be the case automatically, but appears to fail when run as part of
the GitHub Action.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-11-19 17:18:33 -08:00
Dirk Hohndel
cb4ccea3c2 build-system: update Android builder docker container
This adjusts the docker setup to create a container with the correct
NDK, SDK, tools, Qt version, etc, and updates the helper scripts that
are needed in order to do that.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-11-19 17:18:33 -08:00
Dirk Hohndel
3071ea06f0 android: ensure all required pieces are in place for the build
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-11-19 17:18:33 -08:00
Dirk Hohndel
068c7f5de1 android: move the build of googleaps plugin
We want to build the googlemaps plugin once we know with architectures we are
building for. So let's do that right before we build Subsurface-mobile.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-11-19 17:18:33 -08:00
Dirk Hohndel
e73a82cd70 build-system: combine iOS and Android Subsurface-mobile.pro
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-11-19 17:18:33 -08:00
Dirk Hohndel
64913bba47 android: add qmake based build for Subsurface-mobile
Several features that are needed to create Android bundles with the
current NDK and QT 5.15 aren't easily available when using cmake. Given
that we already do a qmake based build for iOS, I decided to simply
switch Android to that as well.

An added complication is that some of the magic that qmake uses to do
the right things fails if the .pro file isn't in the root directory of
your project. So this is right now somewhat inconsistent with the way we
build for iOS. Something that should get cleaned up in the near future
as it makes no sense to maintain two separate .pro files.

This commits also adds a new build shell script to drive the assembly of
all the dependencies. Once again this is a new file with the old one
left in place for now (but to be removed fairly soon).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-11-19 17:18:33 -08:00
Dirk Hohndel
3a00ac0157 android: add new build setup script
This installs the required versions for most components, switches us to
Qt 5.15, current SDK, NDK, and the current OpenSSL version.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-11-19 17:18:33 -08:00
Dirk Hohndel
2690325623 Android: install translations into the right place
When updating the NDK I forgot to adjust the install destination for the
translations.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-05-27 12:41:14 -07:00
Dirk Hohndel
006d630142 build-system/Android: add missing install-qt.sh
This file is copied from the QBS project. It's under LGPL and therefore
compatible with our licensing. While it would be possible to retrieve
this file at build time from the original project, for now it seemed
easier to include it in our repo.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-27 11:04:29 -07:00
Dirk Hohndel
f04bfd4a86 GitHub Actions: use the Qt 5.13.2 based Android build container
This is no longer created using GitHub actions (but all the necessary
information is still included in this repo). We need to be able to
shrink this container so our GitHub Action runs don't run out of disk
space.

Adjust the path where the resulting binaries are found with this build.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-25 13:18:41 -07:00
Dirk Hohndel
0fe02af0e8 build-system/android: remove libusb at QTest
We no longer use libusb to access USB devices on Android, therefore
there's no point including libusb in our build. Also, we have never even
attempted to run the tests on Android, so let's not even pretend to
support building them.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-25 13:18:41 -07:00
Dirk Hohndel
d3e495efd0 build-system/Android: use PREFIX outside of NDK
If we install our support libraries into the NDK we later run into
include path order issues that result in strange errors around the
inclusion of math.h (because we find the C version of that include
file that ships with the NDK before we find the libstdc++ version
of math.h (because the include path for our support libraries is
listed before the libstdc++ include search path). By having a distinct
install-root for our libraries we can avoid this problem.

Remove the previous hack that tried to work around the symptoms of
this issue.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-25 13:18:41 -07:00
Dirk Hohndel
f112be7a61 build-system/Android: use install-qt.sh to install Qt
The official installer now requires the user to log in which we can't
really do in a scripted manner. Let's see how long this way of
installing things will be available.

While doing this remove an ancient hack of some Qt settings that we no
longer need.

This also tries to prune some things that we don't need in the Docker
image to reduce image size.

The mapbox plugin is removed as it would add a dependency to QtSql which
we otherwise don't need. And since the plugin isn't used, no point in
installing it.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-25 13:18:41 -07:00
Dirk Hohndel
c0ecd3a597 build-system/Android: create standalone toolchain in wrapper script
This way when we build the android build container, the correct toolchain
is already in place.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-25 13:18:41 -07:00
Dirk Hohndel
9025a9b2b1 build-system/Android: update some dependency versions
Qt 5.13.2 fixes a few bugs.

We are NOT switching to Qt 5.14 as that breaks a ton of things with
Android support. At this point even with qmake it near impossible to get
working Android binaries, no one appears to have a solution for cmake.

With qt-android-cmake current master fixes the problem that held us back
at the earlier commit, so let's go back to using master.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-25 13:18:41 -07:00
Dirk Hohndel
999cc2d642 build-system/Android: remove no longer supported Qt versions
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-25 13:18:41 -07:00
Dirk Hohndel
37badf2746 cleanup: fix image reference in Android README
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-18 17:38:09 -07:00
Dirk Hohndel
7719373f1a Android: remove legacy FTDI support
This works on almost no devices anymore and has been replaced by the USB
serial support for Android.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-03-16 07:58:20 -07:00
Dirk Hohndel
03344b0d9e Android: update README to mention build container
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-11-20 18:58:43 -08:00
Dirk Hohndel
d82e008b4c Android: switch to latest OpenSSL
If we update all this, we might as well go to the latest.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-05 08:19:31 -07:00
Dirk Hohndel
00550d9284 Android: work around Android 5.x issues with OpenSSL
The Qt documentation has specific suggestions how to build our own
version of OpenSSL in order to work on Android 5.x:
https://doc.qt.io/qt-5/android-openssl-support.html

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-05 08:19:31 -07:00
Dirk Hohndel
ea0e447e0d builld-system: switch Android to Qt 5.13.1
This fixes the SSL issue with Android 5.x/Lollipop.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-05 08:19:31 -07:00
Anton Lundin
a30e6b306f android-build: Add some more libzip hacks
This hacks the libzip build to not try to find zlib, because it fails
doing so on modern NDK. We just tell it that its there, and be done with
it.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
2019-10-04 09:16:30 -07:00
Anton Lundin
43cd80dfc1 android-build: Add support for x86_64
This adds support for building x86_64 apks.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
2019-10-04 09:16:30 -07:00
Anton Lundin
dbdfb9b517 android-build: Load variables file relative source dir
Not everybody have their build dir in the same place, but we can always
find the files relative each other.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
2019-10-04 09:16:30 -07:00
Dirk Hohndel
7fa25de58a Android: allow passing through -quick argument
So even setups relying on the wrapper script can do faster rebuilds.
This also cleans up a bug that made passing through the release
parameter fail in the past, and removes overly verbose debugging output.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-02 08:04:49 -07:00
Dirk Hohndel
9a35519a2a Android: bundle default font for use in OnePlus devices
This is working around a Qt Bug https://bugreports.qt.io/browse/QTBUG-69494
which prevents correct rendering of the OnePlus fonts.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-09-21 15:13:10 -07:00
Dirk Hohndel
318ddc7227 Android: ensure higher build number for arm64 APK
Google Play allows uploading two APKs, but only if the arm64 one
has a higher build number.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-07-19 21:46:07 -07:00
Dirk Hohndel
658ac2bb78 Android: small change to keep exports together
Simply move that export to the top of the file with the others.

Suggested-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-07-18 06:39:00 -07:00
Jan Mulder
2f6ad092a5 Android: fix review comment
Fix review comment by Anton on GitHub.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2019-07-18 06:39:00 -07:00
Jan Mulder
29f4d35bc4 Android: fix location of the build apks
With all upgrading, the build apks now show up in a slightly different
location. Correct this in the scripting. Notice that this is debug
building only. Release building is outside the repo.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2019-07-18 06:39:00 -07:00
Jan Mulder
9a70c260e8 Android: rework build of OpenSSL to get it to build link and run
This is squashed commit consisting of a number of subjects, all intended
to get our app to build, link and run on device, but as the steps are
small (but non-trivial), I document them in this one commit.

1) Do not use OpenSSLs install targets, but simply copy the wanted build
artifacts manually. The main reason for this, is that the install
targets want to install a lot more than we build, so it also builds
parts of the OpenSSL suite that we will never use.

2) As Android does not like shared libraries with embedded versioning
(and the used androiddeployqt actively prevents adding versioned
libraries to the build), strip all this data from the generated shared
libraries. This trick was already there, but its adapted to all possible
conflicts.

3) The OpenSSL config script seems rather broken, resulted in failed
builds, and calling the underlying Configure is simpler.

4) Finally, parts of the OpenSSL code uses stdio things like stdout,
stderr, etc. These showed up as undeclared external on build time. Well,
luckily, there was an easy way out using 2 -D(efines). This feels hacky,
but does the job (and we are not interested in the output of OpenSSL in
our app).

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2019-07-18 06:39:00 -07:00
Jan Mulder
bb895f1896 Android: Qt 5.12.4, OpenSSL 1.1.1c
The main reason for upgrading of the Qt version is the hunt for a broken
BT/BLE stack, preventing downloads from BT/BLE enabled DCs, in relation
to arm64 architecture builds. (And the absolute need for an arm64 build
in relation to the publication of the Android app in  Googles Play
store).

In addition, Qt 5.12.4 starts supporting OpenSSL 1.1.1c, and trying to
use our current OpenSSL 1.0 series is highly discouraged by Qt (and
OpenSSL itself).

So, upgrade both in unison. But ... be careful bisecting issues on this
commit, as it does break our build. That will be fixed in the next
commit.

This fixes the BT/BLE download for arm64!

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2019-07-18 06:39:00 -07:00
Rolf Eike Beer
d104506f98 CMake: use builtin method to not use BZip2
Signed-off-by: Rolf Eike Beer <eike@sf-mail.de>
2019-03-21 19:30:14 -07:00
Rolf Eike Beer
3664cc4ee6 Android: factor out duplicate version string search
Signed-off-by: Rolf Eike Beer <eike@sf-mail.de>
2019-03-05 13:27:54 -08:00
Rolf Eike Beer
9bbb6f785c CMake: just tell CMake to not find HTTP_Parser
Signed-off-by: Rolf Eike Beer <eike@sf-mail.de>
2019-03-05 13:27:54 -08:00
Rolf Eike Beer
aa7f9a18f2 simplify sed hacking of Qt CMake files
Signed-off-by: Rolf Eike Beer <eike@sf-mail.de>
2019-03-05 13:27:54 -08:00
Lubomir I. Ivanov
a1ffe115cf facebook: remove the featute from the code base
Remove from:
- unit tests
- desktop widgets
- preferences
- core intergration
- cmakefiles
- build scripts
- icons
- docs

Also remove the plugins and social network integration.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2019-02-01 17:16:43 -08:00
Dirk Hohndel
9f433aa759 Android: accept 'Release' argument
This is mostly an artifact of how I build release packages. Otherwise
this likely isn't important.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-01-25 10:40:10 +13:00
Dirk Hohndel
51e44d4846 Android: make sure we have the correct platforms installed
This should fix the current Travis build failures for Android.
It is odd how we have ANDROID_PLATFORM and ANDROID_PLATFORMS,
buf for now all I care about is that the Travis build completes.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-01-21 17:10:17 +12:00
Jan Mulder
20c40ea6b4 Android build: always reconfigure libdivecomputer
This fix makes no difference from usage of this script in Travis
context, as every build starts from a clean VM, but the very few
developers that build for Android locally, and that want to use the new
style docker container builds as well, things are broken.

libdivecomputer has build artifacts in its source tree (and that source
tree is shared between local and docker run). So it happens that
libdivecomputer is configured locally, and afterwards fails to build
in docker build as its already configured, but not for the docker
image its now running in.

The fix is simple. Always reconfigure libdivecomputer when using this
script.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-12-30 11:20:34 -08:00
Dirk Hohndel
6fb135eb46 Android: build both 32 and 64 bit binaries
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-12-30 11:20:34 -08:00