Rev 22822 | Rev 23056 | 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 | |||
23028 | jghali | 5 | # for docker images: |
6 | # if qt is not in the standard path, load its environment variables |
||
22822 | jghali | 7 | . /opt/qt*/bin/qt*-env.sh || true |
8 | |||
21687 | mrdocs | 9 | ######################################################################## |
22822 | jghali | 10 | # Build Plaform Theme for Gtk+ |
11 | # https://askubuntu.com/a/910143 |
||
12 | # https://askubuntu.com/a/748186 |
||
13 | # Deploy with linuxdeployqt using |
||
14 | # -extra-plugins=platformthemes/libqgtk2.so,styles/libqgtk2style.so |
||
15 | # At runtime, export QT_QPA_PLATFORMTHEME=gtk2 (Xfce does this itself) |
||
21687 | mrdocs | 16 | ######################################################################## |
17 | |||
22822 | jghali | 18 | git clone http://code.qt.io/qt/qtstyleplugins.git |
19 | cd qtstyleplugins |
||
20 | qmake |
||
21 | make -j$(nproc) |
||
22 | make install |
||
23 | cd - |
||
21687 | mrdocs | 24 | |
25 | ######################################################################## |
||
22822 | jghali | 26 | # Build Scribus and install to appdir/ |
21687 | mrdocs | 27 | ######################################################################## |
28 | |||
23028 | jghali | 29 | cmake . -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ |
30 | -DCMAKE_C_COMPILER_LAUNCHER=ccache \ |
||
31 | -DCMAKE_INSTALL_PREFIX=/usr \ |
||
32 | -DWANT_RELOCATABLE=1 \ |
||
33 | -DWANT_HUNSPELL=1 \ |
||
34 | -DWITH_PODOFO=1 \ |
||
35 | -DWANT_GRAPHICSMAGICK=1 \ |
||
36 | -DWANT_DEBUG=0 \ |
||
37 | -DWANT_SVNVERSION=0 \ |
||
38 | -DWANT_GUI_LANG=en_US;de;fr;it |
||
22822 | jghali | 39 | make -j$(nproc) |
23028 | jghali | 40 | |
41 | make DESTDIR=appdir -j$(nproc) install |
||
42 | #find appdir/ |
||
43 | |||
44 | # TODO: make sure that the appdir directory exits |
||
45 | cp AppImage-package/AppRun appdir/ |
||
46 | chmod +x appdir/AppRun |
||
47 | |||
22822 | jghali | 48 | cp ./appdir/usr/share/icons/hicolor/256x256/apps/scribus.png ./appdir/ |
21687 | mrdocs | 49 | |
23028 | jghali | 50 | # TODO: is this needed? |
51 | sed -i -e 's|^Icon=.*|Icon=scribus|g' ./appdir/usr/share/applications/scribus.desktop |
||
52 | |||
21687 | mrdocs | 53 | ######################################################################## |
22822 | jghali | 54 | # Bundle everyhting |
55 | # to allow the AppImage to run on older systems as well |
||
21687 | mrdocs | 56 | ######################################################################## |
57 | |||
22822 | jghali | 58 | cd appdir/ |
21687 | mrdocs | 59 | |
22822 | jghali | 60 | # Bundle all of glibc; this should eventually be done by linuxdeployqt |
61 | apt-get update -q |
||
62 | apt-get download libc6 |
||
63 | find *.deb -exec dpkg-deb -x {} . \; |
||
64 | rm *deb |
||
21687 | mrdocs | 65 | |
22822 | jghali | 66 | # Make absolutely sure it will not load stuff from /lib or /usr |
67 | sed -i -e 's|/usr|/xxx|g' lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 |
||
68 | sed -i -e 's|/usr/lib|/ooo/ooo|g' lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 |
||
21687 | mrdocs | 69 | |
22822 | jghali | 70 | # Bundle fontconfig settings |
71 | mkdir -p etc/fonts/ |
||
72 | cp /etc/fonts/fonts.conf etc/fonts/ |
||
21687 | mrdocs | 73 | |
22822 | jghali | 74 | # Bundle Python |
75 | apt-get download libpython2.7-stdlib python2.7 python2.7-minimal libpython2.7-minimal |
||
76 | find *.deb -exec dpkg-deb -x {} . \; |
||
77 | rm *deb |
||
78 | cd - |
||
79 | |||
21687 | mrdocs | 80 | ######################################################################## |
23028 | jghali | 81 | # Work around side effect of bundling everything |
21687 | mrdocs | 82 | ######################################################################## |
83 | |||
23028 | jghali | 84 | # https://github.com/scribusproject/scribus/issues/111#issuecomment-457823282 |
85 | # applicationDirPath() is not usr/bin but lib/x86_64-linux-gnu/ |
||
86 | # when AppRun invokes the binary with |
||
87 | # exec "${HERE}/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2" --inhibit-cache --library-path "${LIBRARY_PATH}" "${MAIN}" "$@" |
||
88 | # hence we add a symlink here to mitigate this |
||
89 | cd appdir/lib/ |
||
90 | ln -s ../usr/* . |
||
91 | cd - |
||
21687 | mrdocs | 92 | |
93 | ######################################################################## |
||
22822 | jghali | 94 | # Also bundle Tcl/Tk, Tkinter (for Calendar script) |
21687 | mrdocs | 95 | ######################################################################## |
96 | |||
22822 | jghali | 97 | mkdir -p appdir/usr/lib appdir/usr/share |
98 | cp /usr/li*/python2.7/lib-dynload/_tkinter.so appdir/usr/ # It is indeed picked up here because we cd there at runtime |
||
99 | cp -r /usr/lib/tcltk appdir/usr/lib/ |
||
100 | cp -r /usr/share/tcltk appdir/usr/share/ |
||
21687 | mrdocs | 101 | |
102 | ######################################################################## |
||
23028 | jghali | 103 | # Create extra qt.conf in a strange location; |
104 | # FIXME: why is this needed? |
||
21687 | mrdocs | 105 | ######################################################################## |
106 | |||
22822 | jghali | 107 | mkdir -p appdir/lib/x86_64-linux-gnu/ |
108 | cat > appdir/lib/x86_64-linux-gnu/qt.conf <<\EOF |
||
109 | # Why is this needed here? Bug? |
||
110 | [Paths] |
||
111 | Prefix = ../../usr |
||
112 | Plugins = plugins |
||
113 | Imports = qml |
||
114 | Qml2Imports = qml |
||
115 | EOF |
||
21687 | mrdocs | 116 | |
117 | ######################################################################## |
||
22822 | jghali | 118 | # Generate AppImage |
21687 | mrdocs | 119 | ######################################################################## |
120 | |||
22822 | jghali | 121 | # Finalize AppDir but do not turn into AppImage just yet |
122 | wget -c -nv "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage" |
||
123 | chmod a+x linuxdeployqt-continuous-x86_64.AppImage |
||
124 | ARCH=x86_64 ./linuxdeployqt-continuous-x86_64.AppImage --appimage-extract-and-run appdir/usr/share/applications/scribus.desktop \ |
||
125 | -appimage -unsupported-bundle-everything \ |
||
23028 | jghali | 126 | -executable=appdir/usr/bin/python2.7 -executable=appdir/usr/_tkinter.so -extra-plugins=platformthemes/libqgtk2.so,styles/libqgtk2style.so |