]>
Commit | Line | Data |
---|---|---|
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 | wget -q https://github.com/probonopd/AppImages/raw/master/functions.sh -O ./functions.sh | |
23 | . ./functions.sh | |
24 | ||
25 | ######################################################################## | |
26 | # Get build products from $PREFIX | |
27 | ######################################################################## | |
28 | ||
29 | cd $APP.AppDir/ | |
30 | ||
31 | cp $PREFIX/bin/pulseview usr/bin/ | |
32 | chmod a+x usr/bin/* | |
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/ | |
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 | cp ../../contrib/pulseview.desktop ../../contrib/sigrok-logo-notext.png . | |
52 | ||
53 | ######################################################################## | |
54 | # Copy in the dependencies that cannot be assumed to be available | |
55 | # on all target systems | |
56 | ######################################################################## | |
57 | ||
58 | copy_deps | |
59 | ||
60 | ######################################################################## | |
61 | # Delete stuff that should not go into the AppImage | |
62 | ######################################################################## | |
63 | ||
64 | delete_blacklisted | |
65 | move_lib | |
66 | mv ./usr/lib/x86_64-linux-gnu/* usr/lib/ | |
67 | rm -r ./usr/lib/x86_64-linux-gnu/ | |
68 | ||
69 | # Remove some incorrectly/unintentionally copied files. | |
70 | rm -r ./home | |
71 | ||
72 | ######################################################################## | |
73 | # Determine the version of the app; also include needed glibc version | |
74 | ######################################################################## | |
75 | ||
76 | VER1="NIGHTLY" | |
77 | GLIBC_NEEDED=$(glibc_needed) | |
78 | VERSION=$VER1.glibc$GLIBC_NEEDED | |
79 | echo $VERSION | |
80 | ||
81 | ######################################################################## | |
82 | # Patch away absolute paths; it would be nice if they were relative | |
83 | ######################################################################## | |
84 | ||
85 | patch_usr | |
86 | ||
87 | ######################################################################## | |
88 | # AppDir complete | |
89 | # Now packaging it as an AppImage | |
90 | ######################################################################## | |
91 | ||
92 | cd .. | |
93 | ||
94 | generate_appimage |