-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-linux-image.sh
executable file
·51 lines (45 loc) · 1.23 KB
/
build-linux-image.sh
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
#!/bin/bash
# creates a custom JRE and self-contained launcher for application using AppImage
set -e
output_dir="custom-jre"
rm -rf "./$output_dir"
echo "--- building custom JRE ---"
jlink \
--add-modules "java.sql,java.naming,java.desktop,jdk.unsupported,jdk.crypto.ec" \
--output "$output_dir" \
--strip-debug \
--no-man-pages \
--no-header-files \
--compress=2
du -sh "$output_dir"
if [ ! -f ./target/*-standalone.jar ]; then
echo
echo "--- building app ---"
lein uberjar
fi
cp ./target/*-standalone.jar "$output_dir/app.jar"
echo
echo "--- building AppImage ---"
if [ ! -e appimagetool ]; then
wget \
-c "https://github.com/AppImage/AppImageKit/releases/download/12/appimagetool-x86_64.AppImage" \
-o appimagetool
mv appimagetool-x86_64.AppImage appimagetool
chmod +x appimagetool
fi
rm -rf ./AppDir
mkdir AppDir
mv "$output_dir" AppDir/usr
cp strongbox.desktop AppDir/
cp resources/strongbox.svg resources/strongbox.png AppDir/
cp AppRun AppDir/
du -sh AppDir/
rm -f strongbox.appimage # safer than 'rm -f strongbox'
ARCH=x86_64 ./appimagetool AppDir/ strongbox.appimage
mv strongbox.appimage strongbox
du -sh strongbox
echo
echo "--- cleaning up ---"
rm -rf AppDir
echo
echo "done."