-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.fish
executable file
·88 lines (69 loc) · 1.6 KB
/
setup.fish
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
#!/usr/bin/env fish
## Create temp directory.
if test -d ./tmp
true
else
mkdir ./tmp
end
## Copy closure of chosen derivation into AppImage root directory.
if test -d ./$APPNAME/nix
true
else
mkdir -p $APPNAME
nix copy --no-check-sigs --to $PWD/$APPNAME $DERIVATIONPATH
end
## Copy static dash shell into AppImage root directory.
if test -e ./$APPNAME/dash
true
else
cp (which dash) $APPNAME/dash
end
## Copy static AppRun into AppImage root directory.
if test -e ./$APPNAME/AppRun
true
else
cp (which AppRun) $APPNAME/AppRun
end
## Copy static proot binary into AppImage root directory.
if test -e ./$APPNAME/proot
true
else
cp (which proot) $APPNAME/proot
end
## Modify and compile startup binary run.c
if test -e ./$APPNAME/run
true
else
cp ./run.c tmp/run.c
sed -i -e "s:APPNAME:$APPNAME:g" ./tmp/run.c
sed -i -e "s:DERIVATIONPATH:$DERIVATIONPATH:g" ./tmp/run.c
gcc -static -Os -flto ./tmp/run.c -o $APPNAME/run
end
## Modify and copy startup script.
if test -e ./$APPNAME/run.sh
true
else
cp ./run.sh tmp/run.sh
sed -i -e "s:APPNAME:$APPNAME:g" ./tmp/run.sh
sed -i -e "s:DERIVATIONPATH:$DERIVATIONPATH:g" ./tmp/run.sh
cp ./tmp/run.sh $APPNAME/run.sh
end
## Copy template .desktop file.
if test -e ./$APPNAME/$APPNAME.desktop
true
else
cp ./template.desktop ./$APPNAME/$APPNAME.desktop
sed -i -e "s:APPNAME:$APPNAME:g" ./$APPNAME/$APPNAME.desktop
end
## Create fake png icon.
if test -e ./$APPNAME/null.png
true
else
touch ./$APPNAME/null.png
end
## Copy appimagetool into build directory.
if test -e ./appimagetool.$APPNAME
true
else
cp (which appimagetool) ./appimagetool.$APPNAME
end