Flatpak fix part 69

This commit is contained in:
2025-10-18 03:00:04 -04:00
parent 5e1902c54d
commit e8572e1562

View File

@@ -1,13 +1,22 @@
app-id: com.circlewithadot.Relibre
runtime: org.gnome.Platform
runtime-version: "47"
sdk: org.gnome.Sdk
sdk-extensions:
- org.freedesktop.Sdk.Extension.golang
command: relibre
modules:
- name: relibre
buildsystem: simple
build-commands:
# Work in a writable copy of the sources
# Build from a writable copy (sources are mounted read-only by rofiles)
- mkdir -p work && cp -a . work/src
- cd work/src
# Ensure CGO and rewrite webkit2gtk 4.0 -> 4.1 within the COPY, not the RO source
# Enable CGO (needed by webkitgtk)
- cd work/src && go env -w CGO_ENABLED=1
# Patch vendor if it references webkit2gtk-4.0 -> use 4.1 in GNOME 47
- |
cd work/src
files=$(grep -R -l 'webkit2gtk-4\.0' vendor || true)
@@ -15,12 +24,13 @@ modules:
sed -i 's/webkit2gtk-4\.0/webkit2gtk-4\.1/g' $files
fi
# Build from the writable copy
# Build (use vendored modules)
- cd work/src && go build -mod=vendor -trimpath -ldflags "-s -w" -o /app/bin/relibre
# Optional desktop/icon
# Desktop & icon (optional if present)
- if [ -f work/src/dist/com.circlewithadot.Relibre.desktop ]; then install -Dm644 work/src/dist/com.circlewithadot.Relibre.desktop /app/share/applications/com.circlewithadot.Relibre.desktop; fi
- if [ -f work/src/dist/com.circlewithadot.Relibre.png ]; then install -Dm644 work/src/dist/com.circlewithadot.Relibre.png /app/share/icons/hicolor/512x512/apps/com.circlewithadot.Relibre.png; fi
sources:
- type: dir
path: .