-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcom.yktoo.ymuse.yml
86 lines (77 loc) · 3.11 KB
/
com.yktoo.ymuse.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
app-id: com.yktoo.ymuse
runtime: org.freedesktop.Platform
runtime-version: '24.08'
sdk: org.freedesktop.Sdk
sdk-extensions:
- org.freedesktop.Sdk.Extension.golang
command: ymuse
finish-args:
- --share=ipc
- --share=network
- --socket=fallback-x11
- --socket=wayland
modules:
- name: ymuse
buildsystem: simple
build-options:
append-path: /usr/lib/sdk/golang/bin
env:
GOPATH: /run/build/ymuse/.go
build-commands:
# Remove versions from the downloaded sources
# (e.g. vendor/github.com/pkg/errors@v0.9.1 -> vendor/github.com/pkg/errors)
- find vendor/ -type d -name '*@v*' |
while read d; do mv "$d" "$(echo "$d" | sed -E 's/@v.*//')"; done
# Generate necessary stuff
- go generate
# Build the binary
- go build
-mod=vendor
-ldflags "-s -w -X main.version=$(git describe --always --tags) -X main.commit=$(git rev-parse HEAD) -X main.date=$(git log -1 --format=%cd --date=iso-strict)"
# Install the binary
- install -Dm755 -t /app/bin/ ./ymuse
# Copy over the required resources (launcher, icons, localisations)
- mkdir -p /app/share/icons /app/share/locale
- install -Dm644 resources/com.yktoo.ymuse.desktop -t /app/share/applications/
- install -Dm644 resources/metainfo/com.yktoo.ymuse.appdata.xml -t /app/share/metainfo/
- cp -r resources/i18n/generated/* /app/share/locale/
- cp -r resources/icons/hicolor /app/share/icons/
sources:
- type: git
url: https://github.com/yktoo/ymuse
tag: v0.22
- type: file
path: com.yktoo.ymuse.appdata.xml
dest: resources/metainfo
# Vendor modules file. Generate with "go mod vendor" (in ymuse dir) and copy over here
- type: file
path: modules.txt
dest: vendor
# Dependencies. Generate with (in ymuse dir):
# go mod download -json |
# grep '"Zip"' |
# cut -d '"' -f 4 |
# sed -E 's|.*?download/|https://proxy.golang.org/|' |
# while read u; do
# echo -e "- type: archive\n url: $u\n strip-components: 0\n dest: vendor\n sha256: $(curl -fsS "$u" | sha256sum -b | cut -d ' ' -f 1)\n"
# done
- type: archive
url: https://proxy.golang.org/github.com/fhs/gompd/v2/@v/v2.3.0.zip
strip-components: 0
dest: vendor
sha256: 8c45edf02baf54748904efc1585e22ced6376029123ba931c696a1676ef76ff3
- type: archive
url: https://proxy.golang.org/github.com/gotk3/gotk3/@v/v0.6.2.zip
strip-components: 0
dest: vendor
sha256: 7d7dae0d111d61872ab6df6d8055bfa5aafc57383295f260705174ce25160d95
- type: archive
url: https://proxy.golang.org/github.com/op/go-logging/@v/v0.0.0-20160315200505-970db520ece7.zip
strip-components: 0
dest: vendor
sha256: c506eace74028656eb28677a4c162f9c023ce2f9c0207354ba80cca89f11b461
- type: archive
url: https://proxy.golang.org/github.com/pkg/errors/@v/v0.9.1.zip
strip-components: 0
dest: vendor
sha256: d4c36b8bcd0616290a3913215e0f53b931bd6e00670596f2960df1b44af2bd07