opencpn-radar-pi / radar_pi

Radar plugin for OpenCPN with support for Navico and some Garmin and Raymarine radars
GNU General Public License v2.0
77 stars 43 forks source link

Flatpak build is rebuilding files #231

Open keesverruijt opened 1 year ago

keesverruijt commented 1 year ago

The flatpak build seems to run commands twice.

For instance, it is running the NMEA0183 library link twice. This is most obvious when the cmake build system is changed to cmake-ninja in flatpak/org.opencpn.OpenCPN.Plugin.radar.yaml:

[50/57] Linking CXX static library libs/nmea0183/libNMEA0183.a
[54/57] Linking CXX static library opencpn-libs/wxJSON/libWXJSON.a
[12/21] Linking CXX static library libs/nmea0183/libNMEA0183.a
[17/21] Linking CXX static library opencpn-libs/wxJSON/libWXJSON.a
leamas commented 1 year ago

Yes, I can reproduce this also on plain shipdriver builds. Digging

leamas commented 1 year ago

This is indeed the core problem. A really nice catch!

However, just using BUILD_TYPE=flatpak in the manifest does not work in the general case. I'm on it, but probably need a night's sleep to figure out what to do. Perhaps even two...

keesverruijt commented 1 year ago

Maybe change the flatpak instructions (yaml) to build type ‘simple’ then just call ‘make’ instead of cmake?

keesverruijt commented 1 year ago

Hmm come to think of it, I think the best approach is probably to get rid of the outer cmake layer, which in the end runs just a single generated script.

Instead, have circle-build-flatpak.sh generate a build-flatpak/build.sh script directly and feed that to flatpak builder using the ‘simple’ buildsystem. The mechanism to generate it could resemble the one used for cloudsmith sync so use an .in file where variables are substituted etc.

The cmake files can then remove most references to flatpak; it just becomes a tarball build.