forked from gqrx-sdr/gqrx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appimage.sh
executable file
·118 lines (101 loc) · 4.02 KB
/
appimage.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
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#!/bin/bash
# Simple recipe to generate an appimage for this app
#
# Options:
# * -u will upload your AppImage file after success to github under
# "continuous builds"
#
# Requirements:
# * VERSION as an ENV var, if not detected will use actual github
# version + commit info
# * This must be run after a successfully build, and need to set the
# APP var below to the path of the executable (default is the current
# travis build place: build/src/gqrx)
# * Must be run on a Linux version as old as the far distro you need to
# support, tested successfully on Ubuntu 14.04 Trusty Tar
# * If you plan to use the "-u" option you need to configure some things
# for it to work, check this https://github.com/probonopd/uploadtool#usage
#
# On any troubles invoke stdevPavelmc in github
# Tweak this please: this is the path of the gqrx executable relative to
#the project root will reside after build
APP="build/src/gqrx"
# No need to tweak below unless you move files on the actual project
DESKTOP="dk.gqrx.gqrx.desktop"
ICON="resources/icons/gqrx.svg"
# clean log space
echo "==================================================================="
echo " Starting to build the AppImage..."
echo "==================================================================="
echo ""
export VERSION=$(<build/version.txt)
# version notice
echo "You are building Gqrx version: $VERSION"
echo ""
# basic tests
if [ ! -f "$APP" ] ; then
echo "Error: the app file is no in the path we need it, update the APP var on this script"
exit 1
fi
if [ ! -f "$DESKTOP" ] ; then
echo "Error: can't find the desktop file, please update the DESKTOP var on the scriot"
exit 1
fi
if [ ! -f "$ICON" ] ; then
echo "Error: can't find the default icon, please update the ICON var in the script"
exit 1
fi
# prepare the ground
rm -rdf AppDir 2>/dev/null
rm -rdf Gqrx-*.AppImage 2>/dev/null
# download & set all needed tools
wget -c -nv "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage"
wget -c -nv "https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage"
wget -c -nv "https://github.com/linuxdeploy/linuxdeploy-plugin-appimage/releases/download/continuous/linuxdeploy-plugin-appimage-x86_64.AppImage"
chmod a+x *.AppImage
# abra-cadabra
mkdir -p ./AppDir/usr/lib
cp -R /usr/lib/x86_64-linux-gnu/SoapySDR/modules* ./AppDir/usr/soapy-modules
# force otherwise excluded libraries that we really need because of library
# dependence on newer versions
linuxdeploy_lib_args+=(
"-l" "$PREFIX"/lib/libasound.so.2
"-l" "$PREFIX"/lib/libexpat.so.1
"-l" "$PREFIX"/lib/libfontconfig.so.1
"-l" "$PREFIX"/lib/libfreetype.so.6
"-l" "$PREFIX"/lib/libgcc_s.so.1
"-l" "$PREFIX"/lib/libgmp.so.10
"-l" "$PREFIX"/lib/libgpg-error.so.0
"-l" "$PREFIX"/lib/libharfbuzz.so.0
"-l" "$PREFIX"/lib/libjack.so.0
"-l" "$PREFIX"/lib/libstdc++.so.6
"-l" "$PREFIX"/lib/libusb-1.0.so.0
"-l" "$PREFIX"/lib/libuuid.so.1
"-l" "$PREFIX"/lib/libxcb.so.1
"-l" "$PREFIX"/lib/libz.so.1
)
mkdir -p ./AppDir/apprun-hooks
echo 'export UHD_PKG_PATH="$APPDIR/usr"' >./AppDir/apprun-hooks/uhd-hook.sh
echo 'export FONTCONFIG_FILE="$APPDIR/etc/fonts/fonts.conf"
export FONTCONFIG_PATH="$APPDIR/etc/fonts"' >./AppDir/apprun-hooks/fontconfig-hook.sh
./linuxdeploy-x86_64.AppImage -e "$APP" -d "$DESKTOP" -i "$ICON" -p qt --output appimage --appdir=./AppDir
RESULT=$?
# check build success
if [ $RESULT -ne 0 ] ; then
# warning something gone wrong
echo ""
echo "ERROR: Aborting as something gone wrong, please check the logs"
exit 1
else
# success
echo ""
echo "Success build, check your file:"
ls -lh Gqrx-*.AppImage
fi
if [ "$1" == "-u" ] ; then
# must upload to continuous releases
# see https://github.com/probonopd/uploadtool#usage for configs to be done
# for this to work as needed
wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh
bash upload.sh Gqrx-*.AppImage
fi