-
Notifications
You must be signed in to change notification settings - Fork 1
/
io.github.TheThirdOne.rars.yml
74 lines (59 loc) · 2.49 KB
/
io.github.TheThirdOne.rars.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
app-id: io.github.TheThirdOne.rars
command: rars
runtime: org.freedesktop.Platform
runtime-version: '23.08'
sdk: org.freedesktop.Sdk
sdk-extensions:
# See https://github.com/flathub/org.freedesktop.Sdk.Extension.openjdk17#usage
- org.freedesktop.Sdk.Extension.openjdk17
finish-args:
- --env=PATH=/app/jre/bin:/usr/bin:/app/bin
- --socket=x11
- --share=ipc
- --filesystem=xdg-desktop:rw
- --filesystem=xdg-documents:rw
modules:
# See https://github.com/flathub/org.freedesktop.Sdk.Extension.openjdk17#usage
- name: openjdk
buildsystem: simple
build-commands:
- /usr/lib/sdk/openjdk17/install.sh
- name: rars
buildsystem: simple
sources:
# See https://github.com/TheThirdOne/rars/releases
- type: file
url: https://github.com/TheThirdOne/rars/releases/download/v1.6/rars1_6.jar
dest-filename: rars.jar
sha512: a046c3a1f49ce56cbab0896aafb73e9b39b5bfd0b86ae06cbfb36e369a40636780cb9d171e71ef3e3f7812787a6f490ba4db055f312dc3e61e983b54d78be454
- type: script
commands:
# Get the screen width (See https://superuser.com/a/1567163)
- SCREEN_WIDTH=$(cat /sys/class/graphics/*/virtual_size | grep -Eow -m 1 "^([0-9]+)")
# Divide by 1920 (See https://stackoverflow.com/a/22406193)
- DEFAULT_SCALE=$(awk "BEGIN {printf \"%.3f\",${SCREEN_WIDTH} / 1920}")
# Get the scale
- RARS_SCALE="${RARS_SCALE:-$DEFAULT_SCALE}"
# Generate Java arguments
- RARS_JAVA="${RARS_JAVA:--Dsun.java2d.uiScale=$RARS_SCALE}"
# Start
- /app/jre/bin/java ${RARS_JAVA} -jar /app/rars/rars.jar "$@"
dest-filename: rars
- type: file
path: io.github.TheThirdOne.rars.desktop
- type: file
path: io.github.TheThirdOne.rars.metainfo.xml
- type: file
path: io.github.TheThirdOne.rars.mime.xml
- type: file
path: io.github.TheThirdOne.rars.svg
build-commands:
# Copy files
- install -Dm 755 rars.jar /app/rars/rars.jar
- install -Dm 755 rars /app/bin/rars
- install -Dm 644 -t /app/share/applications io.github.TheThirdOne.rars.desktop
- install -Dm 644 -t /app/share/metainfo io.github.TheThirdOne.rars.metainfo.xml
- install -Dm 644 -t /app/share/mime/packages io.github.TheThirdOne.rars.mime.xml
- install -Dm 644 io.github.TheThirdOne.rars.svg /app/share/icons/hicolor/scalable/apps/io.github.TheThirdOne.rars.svg
# Update MIMEs
- update-mime-database /app/share/mime