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