Commit graph

170 commits

Author SHA1 Message Date
Dirk Hohndel
d2f2f22dc1 don't build the macOS version twice on GitHub
We need some additional options when building the package, so let that script
handle the details and use the generic build script mainly for the dependencies.

Also let's not mix building for testing and building the DMG - just so I can
stay somewhat sane.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2023-12-10 17:23:54 -08:00
Dirk Hohndel
3a98b8a722 more macOS build fixes
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2023-12-10 17:23:54 -08:00
Dirk Hohndel
2ffba35d45 Build a macOS DMG in a GitHub Action
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2023-12-10 17:23:42 -08:00
Salvador Cuñat
5d708c0d92 Build script: Qt has tagged versions currently
It looks like Qt company has LGPLed versions tagged wich simplifies
things a bit while building, e.g. 5.15.3 current workaround matches
"v5.15.3-lts-lgpl" tag.

Background: Debian Sid is currently at Qt 5.15.8 which is impossible to
build from scratch with current script as only a few git versions are
tagged in the script format "v5.15.8".

Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
2023-06-25 09:47:56 -07:00
rmorris
a1a834568a Correct paths, to allow libmtp to build
Signed-off-by: rmorris <rmorris@rkmorris.us>
2023-02-09 05:17:23 -08:00
Doug Junkins
d537e16cb1 macOS: support newer SDKs
Update to match Xcode command-line-tools SDKs from 10.X to 16.X

Signed-off-by: Doug Junkins <douglas.junkins@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-11-26 11:40:51 -08:00
Berthold Stoeger
2112bd8e08 build-system: make -build-with-qt6 work
-build-with-qt6 did not work for me, because the flag is
ignored when selecting the qmake executable. It would find
the system-wide qmake executable, which is Qt5 and then
decide to build with Qt5.

When the flag is set, try to search for a Qt6 version of
qmake first. On Ubuntu based distros this seems to be
qmake6

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2022-11-15 14:08:37 -08:00
Dirk Hohndel
067ed39503 build-system: try to hack around Qt 5.15.3 in Jammy
The Qt Company apparently didn't feel the need to have the correct
tags in all of the module directories. So this now has to manually
pick the correct SHA. What a pain.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-07-31 10:26:25 -07:00
Dirk Hohndel
51590853eb build-system: macOS universal builds imply Qt6 builds
Qt5 doesn't support the m1.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-04-27 22:03:37 -07:00
Dirk Hohndel
f0d819a842 build-system: fix building fat binaries on x86_64
It does seem a bit odd, but the arch command actually doesn't
return a reasonable architecture on macOS. So let's use the
uname -m command to get the right answer that makes this script
work both on an m1 and an Intel Mac.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-04-27 22:03:37 -07:00
Dirk Hohndel
e7ea951122 update INSTALL instructions for macOS
And tiny whitespace fixes.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-04-27 22:03:37 -07:00
Dirk Hohndel
5a5188bc47 build-system: don't build against Qt6 by default
As some Linux distros start to ship both Qt5 and Qt6, it actually makes more
sense to build only against Qt6 when the user explicitly asks for it. Having it
preferred over Qt5 seems completely wrong in hind sight.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-04-23 12:35:54 -07:00
Dirk Hohndel
ac70282193 macOS: build googlemaps plugin as fat binary
I couldn't make this to work as a single pass build, so we again do a dual pass
and manually assemble the dylib. This is then copied to a sane spot which
required another attempt to copy it in the CMakeLists.txt - which I added
comments to in order to make sense of the weirdness.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-04-18 07:24:39 +02:00
Dirk Hohndel
7bd17a1784 macOS: add the ability to create fat binaries
This also does some cleanup for some of the variable names.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-04-18 07:24:38 +02:00
Dirk Hohndel
a8f1fccd89 build-system: more Qt6 / QtLocation updates
This adds a flag to explicitly enable a build against maps, which is
only needed for Qt6 (as we always assume that Qt5 has maps installed).

