4 # This file is licensed under the terms of the MIT license.
6 # Bundle PulseView and its dependencies as an AppImage for x86_64 Linux
7 # TODO: Change it to use build products and libraries from a more mature
8 # distribution such as Debian oldstable, CentOS 6 or Ubuntu Trusty or older.
15 mkdir -p ./$APP/$APP.AppDir/usr/bin ./$APP/$APP.AppDir/usr/lib
18 wget -q https://github.com/probonopd/AppImages/raw/master/functions.sh -O ./functions.sh
21 ########################################################################
22 # Get runtime dependencies
23 ########################################################################
27 # The following are installed into the host system so that we can bundle them into the AppImage as dependencies
28 sudo apt-get -y --force-yes install libqt5svg5 libqt5gui5 libboost-thread1.58.0 libboost-test1.58.0 libboost-chrono1.58.0 libboost-atomic1.58.0 libftdi1-2 libzip4
30 ########################################################################
31 # Get build products from Jenkins
32 # FIXME: Do the actual building here instead
33 ########################################################################
35 wget http://sigrok.org/jenkins/job/pulseview/buildtype=shared,compiler=gcc,platform=native-amd64/ws/_inst/bin/*zip*/bin.zip
38 FW=$(wget -q "http://sigrok.org/download/binary/sigrok-firmware-fx2lafw/?C=M;O=D" -O - | grep .tar.gz | head -n 1 | cut -d '"' -f 13 | cut -d ">" -f 2 | cut -d "<" -f 1)
39 wget -c "http://sigrok.org/download/binary/sigrok-firmware-fx2lafw/$FW"
40 tar xf sigrok-firmware-fx2lafw-bin-*.tar.gz
41 rm sigrok-firmware-fx2lafw-bin-*.tar.gz
45 mv ../bin/pulseview usr/bin/
49 wget http://sigrok.org/jenkins/job/libsigrok/buildtype=shared,compiler=gcc,platform=native-amd64/ws/_inst/lib/libsigrok.so.3
50 wget http://sigrok.org/jenkins/job/libsigrok/buildtype=shared,compiler=gcc,platform=native-amd64/ws/_inst/lib/libsigrokcxx.so.3
51 wget http://sigrok.org/jenkins/job/libserialport/buildtype=shared,compiler=gcc,platform=native-amd64/lastSuccessfulBuild/artifact/_inst/lib/libserialport.so.0
54 wget "http://sigrok.org/jenkins/job/libsigrokdecode/buildtype=shared,compiler=gcc,platform=native-amd64/lastSuccessfulBuild/artifact/*zip*/archive.zip"
56 mv archive/_inst/share/libsigrokdecode usr/share/libsigrokdecode
57 mv archive/_inst/lib/libsigrokdecode.so.3 usr/lib/
64 ########################################################################
65 # AppRun is the main launcher that gets executed when AppImage is run
66 ########################################################################
70 ########################################################################
71 # Copy desktop and icon file to AppDir for AppRun to pick them up
72 ########################################################################
74 wget http://sigrok.org/jenkins/job/pulseview/buildtype=shared,compiler=gcc,platform=native-amd64/ws/contrib/pulseview.desktop
75 wget -q "http://sigrok.org/gitweb/?p=pulseview.git;a=blob_plain;f=icons/sigrok-logo-notext.png" -O sigrok-logo-notext.png
77 ########################################################################
78 # Patch away absolute paths; it would be nice if they were relative
79 ########################################################################
81 sed -i -e 's|/home/jenkins_slave/fsroot/workspace/libsigrokdecode/buildtype/shared/compiler/gcc/platform/native-amd64/_inst/share/|.//////////////////////////////////////////////////////////////////////////////////////////////////////////////share/|g' usr/lib/libsigrokdecode.so.3
83 ########################################################################
84 # Copy in the dependencies that cannot be assumed to be available
85 # on all target systems
86 ########################################################################
89 mv ../sigrok-firmware-* usr/share/sigrok-firmware
93 ########################################################################
94 # Delete stuff that should not go into the AppImage
95 ########################################################################
99 mv ./usr/lib/x86_64-linux-gnu/* usr/lib/
100 rm -r ./usr/lib/x86_64-linux-gnu/
102 ########################################################################
103 # Determine the version of the app; also include needed glibc version
104 ########################################################################
106 VER1=$(./AppRun --version | cut -d " " -f 2)
107 GLIBC_NEEDED=$(glibc_needed)
108 VERSION=$VER1.glibc$GLIBC_NEEDED
111 ########################################################################
112 # Patch away absolute paths; it would be nice if they were relative
113 ########################################################################
117 ########################################################################
119 # Now packaging it as an AppImage
120 ########################################################################