forked from LibreSprite/LibreSprite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
package_linux.sh
61 lines (45 loc) · 1.34 KB
/
package_linux.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
52
53
54
55
56
57
58
59
60
61
#!/bin/sh
add()
{
echo "adding $1"
if [ -e "/usr/lib/x86_64-linux-gnu/$1" ]; then
src="/usr/lib/x86_64-linux-gnu"
elif [ -e "/usr/lib/x86_64-linux-gnu/pulseaudio/$1" ]; then
src="/usr/lib/x86_64-linux-gnu/pulseaudio"
elif [ -e "/usr/lib64/$1" ]; then
src="/usr/lib64"
fi
if [ $src != $out ]; then
cp "$src/$1" "$out/$1"
fi
dependencies=$(readelf -d "$src/$1" | grep NEEDED | sed -En "s/[^\[]*\[([^]]*)\S*/\1/gp")
for dependency in $dependencies
do
if [ ! -f "$out/$dependency" ]; then
add $dependency
fi
done
}
out=$(pwd)
src=$(pwd)
add "libresprite"
cp /usr/lib/libpthread.so* ./
cp /usr/lib/librt.so* ./
cp /usr/lib/libstdc++.so* ./
rm libc.so*
rm libm.so*
chmod +x libresprite
mkdir LibreSprite
mkdir LibreSprite/usr
mkdir LibreSprite/usr/bin
mkdir LibreSprite/usr/lib
mv ../../desktop/libresprite.desktop LibreSprite/
cp ../../desktop/icons/hicolor/256x256/apps/libresprite.png LibreSprite/libresprite.png
mv libresprite LibreSprite/usr/bin
mv data LibreSprite/usr/bin
mv *.so* LibreSprite/usr/lib
wget https://github.com/AppImage/AppImageKit/releases/download/13/AppRun-x86_64 -O LibreSprite/AppRun
chmod +x LibreSprite/AppRun
wget https://github.com/AppImage/AppImageKit/releases/download/13/appimagetool-x86_64.AppImage -O appimagetool
chmod +x appimagetool
./appimagetool LibreSprite