Rev 21777 | Rev 23028 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
21687 | mrdocs | 1 | #!/bin/bash |
2 | |||
22822 | jghali | 3 | cat /proc/1/cgroup # Check if we run in Docker; https://github.com/AppImage/AppImageKit/issues/912 |
4 | |||
5 | . /opt/qt*/bin/qt*-env.sh || true |
||
6 | |||
21687 | mrdocs | 7 | ######################################################################## |
22822 | jghali | 8 | # Build Plaform Theme for Gtk+ |
21687 | mrdocs | 9 | ######################################################################## |
10 | |||
22822 | jghali | 11 | find /opt/qt*/| grep platform |
12 | #apt-get update |
||
13 | #apt-get -y install libgtk-3-dev libnotify-dev qt5113d |
||
14 | #git clone https://github.com/CrimsonAS/gtkplatform |
||
15 | #cd gtkplatform |
||
16 | #qmake |
||
17 | #make -j$(nproc) |
||
18 | #sudo make install |
||
19 | #cd - |
||
21687 | mrdocs | 20 | |
21 | ######################################################################## |
||
22822 | jghali | 22 | # https://askubuntu.com/a/910143 |
23 | # https://askubuntu.com/a/748186 |
||
24 | # Deploy with linuxdeployqt using |
||
25 | # -extra-plugins=platformthemes/libqgtk2.so,styles/libqgtk2style.so |
||
26 | # At runtime, export QT_QPA_PLATFORMTHEME=gtk2 (Xfce does this itself) |
||
21687 | mrdocs | 27 | ######################################################################## |
28 | |||
22822 | jghali | 29 | git clone http://code.qt.io/qt/qtstyleplugins.git |
30 | cd qtstyleplugins |
||
31 | qmake |
||
32 | make -j$(nproc) |
||
33 | make install |
||
34 | cd - |
||
21687 | mrdocs | 35 | |
36 | ######################################################################## |
||
22822 | jghali | 37 | # Build Scribus and install to appdir/ |
21687 | mrdocs | 38 | ######################################################################## |
39 | |||
22822 | jghali | 40 | cmake . -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_INSTALL_PREFIX=/usr -DWANT_HUNSPELL=1 -DWITH_PODOFO=1 -DWANT_GRAPHICSMAGICK=1 -DWANT_DEBUG=0 -DWANT_SVNVERSION=0 -DWANT_GUI_LANG=en_US |
41 | make -j$(nproc) |
||
42 | make DESTDIR=appdir -j$(nproc) install ; find appdir/ |
||
43 | cp AppImage-package/AppRun appdir/ ; chmod +x appdir/AppRun |
||
44 | cp ./appdir/usr/share/icons/hicolor/256x256/apps/scribus.png ./appdir/ |
||
45 | sed -i -e 's|^Icon=.*|Icon=scribus|g' ./appdir/usr/share/applications/scribus.desktop # Needed? |
||
21687 | mrdocs | 46 | |
47 | ######################################################################## |
||
22822 | jghali | 48 | # Bundle everyhting |
49 | # to allow the AppImage to run on older systems as well |
||
21687 | mrdocs | 50 | ######################################################################## |
51 | |||
22822 | jghali | 52 | cd appdir/ |
21687 | mrdocs | 53 | |
22822 | jghali | 54 | # Bundle all of glibc; this should eventually be done by linuxdeployqt |
55 | apt-get update -q |
||
56 | apt-get download libc6 |
||
57 | find *.deb -exec dpkg-deb -x {} . \; |
||
58 | rm *deb |
||
21687 | mrdocs | 59 | |
22822 | jghali | 60 | # Make absolutely sure it will not load stuff from /lib or /usr |
61 | sed -i -e 's|/usr|/xxx|g' lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 |
||
62 | sed -i -e 's|/usr/lib|/ooo/ooo|g' lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 |
||
21687 | mrdocs | 63 | |
22822 | jghali | 64 | # Bundle fontconfig settings |
65 | mkdir -p etc/fonts/ |
||
66 | cp /etc/fonts/fonts.conf etc/fonts/ |
||
21687 | mrdocs | 67 | |
22822 | jghali | 68 | # Bundle Python |
69 | apt-get download libpython2.7-stdlib python2.7 python2.7-minimal libpython2.7-minimal |
||
70 | find *.deb -exec dpkg-deb -x {} . \; |
||
71 | rm *deb |
||
72 | cd - |
||
73 | |||
21687 | mrdocs | 74 | ######################################################################## |
22822 | jghali | 75 | # Patch away absolute paths |
76 | # FIXME: It would be nice if they were relative |
||
21687 | mrdocs | 77 | ######################################################################## |
78 | |||
22822 | jghali | 79 | sed -i -e 's|/usr/share/scribus|././/share/scribus|g' appdir/usr/bin/scribus |
80 | sed -i -e 's|/usr/lib/scribus|././/lib/scribus|g' appdir/usr/bin/scribus |
||
81 | sed -i -e 's|/usr/share/doc/scribus/|././/share/doc/scribus/|g' appdir/usr/bin/scribus |
||
21687 | mrdocs | 82 | |
83 | ######################################################################## |
||
22822 | jghali | 84 | # Also bundle Tcl/Tk, Tkinter (for Calendar script) |
21687 | mrdocs | 85 | ######################################################################## |
86 | |||
22822 | jghali | 87 | mkdir -p appdir/usr/lib appdir/usr/share |
88 | cp /usr/li*/python2.7/lib-dynload/_tkinter.so appdir/usr/ # It is indeed picked up here because we cd there at runtime |
||
89 | cp -r /usr/lib/tcltk appdir/usr/lib/ |
||
90 | cp -r /usr/share/tcltk appdir/usr/share/ |
||
21687 | mrdocs | 91 | |
92 | ######################################################################## |
||
22822 | jghali | 93 | # Create extra qt.conf in a strange location; FIXME: why is this needed? |
21687 | mrdocs | 94 | ######################################################################## |
95 | |||
22822 | jghali | 96 | mkdir -p appdir/lib/x86_64-linux-gnu/ |
97 | cat > appdir/lib/x86_64-linux-gnu/qt.conf <<\EOF |
||
98 | # Why is this needed here? Bug? |
||
99 | [Paths] |
||
100 | Prefix = ../../usr |
||
101 | Plugins = plugins |
||
102 | Imports = qml |
||
103 | Qml2Imports = qml |
||
104 | EOF |
||
21687 | mrdocs | 105 | |
106 | ######################################################################## |
||
22822 | jghali | 107 | # Generate AppImage |
21687 | mrdocs | 108 | ######################################################################## |
109 | |||
22822 | jghali | 110 | # Finalize AppDir but do not turn into AppImage just yet |
111 | wget -c -nv "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage" |
||
112 | chmod a+x linuxdeployqt-continuous-x86_64.AppImage |
||
113 | ARCH=x86_64 ./linuxdeployqt-continuous-x86_64.AppImage --appimage-extract-and-run appdir/usr/share/applications/scribus.desktop \ |
||
114 | -appimage -unsupported-bundle-everything \ |
||
115 | -executable=appdir/usr/bin/python2.7 -executable=appdir/usr/_tkinter.so -extra-plugins=platformthemes/libqgtk2.so,styles/libqgtk2style.so |