forked from flathub/info.beyondallreason.bar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
info.beyondallreason.bar.yml
114 lines (113 loc) · 4.37 KB
/
info.beyondallreason.bar.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
app-id: info.beyondallreason.bar
runtime: org.freedesktop.Platform
runtime-version: "23.08"
base: org.electronjs.Electron2.BaseApp
base-version: "23.08"
sdk: org.freedesktop.Sdk
command: run.sh
sdk-extensions:
- org.freedesktop.Sdk.Extension.node20
build-options:
append_path: "/usr/lib/sdk/node20/bin"
cflags: -O2 -g
cxxflags: -O2 -g
env:
npm_config_nodedir: /usr/lib/sdk/node20
npm_config_offline: 'true'
NPM_CONFIG_LOGLEVEL: info
XDG_CACHE_HOME: /run/build/spring-launcher/flatpak-node/cache
npm_config_cache: /run/build/spring-launcher/flatpak-node/npm-cache
GITHUB_REPOSITORY: beyond-all-reason/BYAR-Chobby
finish-args:
- --share=ipc
- --socket=x11
- --socket=pulseaudio
- --device=dri
- --share=network
- --env=PATH=/usr/bin:/app/bin:/usr/lib/sdk/node20/bin
- --filesystem=xdg-run/app/com.discordapp.Discord:create
cleanup:
- '/chobby'
modules:
- name: chobby
buildsystem: simple
build-commands:
sources:
- type: git
url: https://github.com/beyond-all-reason/BYAR-Chobby
commit: eece9ffed260ff110ec2cc31fac25c4daf7a9c51
# We do full clone to make sure PACKAGE_VERSION is computed correctly.
disable-shallow-clone: true
build-commands:
- |
mkdir -p /app/chobby
echo "1.$(git rev-list --count HEAD).0" > /app/chobby/PACKAGE_VERSION
cp -r dist_cfg /app/chobby
cp -r build /app/chobby
- name: spring-launcher
buildsystem: simple
build-commands:
# First steps from https://github.com/beyond-all-reason/BYAR-Chobby/blob/master/.github/workflows/launcher.yml
# GitHub Action step: Patch launcher with dist_cfg
- |
cp -r /app/chobby/dist_cfg/* src/
for dir in bin files build; do
mkdir -p $dir
if [ -d src/$dir/ ]; then
mv src/$dir/* $dir/
rm -rf src/$dir
fi
done
# GitHub Action step: Make package.json
- |
export PACKAGE_VERSION=$(cat /app/chobby/PACKAGE_VERSION)
echo "Making build for version: $PACKAGE_VERSION"
node /app/chobby/build/make_package_json.js package.json /app/chobby/dist_cfg/config.json $GITHUB_REPOSITORY $PACKAGE_VERSION
# For flatpak we don't want to build AppImage, but unpacked
- |
jq '.build.linux.target="dir"' <<<$(<package.json) > package.json
jq '.build.files+=["!flatpak-node/**"]' <<<$(<package.json) > package.json
cat package.json
# Install all packages, use `--ignore-scripts`, so electron does not make a postinstall request
- |
npm ci --ignore-scripts
# Build electron app
- |
. flatpak-node/electron-builder-arch-args.sh
node_modules/.bin/electron-builder -- $ELECTRON_BUILDER_ARCH_ARGS --linux --dir
# Install application in destination folder
- |
cp -a dist/linux*unpacked /app/main
sources:
- type: git
url: https://github.com/beyond-all-reason/spring-launcher
commit: 2c0a6e17b50ab04ea592c53963c571e5ccb071ba
# This generated-sources.json from npm generator *really* wants that source is in the top directory
# and not in some sub directory, that's why there is a bunch of complexity with moving files around etc
- generated-sources.json
build-options:
env:
XDG_CACHE_HOME: /run/build/spring-launcher/flatpak-node/cache
npm_config_cache: /run/build/spring-launcher/flatpak-node/npm-cache
npm_config_nodedir: /usr/lib/sdk/node20
npm_config_offline: 'true'
- name: main
buildsystem: simple
build-commands:
- |
install -Dm755 -t /app/bin/ run.sh
install -Dm644 /app/chobby/dist_cfg/build/icon.png /app/share/icons/hicolor/128x128/apps/info.beyondallreason.bar.png
install -Dm644 info.beyondallreason.bar.desktop /app/share/applications/info.beyondallreason.bar.desktop
install -Dm644 info.beyondallreason.bar.metainfo.xml /app/share/metainfo/info.beyondallreason.bar.metainfo.xml
# Copy addr2line to bin so that engine can execute it to generate stacktrace
- |
cp /usr/bin/addr2line /app/bin
cp /lib/x86_64-linux-gnu/libbfd* /app/lib
cp /usr/lib/x86_64-linux-gnu/libsframe* /app/lib
sources:
- type: file
path: info.beyondallreason.bar.desktop
- type: file
path: info.beyondallreason.bar.metainfo.xml
- type: file
path: run.sh