From 1c9344f0a51a7d707378a37e4744625ae8395e6c Mon Sep 17 00:00:00 2001 From: James Osborne Date: Sat, 18 Oct 2025 03:02:48 -0400 Subject: [PATCH] Flatpak fix --- com.circlewithadot.Relibre.yml | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/com.circlewithadot.Relibre.yml b/com.circlewithadot.Relibre.yml index 0b76543..9f26783 100644 --- a/com.circlewithadot.Relibre.yml +++ b/com.circlewithadot.Relibre.yml @@ -10,26 +10,27 @@ modules: - name: relibre buildsystem: simple build-commands: - # Build from a writable copy (sources are mounted read-only by rofiles) - - mkdir -p work && cp -a . work/src + # 1) Work from a writable copy (sources are ro via rofiles) + - install -d /run/build/relibre/src + - cp -a . /run/build/relibre/src - # Enable CGO (needed by webkitgtk) - - cd work/src && go env -w CGO_ENABLED=1 + # 2) Enable CGO for webkitgtk + - cd /run/build/relibre/src && go env -w CGO_ENABLED=1 - # Patch vendor if it references webkit2gtk-4.0 -> use 4.1 in GNOME 47 + # 3) Patch vendored pkg-config name if needed (4.0 -> 4.1 on GNOME 47) - | - cd work/src + cd /run/build/relibre/src files=$(grep -R -l 'webkit2gtk-4\.0' vendor || true) if [ -n "$files" ]; then sed -i 's/webkit2gtk-4\.0/webkit2gtk-4\.1/g' $files fi - # Build (use vendored modules) - - cd work/src && go build -mod=vendor -trimpath -ldflags "-s -w" -o /app/bin/relibre + # 4) Build from the writable copy using the vendored modules + - cd /run/build/relibre/src && go build -mod=vendor -trimpath -ldflags "-s -w" -o /app/bin/relibre - # 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 + # 5) Desktop + icon (if present) + - if [ -f /run/build/relibre/src/dist/com.circlewithadot.Relibre.desktop ]; then install -Dm644 /run/build/relibre/src/dist/com.circlewithadot.Relibre.desktop /app/share/applications/com.circlewithadot.Relibre.desktop; fi + - if [ -f /run/build/relibre/src/dist/com.circlewithadot.Relibre.png ]; then install -Dm644 /run/build/relibre/src/dist/com.circlewithadot.Relibre.png /app/share/icons/hicolor/512x512/apps/com.circlewithadot.Relibre.png; fi sources: - type: dir