Commit graph

20352 commits

Author SHA1 Message Date
Egbert de Pauw
a28a3b4f3c
Merge 9bd1631103 into c72a26afe1 2024-09-30 22:55:44 +13:00
Michael Keller
c72a26afe1 Remove misleading comment about smtk2ssrf build.
Signed-off-by: Michael Keller <github@ike.ch>
2024-09-30 22:22:39 +13:00
Salvador Cuñat
f81cf77886 Make libraw support build optional
Build in by default if libraw is found, but make it optional for builds
were it's not needed, like smtk2ssrf or subsurface-downloader.

Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
2024-09-30 22:22:39 +13:00
dependabot[bot]
821f3fc551 build(deps): bump com.github.mik3y:usb-serial-for-android
Bumps [com.github.mik3y:usb-serial-for-android](https://github.com/mik3y/usb-serial-for-android) from v3.4.3 to v3.8.0.
- [Release notes](https://github.com/mik3y/usb-serial-for-android/releases)
- [Changelog](https://github.com/mik3y/usb-serial-for-android/blob/master/CHANGELOG.txt)
- [Commits](https://github.com/mik3y/usb-serial-for-android/compare/v3.4.3...v3.8.0)

---
updated-dependencies:
- dependency-name: com.github.mik3y:usb-serial-for-android
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-29 09:23:36 +13:00
dependabot[bot]
b1493c3540 build(deps): bump com.android.support:support-v4 in /android-mobile
Bumps com.android.support:support-v4 from 25.3.1 to 28.0.0.

---
updated-dependencies:
- dependency-name: com.android.support:support-v4
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-29 08:36:07 +13:00
Michael Keller
8a64d1f4b9 Cleanup: Fix Warnings in MacOS build.
Signed-off-by: Michael Keller <github@ike.ch>
2024-09-28 23:50:55 +12:00
Michael Keller
784eddc166 Android: Update the docker Image Version Used to Build.
Update to the latest version (5.15.3).

Signed-off-by: Michael Keller <github@ike.ch>
2024-09-28 23:25:02 +12:00
dependabot[bot]
5613014124 build(deps): bump DamianReeves/write-file-action from 1.2 to 1.3
Bumps [DamianReeves/write-file-action](https://github.com/damianreeves/write-file-action) from 1.2 to 1.3.
- [Release notes](https://github.com/damianreeves/write-file-action/releases)
- [Commits](https://github.com/damianreeves/write-file-action/compare/v1.2...v1.3)

---
updated-dependencies:
- dependency-name: DamianReeves/write-file-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-27 09:50:34 +12:00
dependabot[bot]
b5e5e4c212 build(deps): bump actions/setup-python from 4 to 5
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4 to 5.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-27 09:49:23 +12:00
dependabot[bot]
968599c7d9 build(deps): bump insightsengineering/pip-action from 2.0.0 to 2.0.1
Bumps [insightsengineering/pip-action](https://github.com/insightsengineering/pip-action) from 2.0.0 to 2.0.1.
- [Release notes](https://github.com/insightsengineering/pip-action/releases)
- [Commits](https://github.com/insightsengineering/pip-action/compare/v2.0.0...v2.0.1)

---
updated-dependencies:
- dependency-name: insightsengineering/pip-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-27 09:48:46 +12:00
Michael Keller
6418d3acbc Update Version in docker Tag, Clean up Dependencies.
Signed-off-by: Michael Keller <github@ike.ch>
2024-09-27 09:47:40 +12:00
dependabot[bot]
9873c86192 build(deps): bump ubuntu in /scripts/docker/android-build-container
Bumps ubuntu from 22.04 to 24.04.

---
updated-dependencies:
- dependency-name: ubuntu
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-27 09:47:40 +12:00
dependabot[bot]
b806c5371f build(deps): bump actions/cache from 3 to 4
Bumps [actions/cache](https://github.com/actions/cache) from 3 to 4.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-27 07:10:25 +12:00
Michael Keller
89b2b3bf70 CICD: Add Dependency Scanning / Updates by Dependabot.
Add scanning and updates of dependencies with Dependabot where this is
possible.

While this isn't currently available for the majority of our code that
is in C / C++, there are some things 'around the edges' where we can
offload some of the dependency management:
- GitHub actions
- docker images
- the gradle build for android

Signed-off-by: Michael Keller <github@ike.ch>
2024-09-26 19:41:11 +12:00
Michael Keller
716b350af2 Add libraw to the Remaining debian Based CICD Workflows.
Signed-off-by: Michael Keller <github@ike.ch>
2024-09-21 11:03:53 +12:00
Michael Keller
478e444cd9 Fix problems from rebase, clean up debian packaging definition.
Signed-off-by: Michael Keller <github@ike.ch>
2024-09-21 11:03:53 +12:00
Dirk Hohndel
28cd093d37 build-system: Fedora surprisingly uses CamelCase for LibRaw
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2024-09-21 11:03:53 +12:00
Dirk Hohndel
40c22f0fe9 deal with typo in older versions of libraw
longtitude instead of longitude prior to libraw 0.20.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2024-09-21 11:03:53 +12:00
Dirk Hohndel
ffa49cfd34 build-system: add libraw to smtk2ssrf if main build uses libraw
Otherwise the link step will fail.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2024-09-21 11:03:53 +12:00
Dirk Hohndel
435d5f5436 build-system: add libraw to more builds
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2024-09-21 11:03:53 +12:00
Dirk Hohndel
8e48a323e7 build-system: add libraw to Ubuntu build
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2024-09-21 11:03:53 +12:00
Dirk Hohndel
6537192e1d build-system: add libraw to Fedora/copr build
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2024-09-21 11:03:53 +12:00
Dirk Hohndel
3d552b84d1 build-system: add libraw to OBS daily build
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2024-09-21 11:03:53 +12:00
Dirk Hohndel
236203bf06 build-system: add libraw to macOS build
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2024-09-21 11:03:53 +12:00
Dirk Hohndel
09f59211ed build-system: de-clutter output of get-version.sh
In certain situations git merge-base would report errors if the branch
you are working in is older than the latest CICD builds. This simply
hides those pointless errors.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2024-09-21 11:03:53 +12:00
Dirk Hohndel
c8ef53c43f build-system: show if libraw was found
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2024-09-21 11:03:53 +12:00
Dirk Hohndel
68f8ca5fd0 build-system: allow empty option for pkg_config_library macro
Especially when adding new optional dependencies, you might want to have
neither REQUIRED nor QUIET there - this way we can see in the CICD where the
library is found and tested against.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2024-09-21 11:03:53 +12:00
Michael Keller
c866d2bead Add a package dependency on libraw20 to the debian package manifest.
Signed-off-by: Michael Keller <github@ike.ch>
2024-09-21 11:03:53 +12:00
Michał Sawicz
b92475d9c9 snap: add libraw dependency
Signed-off-by: Michał Sawicz <michal@sawicz.net>
2024-09-21 11:03:53 +12:00
Berthold Stoeger
d9f8570728 ubuntu/debian: add libraw-dev to build dependencies
I have not idea if this is enough to make parsing of raw files
work for the Ubuntu/Debian package.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-09-21 11:03:53 +12:00
Berthold Stoeger
13d1188c41 media: load metadata and thumbnails of raw pictures using libraw
The distinguished photographer shoots raw images. There is a
comprehensive library that can extract metadata and thumbnails
from these images. Let's use it if available.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-09-21 11:03:53 +12:00
Michael Keller
02638d7c3e CICD: Use the Updated 3.2.0 docker Image for Windows Builds.
This updates MXE to a current version and includes libraw.

Signed-off-by: Michael Keller <github@ike.ch>
2024-09-18 21:22:27 +12:00
Richard Fuchs
a6a15f9d3a core: add missing types to return values
Fixes build failing on Debian Buster (gcc 8.3.0) with:

/build/subsurface-beta-202409160411/./core/units.h: In function 'duration_t operator""_sec(long long unsigned int)':
/build/subsurface-beta-202409160411/./core/units.h:149:48: error: could not convert '{((int32_t)sec)}' from '<brace-enclosed initializer list>' to 'duration_t'
  return { .seconds = static_cast<int32_t>(sec) };

Signed-off-by: Richard Fuchs <dfx@dfx.at>
2024-09-16 22:02:51 +02:00
Michael Keller
cb6766c1d4 CICD: Add libraw to the MXE build container.
In support of #3954.

Also update MXE to the latest version.

Signed-off-by: Michael Keller <github@ike.ch>
2024-09-15 18:46:36 +12:00
Michael Keller
a2f5be13e3 Update libdivecomputer to latest on 'Subsurface-DS9'.
Signed-off-by: Michael Keller <github@ike.ch>
2024-09-15 18:41:20 +12:00
Berthold Stoeger
1a3bc9bf71 units: add comment concerning unit literals
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-09-11 10:23:07 +02:00
Berthold Stoeger
dd5def35f5 units: replace SURFACE_PRESSURE by 1_atm
Moreover, convert diveplan::surface_pressure from int to
pressure_t.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-09-11 10:23:07 +02:00
Berthold Stoeger
ae81b42fe2 core: introduce a few user-defined literals for unit types
Thise makes initialization of unit types more palatable.

For example:

    surface.time = sample.time - duration_t { .seconds = 20 };
=>  surface.time = sample.time - 20_sec;

    delta_depth.mm = feet_to_mm(1.0); // 1ft
=>  delta_depth = 1_ft;

    get_cylinderid_at_time(..., { .seconds = 20 * 60 + 1 }));
=>  get_cylinderid_at_time(..., 20_min + 1_sec));

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-09-11 10:23:07 +02:00
Berthold Stoeger
f09601bc93 core: remove to_feet() function
It wasn't used anywhere.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-09-11 10:23:07 +02:00
Berthold Stoeger
77b12bbccf core: add cast_int<> function
We had a pattern where doubles were converted to long with
lrint() and then down-cast to a narrower int type.

Because this is unwieldy, introduce a function encapsulating
this.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-09-11 10:23:07 +02:00
Berthold Stoeger
110e64bc66 general: simplify a few unit manipulations
Now that we have defined addition and subtraction on unit
classes, let's use them in a few examples.

Yes, some of these are a bit pointless, because they are
of the kind
        a.mbar - b.mbar => (a-b).mbar

However, these probably should be further simplified
by storing the result in a unit type.

This commit is mostly a proof-of-concept.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-09-11 10:23:07 +02:00
Berthold Stoeger
729cc16fc5 core: add addition / subtraction to unit types
When adding / subtracting unit objects it is completely
irrelevant with respect to which unit the data is stored.
Why should the user know this?

Therefore add addition / subtraction functions.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-09-11 10:23:07 +02:00
Berthold Stoeger
12ca172a9e core: add CRTP base class to unit types
The goal here is to add general addition and scalar multiplication
functions to the unit types.

Thereto, we need a CRTP
(https://en.wikipedia.org/wiki/Curiously_recurring_template_pattern)
base class.

However, this breaks compound initialization, so we have to use
named initializers:
	weight_t { 2000 } -> weight_t { .grams = 2000 }
The good thing is that this is exactly how these classes were
supposed to be used: make the unit explicit!

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-09-11 10:23:07 +02:00
Berthold Stoeger
696ba61eef planner: move gaschange_before / gaschange_after into loop
Declaring everything at the begin of the function is a K&R
disease, that makes code very hard to follow.

Remove the last assignment to gaschange_after since that is
a noop (found by Coverity).

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-09-11 07:54:50 +02:00
Berthold Stoeger
6f91a73a05 planner: add move assignment constructor and operator to diveplan
Makes coverity happy and is a good idea.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-09-11 07:54:50 +02:00
Berthold Stoeger
db531bbd05 tests: shut up coverity warnings
It wants us to test for end of container when finding elements.
That is of course reasonable in "production" code, but a bit
pointless in the testing code. Oh well.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-09-11 07:54:50 +02:00
Berthold Stoeger
80abde2a61 Small updates to CODINGSTYLE.md reflecting our switch to C++
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-09-11 00:13:32 +12:00
Berthold Stoeger
1287880be0 planner: return decotable from plan()
The old return code was not used by any caller.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-09-11 00:13:04 +12:00
Berthold Stoeger
22b232661a planner: remove cloneDivePlan()
This was a trivial one-liner and is not needed.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-09-11 00:13:04 +12:00
Berthold Stoeger
3e006e678a planner: don't use fixed size deco stop table
This was quite ominous: a 60-element fixed size table was
passed as argument to plan(). But there was no check for 60
anywhere? Use a dynamic vector instead.

The whole thing is weird, as the depth of the decostop table
doesn't seem to be used.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-09-11 00:13:04 +12:00