It also includes a quick fix to fail gracefully if libmtp was already
patched.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-04-18 07:24:38 +02:00
Dirk Hohndel
c94e2b5d3f build-system: switch submodule protocol
As of today, GitHub no longer allows the 'git://' protocol, so we need to
switch the submodule and our other references to cloning git repos to
'https://' instead.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-03-16 06:46:07 -07:00
Dirk Hohndel
c4319e3995 build-system: Qt6 so far is missing Qt Location
So don't try to find the private headers and don't try to build the googlemaps
map plugin.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-03-12 08:28:32 -08:00
Dirk Hohndel
da3417123a build-system: take Qt6 into account
We should find qmake - but in case there's only a qmake-qt6 binary,
try to use that.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-03-12 08:28:32 -08:00
Dirk Hohndel
81ed23583e macOS: fix broken .pc file for libmtp
This has bugged me forever. The existing file creates a warning on every single
compiler invocation. I really need to figure out if I can get this fixed
upstream. But while I'm at it, I submitted it here to make it easier to spot
warnings in the build output.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-03-12 08:28:32 -08:00
Dirk Hohndel
e223cb3500 build-system: correctly build OpenSSL on ARM Macs
The OpenSSL configure script requires us to pass in the correct build spec.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-03-12 08:28:32 -08:00
Dirk Hohndel
12e61e8c12 build-system: don't fail with multi-part path
If the CMAKE_PREFIX_PATH is a multi element path the old code failed
in very predictable ways. So instead simply fall back on the PATH to
find qmake.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-03-01 14:16:25 -08:00
Ryan Gardner
87e203ea50 make whitespace in build script match existing whitespace
Signed-off-by: Ryan Gardner <ryan.gardner@coxautoinc.com>
2021-05-20 15:10:52 -07:00
Ryan Gardner
effd0dbae8 Make the Mac SDK detection in build.sh more robust
When trying to build on Big Sur, the xcode command-line tools
install are installed in /Library/Developer/CommandLineTools/SDKs,
and as of Xcode 12.5, it does not include a 10.x version
of SDK.

This changes it to search in the location of the command-line tools SDK
for a 10.x version, and if it can't find a 10.x version it will
find an explicit 11.x version of the SDK to use because it is
conceivable that in the near future Apple will stop installing any
10.x SDK's as part of the command-line tool installer.

If the SDK can't be found, the build script will exit now instead
of continuing with an unset BASESDK version that causes a later failure.

Signed-off-by: Ryan Gardner <ryan.gardner@coxautoinc.com>
2021-05-20 15:10:52 -07:00
Dirk Hohndel
bd26d8407f build.sh: recreate previous behavior with no args
When calling build.sh with no args asking for a specific build type, that
should be equivalent with calling it with the -desktop arg.

Reported-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-01-09 19:29:50 -08:00
Dirk Hohndel
8f153384b5 build script: move related code closer together
This just makes it more obvious what we are doing.

This appears only necessary on macOS.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-29 13:39:16 -08:00
Dirk Hohndel
4fb99680f3 build script: remove the long outdated Qt detection
We now require qmake to be found much earlier in the script so we can simply
use that to get the right prefix path.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-29 13:39:16 -08:00
Dirk Hohndel
2a6fe54ac3 build script: fix typos and inconsistencies
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-29 13:39:16 -08:00
Dirk Hohndel
6a7152bb40 build-system: don't build googlemaps for downloader only builds
This is kind of a silly optimization, but might make a huge difference in build
time on a Raspberry Pi.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-19 15:33:17 -08:00
Dirk Hohndel
6e579f1c1b build-system: clean up handling of printing/manual
This was wrong when running -both in the past. We only want these
options for desktop builds.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-19 15:33:17 -08:00
Dirk Hohndel
dcec0175e2 build-system: start enabling support for downloader in build.sh
This is just adding the third option and then untangles some of the 'there are
only two options' based code.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-12-19 15:33:17 -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
43f15f1b48 build-system: build libmtp for macOS if requested
If we are building our own dependencies (usually only for release builds), we
now also need to build libmtp.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-31 16:09:37 -07:00
Dirk Hohndel
6586438bf6 build-system: improve finding of libdivecomputer.a
On some systems it ends up in lib64 instead of lib.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-16 21:11:44 -07:00
Dirk Hohndel
86396e9904 build-system: fix libgit2 detection
Usually ldconfig isn't in the user's path.

Suggested-by: Cristian Ionescu-Idbohrn <cristian.ionescu-idbohrn@axis.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-16 20:23:37 -07:00
Dirk Hohndel
2dd28e3c8d build-system: remove building Grantlee from build script
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-10-08 12:19:39 -07:00
Dirk Hohndel
e6ac0665c7 build-system/macOS: build libz and libftdi as part of Mac dependencies
Usually people will install these via Homebrew, but when we need to build
everything ourselves (required for release binaries), then these two were
missing before.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-09-13 13:55:46 -07:00
Dirk Hohndel
c6704f2aa6 build-system: deal with libgit2 versions 1 and later
We assumed everywhere that libgit would always have a 0.xx version number.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-09 17:04:52 -07:00
jan Iversen
20a1b4befb scripts: expand build.sh
Add option "-src-dir <source directory>" to build options.

