]> sigrok.org Git - sigrok-util.git/blob - cross-compile/appimage/sigrok-native-appimage
6ea6b9f310bc2eaa85316f07192f165c7a2dd7fb
[sigrok-util.git] / cross-compile / appimage / sigrok-native-appimage
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
11 PREFIX=$HOME/sr
12
13 ARCH=x86_64
14
15 APP=PulseView
16 LOWERAPP=${APP,,} 
17
18 A="./$APP/$APP.AppDir"
19 mkdir -p $A/usr/bin $A/usr/lib $A/usr/share
20 cd ./$APP
21
22 . ../contrib/functions.sh
23
24 ########################################################################
25 # Get build products from $PREFIX
26 ########################################################################
27
28 cd $APP.AppDir/
29
30 cp $PREFIX/bin/pulseview usr/bin/
31 chmod a+x usr/bin/*
32 cp $PREFIX/lib/lib*.so* usr/lib/
33 cp -r $PREFIX/share/libsigrokdecode usr/share/
34 cp -r $PREFIX/share/sigrok-firmware usr/share/
35
36 # Reduce binary size
37 strip usr/bin/*
38 strip usr/lib/*
39
40 ########################################################################
41 # AppRun is the main launcher that gets executed when AppImage is run
42 ########################################################################
43
44 get_apprun
45
46 ########################################################################
47 # Copy desktop and icon file to AppDir for AppRun to pick them up
48 ########################################################################
49
50 cp ../../contrib/pulseview.desktop ../../contrib/sigrok-logo-notext.png .
51
52 ########################################################################
53 # Copy in the dependencies that cannot be assumed to be available
54 # on all target systems
55 ########################################################################
56
57 copy_deps
58
59 ########################################################################
60 # Delete stuff that should not go into the AppImage
61 ########################################################################
62
63 delete_blacklisted
64 move_lib
65 mv ./usr/lib/x86_64-linux-gnu/* usr/lib/
66 rm -r ./usr/lib/x86_64-linux-gnu/
67
68 # Remove some incorrectly/unintentionally copied files.
69 rm -r ./home
70
71 ########################################################################
72 # Determine the version of the app; also include needed glibc version
73 ########################################################################
74
75 VER1="NIGHTLY"
76 GLIBC_NEEDED=$(glibc_needed)
77 VERSION=$VER1.glibc$GLIBC_NEEDED
78 echo $VERSION
79
80 ########################################################################
81 # Patch away absolute paths; it would be nice if they were relative
82 ########################################################################
83
84 patch_usr
85
86 ########################################################################
87 # AppDir complete
88 # Now packaging it as an AppImage
89 ########################################################################
90
91 cd ..
92
93 generate_appimage