summaryrefslogtreecommitdiffstats
path: root/packaging/appimage
diff options
context:
space:
mode:
authorprobonopd <probono@puredarwin.org>2019-01-14 17:51:50 +0000
committerMarc Jeanmougin <marcjeanmougin@free.fr>2019-01-14 17:51:50 +0000
commit24b5b6861dc80ef80c18cc0b26bb448b74500b1b (patch)
tree614298e171b7d37306f60d7740f9e636501f204b /packaging/appimage
parentstd::unique_ptr<_ObserverData> (diff)
downloadinkscape-24b5b6861dc80ef80c18cc0b26bb448b74500b1b.tar.gz
inkscape-24b5b6861dc80ef80c18cc0b26bb448b74500b1b.zip
Build and upload AppImage
Diffstat (limited to 'packaging/appimage')
-rw-r--r--packaging/appimage/AppRun69
-rw-r--r--packaging/appimage/generate.sh96
2 files changed, 165 insertions, 0 deletions
diff --git a/packaging/appimage/AppRun b/packaging/appimage/AppRun
new file mode 100644
index 000000000..6f01f31df
--- /dev/null
+++ b/packaging/appimage/AppRun
@@ -0,0 +1,69 @@
+#!/bin/bash
+
+HERE="$(dirname "$(readlink -f "${0}")")"
+
+# Custom AppRun script for Inkscape
+# by Simon Peter
+
+############################################################################################
+# Allow AppRun or the AppImage to be symlinked to, e.g.,
+# /usr/local/bin/inkview
+# or to be called with ./Inkscape*.AppImage inkview
+############################################################################################
+
+if [ ! -z $APPIMAGE ] ; then
+ BINARY_NAME=$(basename "$ARGV0")
+else
+ BINARY_NAME=$(basename "$0")
+fi
+if [ ! -z "$1" ] && [ -e "$HERE/bin/$1" ] ; then
+ MAIN="$HERE/bin/$1" ; shift
+elif [ ! -z "$1" ] && [ -e "$HERE/usr/bin/$1" ] ; then
+ MAIN="$HERE/usr/bin/$1" ; shift
+elif [ -e "$HERE/bin/$BINARY_NAME" ] ; then
+ MAIN="$HERE/bin/$BINARY_NAME"
+elif [ -e "$HERE/usr/bin/$BINARY_NAME" ] ; then
+ MAIN="$HERE/usr/bin/$BINARY_NAME"
+else
+ MAIN="$HERE/usr/bin/inkscape"
+fi
+
+############################################################################################
+# Prefer to run the bundled executables (e.g., Python)
+############################################################################################
+
+export PATH="${HERE}"/usr/bin/:"${HERE}"/usr/sbin/:"${HERE}"/usr/games/:"${HERE}"/bin/:"${HERE}"/sbin/:"${PATH}"
+
+############################################################################################
+# Use bundled Python
+############################################################################################
+
+export PYTHONHOME="$HERE/usr/"
+
+############################################################################################
+# Run experimental bundle that bundles everything if a private ld-linux-x86-64.so.2 is there
+############################################################################################
+
+if [ -e "$HERE/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2" ] ; then
+ echo "Run experimental bundle that bundles everything"
+ export GCONV_PATH="$HERE/usr/lib/x86_64-linux-gnu/gconv"
+ export FONTCONFIG_FILE="$HERE/etc/fonts/fonts.conf"
+ export LIBRARY_PATH="$HERE/usr/lib":$LIBRARY_PATH
+ export LIBRARY_PATH="$HERE/lib":$LIBRARY_PATH
+ export LIBRARY_PATH="$HERE/usr/lib/i386-linux-gnu":$LIBRARY_PATH
+ export LIBRARY_PATH="$HERE/lib/i386-linux-gnu":$LIBRARY_PATH
+ export LIBRARY_PATH="$HERE/usr/lib/i386-linux-gnu/pulseaudio":$LIBRARY_PATH
+ export LIBRARY_PATH="$HERE/usr/lib/i386-linux-gnu/alsa-lib":$LIBRARY_PATH
+ export LIBRARY_PATH="$HERE/usr/lib/x86_64-linux-gnu":$LIBRARY_PATH
+ export LIBRARY_PATH="$HERE/lib/x86_64-linux-gnu":$LIBRARY_PATH
+ export LIBRARY_PATH="$HERE/usr/lib/x86_64-linux-gnu/pulseaudio":$LIBRARY_PATH
+ export LIBRARY_PATH="$HERE/usr/lib/x86_64-linux-gnu/alsa-lib":$LIBRARY_PATH
+ export GTK_EXE_PREFIX="$HERE/usr"
+ export GDK_PIXBUF_MODULEDIR=$(readlink -f "$HERE"/usr/lib/x86_64-linux-gnu/gdk-pixbuf-*/*/loaders/ )
+ export GDK_PIXBUF_MODULE_FILE=$(readlink -f "$HERE"/usr/lib/x86_64-linux-gnu/gdk-pixbuf-*/*/loaders.cache ) # Patched to contain no paths
+ export LIBRARY_PATH=$GDK_PIXBUF_MODULEDIR:$LIBRARY_PATH # Otherwise getting "Unable to load image-loading module"
+ export GTK_THEME=Adwaita-dark # Or "Adwaita"
+ exec "${HERE}/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2" --inhibit-cache --library-path "${LIBRARY_PATH}" "${MAIN}" "$@"
+else
+ exec "${MAIN}" "$@"
+fi \ No newline at end of file
diff --git a/packaging/appimage/generate.sh b/packaging/appimage/generate.sh
new file mode 100644
index 000000000..71b1f0afc
--- /dev/null
+++ b/packaging/appimage/generate.sh
@@ -0,0 +1,96 @@
+#!/bin/bash
+
+########################################################################
+# Install build-time and run-time dependencies
+########################################################################
+
+export DEBIAN_FRONTEND=noninteractive
+
+# Backported pango (from 18.10) for variable font support
+add-apt-repository -y ppa:bryce/pango1.0
+apt-get update -yqq
+apt-get install -y libpango1.0-0 libpango1.0-dev
+
+########################################################################
+# Build Inkscape and install to appdir/
+########################################################################
+
+mkdir -p build && cd build
+cmake .. -DCMAKE_BUILD_TYPE=Release -DENABLE_BINRELOC=ON \
+-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_C_COMPILER_LAUNCHER=ccache \
+-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
+make -j$(nproc)
+make DESTDIR=appdir -j$(nproc) install ; find appdir/
+cp ../packaging/appimage/AppRun appdir/AppRun ; chmod +x appdir/AppRun
+( cd appdir/usr/lib/ ; ln -s ../* . ) # FIXME: Why is this needed?
+( cd appdir/ ; ln -s usr/* . ) # FIXME: Why is this needed?
+cp ./appdir/usr/share/icons/hicolor/256x256/apps/inkscape.png ./appdir/
+sed -i -e 's|^Icon=.*|Icon=inkscape|g' ./appdir/usr/share/applications/inkscape.desktop # FIXME
+cd appdir/
+
+########################################################################
+# Bundle everyhting
+# to allow the AppImage to run on older systems as well
+########################################################################
+
+# Bundle all of glibc; this should eventually be done by linuxdeployqt
+apt-get download libc6
+find *.deb -exec dpkg-deb -x {} . \;
+rm *deb
+
+# Make absolutely sure it will not load stuff from /lib or /usr
+sed -i -e 's|/usr|/xxx|g' lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
+sed -i -e 's|/usr/lib|/ooo/ooo|g' lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
+
+# Bundle Gdk pixbuf loaders without which the bundled Gtk does not work;
+# this should eventually be done by linuxdeployqt
+apt-get download librsvg2-common libgdk-pixbuf2.0-0
+find *.deb -exec dpkg-deb -x {} . \;
+rm *deb
+cp /usr/lib/x86_64-linux-gnu/gdk-pixbuf-*/*/loaders/* usr/lib/x86_64-linux-gnu/gdk-pixbuf-*/*/loaders/
+cp /usr/lib/x86_64-linux-gnu/gdk-pixbuf-*/*/loaders.cache usr/lib/x86_64-linux-gnu/gdk-pixbuf-*/*/
+sed -i -e 's|/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/||g' usr/lib/x86_64-linux-gnu/gdk-pixbuf-*/*/loaders.cache
+
+# Optionally bundle Gtk+ themes
+apt-get download gnome-themes-extra gnome-themes-extra-data adwaita-icon-theme-full
+find *.deb -exec dpkg-deb -x {} . \;
+rm *deb
+
+# Bundle fontconfig settings
+mkdir -p etc/fonts/
+cp /etc/fonts/fonts.conf etc/fonts/
+
+# Bundle Python
+apt-get download libpython2.7-stdlib python2.7 python2.7-minimal libpython2.7-minimal python-lxml
+find *.deb -exec dpkg-deb -x {} . \;
+rm *deb
+cd -
+
+########################################################################
+# Generate AppImage
+########################################################################
+
+wget -c -nv "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage"
+chmod a+x linuxdeployqt-continuous-x86_64.AppImage
+
+./linuxdeployqt-continuous-x86_64.AppImage --appimage-extract-and-run appdir/usr/share/applications/inkscape.desktop \
+ -appimage -unsupported-bundle-everything -executable=appdir/usr/bin/inkview \
+ -executable=appdir/usr/lib/inkscape/libinkscape_base.so \
+ -executable=$(readlink -f appdir/usr/lib/x86_64-linux-gnu/gdk-pixbuf-*/*/loaders/libpixbufloader-xpm.so) \
+ -executable=$(readlink -f appdir/usr/lib/x86_64-linux-gnu/gdk-pixbuf-*/*/loaders/libpixbufloader-xbm.so) \
+ -executable=$(readlink -f appdir/usr/lib/x86_64-linux-gnu/gdk-pixbuf-*/*/loaders/libpixbufloader-tiff.so) \
+ -executable=$(readlink -f appdir/usr/lib/x86_64-linux-gnu/gdk-pixbuf-*/*/loaders/libpixbufloader-tga.so) \
+ -executable=$(readlink -f appdir/usr/lib/x86_64-linux-gnu/gdk-pixbuf-*/*/loaders/libpixbufloader-svg.so) \
+ -executable=$(readlink -f appdir/usr/lib/x86_64-linux-gnu/gdk-pixbuf-*/*/loaders/libpixbufloader-qtif.so) \
+ -executable=$(readlink -f appdir/usr/lib/x86_64-linux-gnu/gdk-pixbuf-*/*/loaders/libpixbufloader-pnm.so) \
+ -executable=$(readlink -f appdir/usr/lib/x86_64-linux-gnu/gdk-pixbuf-*/*/loaders/libpixbufloader-png.so) \
+ -executable=$(readlink -f appdir/usr/lib/x86_64-linux-gnu/gdk-pixbuf-*/*/loaders/libpixbufloader-jpeg.so) \
+ -executable=$(readlink -f appdir/usr/lib/x86_64-linux-gnu/gdk-pixbuf-*/*/loaders/libpixbufloader-ico.so) \
+ -executable=$(readlink -f appdir/usr/lib/x86_64-linux-gnu/gdk-pixbuf-*/*/loaders/libpixbufloader-icns.so) \
+ -executable=$(readlink -f appdir/usr/lib/x86_64-linux-gnu/gdk-pixbuf-*/*/loaders/libpixbufloader-gif.so) \
+ -executable=$(readlink -f appdir/usr/lib/x86_64-linux-gnu/gdk-pixbuf-*/*/loaders/libpixbufloader-bmp.so) \
+ -executable=$(readlink -f appdir/usr/lib/x86_64-linux-gnu/gdk-pixbuf-*/*/loaders/libpixbufloader-ani.so) \
+ -executable=$(readlink -f appdir/usr/lib/x86_64-linux-gnu/gtk-*/*/engines/libadwaita.so) \
+ -executable=appdir/usr/bin/python2.7
+
+mv Inkscape*.AppImage* ../ \ No newline at end of file