/
build-appimage-from-release
executable file
·47 lines (34 loc) · 1.05 KB
/
build-appimage-from-release
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
#!/usr/bin/env bash
# Exit on error
set -e
export ARCH=`uname -m`
if [ ! -d "$1" ] ; then
echo "Error: Program folder $1 not found!"
exit 1
fi
APPDIR=$1
wget -c -nv "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-$ARCH.AppImage"
chmod a+x appimagetool-$ARCH.AppImage
cp AppRun $APPDIR
chmod a+x $APPDIR/AppRun
cp metadata/org.freac.freac.desktop $APPDIR
cp $APPDIR/icons/freac.png $APPDIR/org.freac.freac.png
mkdir -p $APPDIR/usr/share/metainfo
cp metadata/org.freac.freac.appdata.xml $APPDIR/usr/share/metainfo
import_library () {
libdirs=( /usr/local/lib/$ARCH-linux-gnu /usr/local/lib64 /usr/local/lib /usr/lib/$ARCH-linux-gnu /usr/lib64 /usr/lib )
for libdir in ${libdirs[@]}; do
if ls $libdir/$1* 1> /dev/null 2>&1; then
cp $libdir/$1* $APPDIR
return
fi
done
echo "Error: Library $1 not found!"
return 1
}
import_library libcurl.so
import_library libssh2.so
import_library libssl.so
import_library libcrypto.so
import_library libidn.so
./appimagetool-$ARCH.AppImage $APPDIR $APPDIR.AppImage