Rev 24665 | 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 | |||
24673 | jghali | 9 | SCRIBUS_VERSION=nightly |
10 | |||
11 | ######################################################################## |
||
12 | # Build Platform Theme for Gtk+ |
||
13 | # https://askubuntu.com/a/910143 |
||
14 | # https://askubuntu.com/a/748186 |
||
15 | # Deploy with linuxdeployqt using |
||
22822 | jghali | 16 | # -extra-plugins=platformthemes/libqgtk2.so,styles/libqgtk2style.so |
17 | # At runtime, export QT_QPA_PLATFORMTHEME=gtk2 (Xfce does this itself) |
||
21687 | mrdocs | 18 | ######################################################################## |
19 | |||
22822 | jghali | 20 | git clone http://code.qt.io/qt/qtstyleplugins.git |
21 | cd qtstyleplugins |
||
22 | qmake |
||
23 | make -j$(nproc) |
||
24 | make install |
||
25 | cd - |
||
21687 | mrdocs | 26 | |
27 | ######################################################################## |
||
22822 | jghali | 28 | # Build Scribus and install to appdir/ |
21687 | mrdocs | 29 | ######################################################################## |
30 | |||
23028 | jghali | 31 | cmake . -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ |
32 | -DCMAKE_C_COMPILER_LAUNCHER=ccache \ |
||
33 | -DCMAKE_INSTALL_PREFIX=/usr \ |
||
34 | -DWANT_RELOCATABLE=1 \ |
||
35 | -DWANT_HUNSPELL=1 \ |
||
36 | -DWITH_PODOFO=1 \ |
||
37 | -DWANT_GRAPHICSMAGICK=1 \ |
||
38 | -DWANT_DEBUG=0 \ |
||
23056 | jghali | 39 | -DWANT_SVNVERSION=0 |
22822 | jghali | 40 | make -j$(nproc) |
23028 | jghali | 41 | |
42 | make DESTDIR=appdir -j$(nproc) install |
||
43 | #find appdir/ |
||
44 | |||
45 | # TODO: make sure that the appdir directory exits |
||
46 | cp AppImage-package/AppRun appdir/ |
||
47 | chmod +x appdir/AppRun |
||
48 | |||
22822 | jghali | 49 | cp ./appdir/usr/share/icons/hicolor/256x256/apps/scribus.png ./appdir/ |
21687 | mrdocs | 50 | |
23028 | jghali | 51 | # TODO: is this needed? |
52 | sed -i -e 's|^Icon=.*|Icon=scribus|g' ./appdir/usr/share/applications/scribus.desktop |
||
53 | |||
21687 | mrdocs | 54 | ######################################################################## |
22822 | jghali | 55 | # Bundle everyhting |
56 | # to allow the AppImage to run on older systems as well |
||
21687 | mrdocs | 57 | ######################################################################## |
58 | |||
22822 | jghali | 59 | cd appdir/ |
21687 | mrdocs | 60 | |
22822 | jghali | 61 | # Bundle all of glibc; this should eventually be done by linuxdeployqt |
62 | apt-get update -q |
||
63 | apt-get download libc6 |
||
64 | find *.deb -exec dpkg-deb -x {} . \; |
||
65 | rm *deb |
||
21687 | mrdocs | 66 | |
22822 | jghali | 67 | # Make absolutely sure it will not load stuff from /lib or /usr |
68 | sed -i -e 's|/usr|/xxx|g' lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 |
||
69 | sed -i -e 's|/usr/lib|/ooo/ooo|g' lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 |
||
21687 | mrdocs | 70 | |
22822 | jghali | 71 | # Bundle fontconfig settings |
72 | mkdir -p etc/fonts/ |
||
73 | cp /etc/fonts/fonts.conf etc/fonts/ |
||
21687 | mrdocs | 74 | |
22822 | jghali | 75 | # Bundle Python |
23859 | jghali | 76 | apt-get download python3.6 python3.6-minimal libpython3.6-minimal libpython3.6-stdlib python3-tk |
22822 | jghali | 77 | find *.deb -exec dpkg-deb -x {} . \; |
78 | rm *deb |
||
79 | cd - |
||
80 | |||
21687 | mrdocs | 81 | ######################################################################## |
23028 | jghali | 82 | # Work around side effect of bundling everything |
21687 | mrdocs | 83 | ######################################################################## |
84 | |||
23028 | jghali | 85 | # https://github.com/scribusproject/scribus/issues/111#issuecomment-457823282 |
86 | # applicationDirPath() is not usr/bin but lib/x86_64-linux-gnu/ |
||
87 | # when AppRun invokes the binary with |
||
88 | # exec "${HERE}/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2" --inhibit-cache --library-path "${LIBRARY_PATH}" "${MAIN}" "$@" |
||
89 | # hence we add a symlink here to mitigate this |
||
90 | cd appdir/lib/ |
||
91 | ln -s ../usr/* . |
||
92 | cd - |
||
21687 | mrdocs | 93 | |
94 | ######################################################################## |
||
22822 | jghali | 95 | # Also bundle Tcl/Tk, Tkinter (for Calendar script) |
21687 | mrdocs | 96 | ######################################################################## |
97 | |||
22822 | jghali | 98 | mkdir -p appdir/usr/lib appdir/usr/share |
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 |
||
23151 | jghali | 124 | ARCH=x86_64 VERSION=$SCRIBUS_VERSION ./linuxdeployqt-continuous-x86_64.AppImage --appimage-extract-and-run appdir/usr/share/applications/scribus.desktop \ |
23298 | jghali | 125 | -appimage -unsupported-bundle-everything \ |
23859 | jghali | 126 | -executable=appdir/usr/bin/python3.6 \ |
127 | -executable=appdir/usr/lib/python3.6/lib-dynload/_tkinter.cpython-36m-x86_64-linux-gnu.so \ |
||
23298 | jghali | 128 | -extra-plugins=platformthemes/libqgtk2.so,styles/libqgtk2style.so |