]> sigrok.org Git - sigrok-util.git/blame_incremental - cross-compile/appimage/sigrok-native-appimage
sigrok-native-appimage: Fix order of delete_blacklisted() call.
[sigrok-util.git] / cross-compile / appimage / sigrok-native-appimage
... / ...
CommitLineData
1#!/bin/bash
2##
3## Copyright (C) 2016 Simon Peter
4## Copyright (C) 2017 Uwe Hermann <uwe@hermann-uwe.de>
5## This file is licensed under the terms of the MIT license.
6##
7
8# Bundle PulseView and its dependencies as an AppImage for x86_64 Linux.
9# Note: This assumes the full sigrok stack has been installed into $PREFIX.
10
11PREFIX=$HOME/sr
12
13APPIMAGEKIT_OUTDIR=$HOME/AppImageKit/out
14
15ARCH=x86_64
16
17########################################################################
18# You usually don't have to change anything below this line
19########################################################################
20
21APP=PulseView
22LOWERAPP=${APP,,}
23
24export STATIC_FILES=`pwd`/contrib
25
26# Add $APPIMAGEKIT_OUTDIR so we can find all the binaries there.
27export PATH=$APPIMAGEKIT_OUTDIR:$PATH
28
29A="./$APP/$APP.AppDir"
30mkdir -p $A/usr/bin $A/usr/lib $A/usr/share
31cd ./$APP
32
33. $STATIC_FILES/functions.sh
34
35########################################################################
36# Get build products from $PREFIX
37########################################################################
38
39cd $APP.AppDir/
40
41cp $PREFIX/bin/pulseview usr/bin/
42chmod a+x usr/bin/*
43cp $PREFIX/lib/lib*.so* usr/lib/
44cp -r $PREFIX/share/libsigrokdecode usr/share/
45cp -r $PREFIX/share/sigrok-firmware usr/share/
46
47# Reduce binary size
48strip usr/bin/*
49strip usr/lib/*
50
51########################################################################
52# AppRun is the main launcher that gets executed when AppImage is run
53########################################################################
54
55cp $APPIMAGEKIT_OUTDIR/AppRun .
56
57########################################################################
58# Copy desktop and icon file to AppDir for AppRun to pick them up
59########################################################################
60
61cp $STATIC_FILES/pulseview.desktop .
62cp $STATIC_FILES/sigrok-logo-notext.png .
63
64########################################################################
65# Copy in the dependencies that cannot be assumed to be available
66# on all target systems
67########################################################################
68
69copy_deps
70
71# Get all Qt5 plugins (won't be copied automatically).
72QT5PLUGINS=/usr/lib/x86_64-linux-gnu/qt5/plugins # Host (+ AppRun) path.
73mkdir -p .$QT5PLUGINS
74cp -r $QT5PLUGINS/accessible .$QT5PLUGINS
75cp -r $QT5PLUGINS/generic .$QT5PLUGINS
76cp -r $QT5PLUGINS/iconengines .$QT5PLUGINS
77cp -r $QT5PLUGINS/imageformats .$QT5PLUGINS
78cp -r $QT5PLUGINS/platforminputcontexts .$QT5PLUGINS
79cp -r $QT5PLUGINS/platforms .$QT5PLUGINS
80
81########################################################################
82# Delete stuff that should not go into the AppImage
83########################################################################
84
85move_lib
86mv ./usr/lib/x86_64-linux-gnu/* usr/lib/
87rm -r ./usr/lib/x86_64-linux-gnu/
88
89delete_blacklisted
90
91# Remove some incorrectly/unintentionally copied files.
92rm -r ./home
93
94########################################################################
95# Determine the version of the app; also include needed glibc version
96########################################################################
97
98VER1="NIGHTLY"
99GLIBC_NEEDED=$(glibc_needed)
100VERSION=$VER1.glibc$GLIBC_NEEDED
101echo $VERSION
102
103########################################################################
104# Patch away absolute paths; it would be nice if they were relative
105########################################################################
106
107find usr/ -type f -executable -exec sed -i -e "s|/usr|././|g" {} \;
108
109########################################################################
110# AppDir complete
111# Now packaging it as an AppImage
112########################################################################
113
114cd ..
115
116VERSION=$VERSION $APPIMAGEKIT_OUTDIR/appimagetool ./$APP.AppDir/
117mkdir -p ../out/ || true
118mv *.AppImage* ../out/