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>
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>
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>
-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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>