From 1e1a69d77be32e17757575caa51fbfb08ac6d623 Mon Sep 17 00:00:00 2001 From: Noah Petherbridge Date: Mon, 28 Dec 2020 18:24:01 -0800 Subject: [PATCH] Fully working Flatpak build! --- Makefile | 8 ++++++-- README.md | 18 ++++++++++++++---- com.sketchymaze.Doodle.json | 12 +++++------- launcher.sh | 6 ++++++ 4 files changed, 31 insertions(+), 13 deletions(-) create mode 100755 launcher.sh diff --git a/Makefile b/Makefile index 1c05044..2863a36 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,10 @@ clean: rm -rf .flatpak-builder build -.PHONY: build -build: clean +.PHONY: install +install: clean flatpak-builder --user --install build com.sketchymaze.Doodle.json + +.PHONY: repo +repo: clean + flatpak-builder --repo=repo build com.sketchymaze.Doodle.json diff --git a/README.md b/README.md index 1bc81ce..c8962b7 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,10 @@ This repo contains Flatpak manifests to distribute Sketchy Maze to Linux users. -It's a work in progress. It builds the game in the Flatpak SDK but doesn't yet -handle copying the runtime environment (SFX) and things in. +The game source is required. If you're not the developer, you won't have +access to the source, but the rest of the Flatpak goodness is available for +you to read and learn from in case you're also looking to package a +Go SDL2 application for Linux. ## Setup @@ -12,7 +14,8 @@ to this flatpak repo. A symlink can work. For best results, the Doodle source folder should be "fully initialized" and ready to simply `go build` the app and be done; this means `make doodads` has already been run, and `make bindata` to embed them in the Go sources. Generally, if you had run a `make dist` in -Doodle recently you're good to go. +Doodle recently you're good to go. The `guidebook/` and `rtp/` directories +should also be included. The `source/go.mod` file should have "replace" directives pointing to the appropriate path as seen in the Flatpak build environment, like: @@ -30,4 +33,11 @@ in case they had bugs, will prevent the app from building. ## Makefile -`make build` will attempt to build and install the Flatpak. +`make install` will attempt to build and install the Flatpak. + +`make repo` will build it and create the Flatpak repo in the directory `./repo` + +## To Do + +* GPG signature for the Flatpak. +* Upload the repo to `download.sketchymaze.com` for public access. diff --git a/com.sketchymaze.Doodle.json b/com.sketchymaze.Doodle.json index d331909..e38c02f 100644 --- a/com.sketchymaze.Doodle.json +++ b/com.sketchymaze.Doodle.json @@ -14,7 +14,7 @@ "--socket=x11", "--socket=pulseaudio" ], - "command": "doodle", + "command": "launcher.sh", "rename-icon": "doodle", "cleanup": [ "/include", @@ -38,8 +38,9 @@ ". /usr/lib/sdk/golang/enable.sh; env GOPATH=\"$(pwd)\"; make build", "install -Dm755 ./bin/doodle /app/bin/doodle", "install -Dm755 ./bin/doodad /app/bin/doodad", + "install -Dm755 ./launcher.sh /app/bin/launcher.sh", "mkdir -p /app/share/doodle /app/share/icons /app/extra/export/share", - "cp -ra guidebook rtp *.md /app/extra/export/share/", + "cp -ra guidebook rtp *.md /app/share/doodle", "cp -ra 256.png /app/share/icons/doodle.png", "install -Dm644 com.sketchymaze.Doodle.desktop /app/share/applications/com.sketchymaze.Doodle.desktop", "install -Dm644 com.sketchymaze.Doodle.appdata.xml /app/share/appdata/com.sketchymaze.Doodle.appdata.xml", @@ -64,11 +65,8 @@ "path": "com.sketchymaze.Doodle.appdata.xml" }, { - "type": "extra-data", - "filename": "doodle", - "url": "https://download.sketchymaze.com/extra-data.tar.gz", - "sha256": "4ff48d57e6329f2638f3fcdca93a9b65a0fc9cbc057fe0446083a6a8a87088d1", - "size": 7159771 + "type": "file", + "path": "launcher.sh" } ] } diff --git a/launcher.sh b/launcher.sh new file mode 100755 index 0000000..69da4a7 --- /dev/null +++ b/launcher.sh @@ -0,0 +1,6 @@ +#!/bin/bash +# XXX: to be run as the Flatpak executable +if [[ "$1" == "doodad" ]]; then + exec $@; +fi +doodle --chdir /app/share/doodle $@