Fully working Flatpak build!

master
Noah 2020-12-28 18:24:01 -08:00
parent a0a7147624
commit 1e1a69d77b
4 changed files with 31 additions and 13 deletions

View File

@ -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

View File

@ -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.

View File

@ -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"
}
]
}

6
launcher.sh Executable file
View File

@ -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 $@