WIP: Build Doodle inside Flatpak SDK

master
Noah 2020-12-28 15:03:52 -08:00
parent e6ac0bb5bc
commit a0a7147624
3 changed files with 50 additions and 12 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
.flatpak-builder/ .flatpak-builder/
build/ build/
source/

View File

@ -2,9 +2,31 @@
This repo contains Flatpak manifests to distribute Sketchy Maze to Linux users. This repo contains Flatpak manifests to distribute Sketchy Maze to Linux users.
It's a work in progress and currently tries to bundle the binary distribution It's a work in progress. It builds the game in the Flatpak SDK but doesn't yet
from tarball; but the binary uses glibc-2.32 which is not yet available in handle copying the runtime environment (SFX) and things in.
the freedesktop runtime.
## Setup
The Doodle source directory should be at a folder named "source" relative
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.
The `source/go.mod` file should have "replace" directives pointing to the
appropriate path as seen in the Flatpak build environment, like:
```
replace git.kirsle.net/go/render => /run/build/doodle/deps/render
replace git.kirsle.net/go/ui => /run/build/doodle/deps/ui
replace git.kirsle.net/go/audio => /run/build/doodle/deps/audio
```
It may be possible to skip the `replace` directives entirely and have `go get`
download the dependencies the usual way, but the `proxy.golang.org` server
sometimes caches stale versions of these if they were just recently changed and,
in case they had bugs, will prevent the app from building.
## Makefile ## Makefile

View File

@ -3,6 +3,9 @@
"runtime": "org.freedesktop.Platform", "runtime": "org.freedesktop.Platform",
"runtime-version": "20.08", "runtime-version": "20.08",
"sdk": "org.freedesktop.Sdk", "sdk": "org.freedesktop.Sdk",
"sdk-extensions": [
"org.freedesktop.Sdk.Extension.golang"
],
"finish-args": [ "finish-args": [
"--device=all", "--device=all",
"--persist=.doodle", "--persist=.doodle",
@ -24,24 +27,29 @@
{ {
"name": "doodle", "name": "doodle",
"buildsystem": "simple", "buildsystem": "simple",
"build-options": {}, "build-options": {
"build-args": [
"--share=network"
]
},
"build-commands": [ "build-commands": [
"find", "find",
"install -Dm755 ./doodle /app/bin/doodle", "pwd",
"install -Dm755 ./doodad /app/bin/doodad", ". /usr/lib/sdk/golang/enable.sh; env GOPATH=\"$(pwd)\"; make build",
"mkdir -p /app/share/doodle /app/share/icons", "install -Dm755 ./bin/doodle /app/bin/doodle",
"cp -ra guidebook rtp *.md /app/share/doodle", "install -Dm755 ./bin/doodad /app/bin/doodad",
"mkdir -p /app/share/doodle /app/share/icons /app/extra/export/share",
"cp -ra guidebook rtp *.md /app/extra/export/share/",
"cp -ra 256.png /app/share/icons/doodle.png", "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.desktop /app/share/applications/com.sketchymaze.Doodle.desktop",
"install -Dm644 com.sketchymaze.Doodle.appdata.xml /app/share/appdata/com.sketchymaze.Doodle.appdata.xml", "install -Dm644 com.sketchymaze.Doodle.appdata.xml /app/share/appdata/com.sketchymaze.Doodle.appdata.xml",
"for s in 16 32 64 128 256; do install -Dm644 ${s}.png /app/share/icons/hicolor/${s}x${s}/apps/doodle.png; done", "for s in 16 32 64 128 256; do install -Dm644 ${s}.png /app/share/icons/hicolor/${s}x${s}/apps/doodle.png; done",
"find /app/share" "find /app"
], ],
"sources": [ "sources": [
{ {
"type": "archive", "type": "dir",
"url": "https://www.kirsle.net/projects/Doodle/v0.4.0/doodle-0.4.0-linux-64bit.tar.gz", "path": "source"
"sha256": "ee3755be22b953bbfe0e477bc40b7c0637e61b49ef5653b49974490cb3fa6d3b"
}, },
{ {
"type": "dir", "type": "dir",
@ -54,6 +62,13 @@
{ {
"type": "file", "type": "file",
"path": "com.sketchymaze.Doodle.appdata.xml" "path": "com.sketchymaze.Doodle.appdata.xml"
},
{
"type": "extra-data",
"filename": "doodle",
"url": "https://download.sketchymaze.com/extra-data.tar.gz",
"sha256": "4ff48d57e6329f2638f3fcdca93a9b65a0fc9cbc057fe0446083a6a8a87088d1",
"size": 7159771
} }
] ]
} }