When calling build.sh without -src-dir it uses src/subsurface as usual, but when called
with -src-dir <source directory>, it uses src/<source directory> as source basis.

This is a needed option, when working with "git worktree", which is used when working on
different branches in parallel (e.g. master and my-feature-branch), because it allows a
build directory in each worktree, and thus much faster when switching work.

Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-24 10:56:26 -08:00
jan Iversen
d1490776e2 build-system: correct spelling error in build.sh
the location of libdivecomputer is not subsurface/llibdivecomputer

Correct spelling error.

Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-24 06:18:36 +09:00
Dirk Hohndel
ebe317d644 build system: make INSTALL_ROOT depend on BUILD_PREFIX as well
This makes things more consistent.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-12 06:56:29 -05:00
Dirk Hohndel
623eb6a16f build system: fix most shellcheck warnings
A couple are still there, but this was the low hanging fruit.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-12 06:56:29 -05:00
Dirk Hohndel
2d0cf24efd build system: do something more reasonable if subsurface is a symlink
This actually changes behavior compared to what we did before. But it seems
reasonabel. If ./subsurface is a link to a different directory, then assume
that we want a true out of tree build in the current directory.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-12 06:56:29 -05:00
Dirk Hohndel
24637dc769 build-system: allow shared source across multiple hosts
This attempts to allow sharing a host directory across multiple builds, target
use case is to have a shared source directory on a VM host and be able to build
from that in a number of VMs without those builds stepping on top of each
other.

Instead of subsurface/build, subsurface/mobile-build,
subsurface/libdivecomputer/build, use a prefix path to allow having true out of
tree builds.

The one shortcoming is that the autotools need to be run in the libdivecomputer
directory - that means this will be run on the first system that starts a
build. But that seems to cause no harm in my testing.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-12 06:56:29 -05:00
jan Iversen
f179ec033f scripts: update get-deps to allow clean build
libssh2 depends on openssl, therefore it is important that openssl is
build before libssh2.

The old get-deps would cause errors in 2 situations:
1) In a clean build, make of libssh2 would fail
2) In a normal build, where openssl changed version, make of libssh2 would
depend on old build.

Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-11-08 23:09:57 +01:00
Dirk Hohndel
754fffc795 GitHub Actions: first CI/CD build for Mac based on GitHub Actions
This feature is in beta right now and might change without notice, but instead
of dealing with the broken Travis Mac builds, this does seem progress.

The build artifact seems to work, but it's a bit more painful to get to. Go to
https://github.com/Subsurface-divelog/subsurface/actions and click on the
corresponding run - it's then in the top right corner under Artifacts. The one
oddity is that after unzipping the file you need to manually make
Contents/MacOS/Subsurface executable.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-10-14 21:00:10 -07:00
Dirk Hohndel
6670ea7bdb build-system: add -quick flag for build.sh
With this flag we assume that we don't need to rebuild grantlee and googlemaps.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-09-05 17:54:09 -07:00
Rolf Eike Beer
17211acc53 remove obsolete workaround for libdivecomputer includes of libusb
This has been fixed in revision b1d434f0ea9a2958613da9bed32ff3ff3318065e there.

Signed-off-by: Rolf Eike Beer <eike@sf-mail.de>
2019-03-09 09:51:55 -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
Jan Mulder
cfc22d0702 Build: build libgit2 from source when less than 0.26.0
We currently require a minimal version of libgit2 of 0.24.0. From
issue #1926 it seems that this version is too old. So, a simple test on
Linux to see the behaviour with such an old libgit2, I tried that.
Interestingly, with the current version of openssl that old libgit2
version does not even compile from source (known error in libgit2).

So, bump our minimal version of libgit2 to 0.26.0. That is also the
version we currently use on the Travis and official builds, so well
tested.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2019-01-10 08:19:07 -08:00
Jan Mulder
4b7b0f2dec Build: remove --skip-googlemaps build option
The scripts/build.sh script has an option --skip-googlemaps. Introduced
in 2017 at a moment the Travis Mac build failed on this. Interestingly,
when Mac building of the maps plugin was possible again (commit 79e3f69f48)
the --skip-googlemaps stayed. Obviously, this hack was never intended
to be used for anything else then getting it passed Travis on
some point in time for a specific Mac build.

So, remove this option.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2019-01-07 09:27:38 -08:00