Rev 21777 | Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
21687 | mrdocs | 1 | #!/bin/bash |
2 | |||
3 | ######################################################################## |
||
4 | # Package the binaries built on Travis-CI as an AppImage |
||
5 | # By Simon Peter 2016 |
||
6 | # For more information, see http://appimage.org/ |
||
7 | ######################################################################## |
||
8 | |||
9 | export ARCH=$(arch) |
||
10 | |||
11 | APP=Scribus |
||
12 | LOWERAPP=${APP,,} |
||
13 | |||
14 | GIT_REV=$(git rev-parse --short HEAD) |
||
15 | echo $GIT_REV |
||
16 | make install DESTDIR=/home/travis/$APP/$APP.AppDir |
||
17 | |||
18 | cd $HOME/$APP/ |
||
19 | |||
20 | wget -q https://github.com/probonopd/AppImages/raw/master/functions.sh -O ./functions.sh |
||
21 | . ./functions.sh |
||
22 | |||
23 | cd $APP.AppDir |
||
24 | |||
25 | ######################################################################## |
||
26 | # Copy desktop and icon file to AppDir for AppRun to pick them up |
||
27 | ######################################################################## |
||
28 | |||
29 | get_apprun |
||
30 | |||
31 | find . -name *desktop -exec cp {} $LOWERAPP.desktop \; |
||
32 | |||
33 | cp ./usr/share/scribus/icons/1_5_1/scribus.png . |
||
34 | rm -rf usr/share/icons/hicolor/48x48/ |
||
35 | |||
36 | ######################################################################## |
||
37 | # Copy in the dependencies that cannot be assumed to be available |
||
38 | # on all target systems |
||
39 | ######################################################################## |
||
40 | |||
41 | # FIXME: How to find out which subset of plugins is really needed? |
||
42 | mkdir -p ./usr/lib/qt5/plugins/ |
||
43 | PLUGINS=/opt/qt57/plugins/ |
||
44 | cp -r $PLUGINS/* ./usr/lib/qt5/plugins/ |
||
45 | |||
46 | # Tcl/Tk, Tkinter (for Calendar script) |
||
47 | cp /usr/li*/python2.7/lib-dynload/_tkinter.so usr/ # It is indeed picked up here because we cd there at runtime |
||
48 | ldd usr/_tkinter.so | grep "=>" | awk '{print $3}' | xargs -I '{}' cp -v '{}' ./usr/lib || true |
||
49 | cp -r /usr/lib/tcltk usr/lib/ |
||
50 | cp -r /usr/share/tcltk usr/share/ |
||
51 | |||
52 | export LD_LIBRARY_PATH=/opt/qt57/lib/:LD_LIBRARY_PATH |
||
53 | copy_deps |
||
54 | |||
55 | # Move the libraries to usr/bin |
||
56 | move_lib |
||
57 | mv ./opt/qt57/lib/* usr/lib ; rm -rf ./opt |
||
58 | ( cd usr/lib/qt5/plugins/platforms/../../ ; ln -s ../../lib/ . ) |
||
59 | mv usr/lib/x86_64-linux-gnu/* usr/lib/ |
||
60 | |||
61 | ######################################################################## |
||
62 | # Delete stuff that should not go into the AppImage |
||
63 | ######################################################################## |
||
64 | |||
65 | # Delete dangerous libraries; see |
||
66 | # https://github.com/probonopd/AppImages/blob/master/excludelist |
||
67 | delete_blacklisted |
||
68 | |||
69 | # We don't bundle the developer stuff |
||
70 | rm -rf usr/include || true |
||
71 | rm -rf usr/lib/cmake || true |
||
72 | rm -rf usr/lib/pkgconfig || true |
||
73 | find . -name '*.la' | xargs -i rm {} |
||
74 | strip usr/bin/* usr/lib/* || true |
||
75 | |||
76 | ######################################################################## |
||
77 | # desktopintegration asks the user on first run to install a menu item |
||
78 | ######################################################################## |
||
79 | |||
80 | get_desktopintegration $LOWERAPP |
||
81 | |||
82 | ######################################################################## |
||
83 | # Determine the version of the app; also include needed glibc version |
||
84 | ######################################################################## |
||
85 | |||
86 | GLIBC_NEEDED=$(glibc_needed) |
||
87 | VERSION=git$GIT_REV-glibc$GLIBC_NEEDED |
||
88 | |||
89 | ######################################################################## |
||
90 | # Patch away absolute paths; it would be nice if they were relative |
||
91 | ######################################################################## |
||
92 | |||
93 | sed -i -e 's|/usr/share/scribus|././/share/scribus|g' usr/bin/scribus |
||
94 | sed -i -e 's|/usr/lib/scribus|././/lib/scribus|g' usr/bin/scribus |
||
95 | sed -i -e 's|/usr/share/doc/scribus/|././/share/doc/scribus/|g' usr/bin/scribus |
||
96 | # Possibly need to patch additional hardcoded paths away, replace |
||
97 | # "/usr" with "././" which means "usr/ in the AppDir" |
||
98 | |||
99 | ######################################################################## |
||
100 | # AppDir complete |
||
101 | # Now packaging it as an AppImage |
||
102 | ######################################################################## |
||
103 | |||
104 | cd .. # Go out of AppImage |
||
105 | |||
106 | mkdir -p ../out/ |
||
107 | generate_appimage |
||
108 | |||
109 | ######################################################################## |
||
110 | # Upload the AppDir |
||
111 | ######################################################################## |
||
112 | |||
113 | transfer ../out/* |