Commit graph

640 commits

Author SHA1 Message Date
Berthold Stoeger
4b1a3a1a6e Selection: move selection functions from divelist.c to selection.c
Since we now have a selection.c translation unit, put the selection-
related functions there.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-12-04 13:00:23 +01:00
jan Iversen
06973d7ea0 packaging/ios: add new export files in core to project
Update Subsurface-mobile.pro to contain the new exportfuncs
and referenced files.

Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-03 21:30:39 -08:00
jan Iversen
e8a6042951 mac: create Xcode project for mobile (on a desktop)
Create Xcode project, allowing easy editing of all sources.
the project uses "make mobile" and "make desktop" to generate the project,
so all CMake changes are automatically updated

the project uses folder references, so adding/removing a source is
automatically updated

The project expect build-mobile and build to be existing as well
as external libraries, so after cloning do a normal build before
using the project.

Signed-off-by: Jan Iversen <jani@apache.org>
2019-11-26 21:54:05 -08: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
919a098513 macOS: with Qt 5.13 we need QtDBus again
So don't remove it from the build before signing.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-11-20 10:47:18 -08:00
Dirk Hohndel
3e5a81edeb macOS: update make package script for Grantlee 5.1
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-11-20 10:46:35 -08:00
Dirk Hohndel
6eca1b3ead iOS: fix handling of version option to build.sh
This makes it much more consistent and avoids a silly warning.

Also some small README updates.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-11-08 20:50:05 +01:00
Dirk Hohndel
db706193e1 iOS: update Info.plist with better text and missing description key
The NOTICE and copyright are freeform. The new description key is required for
iOS 13, but of course the redundant old key is still required for older
builds...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-11-08 20:50:05 +01:00
Dirk Hohndel
3afcff56d4 iOS: build the debug version of Google maps library if needed
When trying to debug on device Xcode really wants a debug build (which is
nearly unusably slow, but that's a different issue).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-11-08 20:50:05 +01:00
Dirk Hohndel
a0c47e0fbc iOS: explicitly disable open source SSL implementations
Those aren't allowed on iOS and adding these two flags removes some confusing
warnings that look like errors in the build log.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-11-08 20:50:05 +01:00
Dirk Hohndel
3265efcd96 iOS: small change to storeIcon
This was updated by Xcode - just checking it in so that running Xcode doesn't
cause dirty source tree.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-11-08 20:50:05 +01:00
Dirk Hohndel
39203a7ebd GitHub Action: add iOS build
This is incredibly brute force, downloading a 3+GB installer and
installing all of the Qt/iOS binaries.

This first attempt is mainly to get an idea how long this will take and
if this will fit within the size constraints of the build VM.  This
commit doesn't even try to build, yet.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-19 08:55:31 -04:00
Dirk Hohndel
cd8e1eb15a Revert "Windows build: Changesto build using mxebased hidapi,libusb and grantlee"
This reverts commit 60e63afb82.

I merged this to early without paying attention to the fact that this
needed an updated build container as well.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-14 07:31:56 -07:00
Paul Buxton
60e63afb82 Windows build: Changesto build using mxebased hidapi,libusb and grantlee
Remove hidapi from manually built components and use the mxe based one instead.
Remove libzip as that is handled by mxe packages.
Update version of grantlee used to build with qt 5.13.1.
Also hide vscode files from git.

[Dirk Hohndel: combined two commits, cleaned up the commit message and removed
               one now incorrect comment line from mxe-based-build.sh]

Signed-off-by: Paul Buxton <paulbuxton.mail@googlemail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-13 11:31:38 -07: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
Berthold Stoeger
619d3fb1fd Cleanup: move gas-functions to own translation unit
But only functions that operate only on gases. Functions concerning
cylinders or dives remain in dive.c or are moved to equipment.c

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-06-19 13:11:10 -07:00
Berthold Stoeger
bff80cf462 Cleanup: move unit-related functions to own translation unit
Create a units.c translation unit.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-06-19 13:11:10 -07:00
Berthold Stoeger
7f4d9db962 Cleanup: move trip-related functions into own translation unit
These functions were spread out over dive.c and divelist.c.
Move them into their own file to make all this a bit less monolithic.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-06-19 13:11:10 -07:00
Berthold Stoeger
6200909ba4 Cleanup: move tag functions into own translation unit
Make dive.h a bit slimmer. It's only a drop in the bucket - but at
least when modifying tag functions not the *whole* application is
rebuilt anymore.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-06-19 13:11:10 -07:00
Berthold Stoeger
75767c456a Turn application state into enum
The application state was encoded in a QByteArray. Thus, there was
no compile-time checking. Typos would lead to silent failures.

Turn the application state into an enum. Use the enum-class construct,
so that the values don't polute the global namespace. Moreover,
this makes them strongly typed, i.e. they don't auto-convert to
integers.

A disadvantage is that the enums now have to be cast to int
explicitly when used to index an array.

Replace two hash-maps in MainWindow to arrays of fixed sizes.

Move the application-state details into their own files.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-05-12 12:33:55 -07:00
Berthold Stoeger
926b6895bb Build: add DiveListNotifier.cpp to qmake project file
In the future, we will need DiveListNotifier.cpp in mobile builds.
Therefore, add it to the qmake project file for iOS.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-04-12 18:19:07 +03:00
Dirk Hohndel
4c26bd5522 build-system: macOS: more hacking around paths
This really is mostly for my scripting and how I build the official packages.
But there isn't much harm having it in the repo. And it makes my life easier.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-04-12 09:30:06 +02: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
75d7d7a83c build system: use --force when signing Mac bundle
This avoids a common problem if some of the libraries copied into the
budle where previously signed.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-01-25 10:51:32 +13: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
4f55760fa5 Windows/MXE: actually build HIDAPI library
Otherwise Suunto EON Steel & EON Core, Scubapro G2 & Aladin Square and
other, future USB HID dive computers won't be supported on Windows.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-01-21 17:10:17 +12: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
Dirk Hohndel
1665da04a4 Travis: Android build wrapper now runs inside our container
So we don't need the pre-built binaries anymore, and we don't need the
travis_wait hack anymore for potentially slow downloads as that is all
installed in the container already.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-12-30 11:20:34 -08:00
Dirk Hohndel
2d7ffd4eff Android: update for Qt 5.12.0
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-12-30 11:20:34 -08:00
Jan Mulder
cdee2fde64 Android build: add explanation for huge hack
This had to be embedded in the build process (or better, solved for
real).

Using Cmake, Clang, NDK 18b, Qt 5.12 beta 4, some Subsurface code does
not compile. At this point in time, its fully unclear to me why we see the
error as it is.

Thing fail deep down in Qt and NDK headers on #include <cmath>. Error like
"::signbit is not in the global namespace". The most logic reason is an
improper order in which include paths are constructed in the build process.
Any attempt to find the real reason failed. Even very similar command lines
from a qmake build that succeed fail with a cmake style build.

The very very dirty hack is commenting out some lines in NDK 18b:

"./android-ndk-r18b/sources/cxx-stl/llvm-libc++/include/cmath

Comment lines 313-325, and all build, links and runs with no errors
related to this known at this point.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-12-30 11:20:34 -08:00
Jan Mulder
2bed16203f Android build: always use -fPIC
make sure that all lib code is compiled with -fPIC as things will not
link due to error "requires unsupported dynamic reloc R_ARM_REL32" (for
arm build).

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-12-30 11:20:34 -08:00