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