aboutsummaryrefslogtreecommitdiffstats
path: root/appimage
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2018-02-18 04:41:02 +0100
committerJay Berkenbilt <ejb@ql.org>2018-02-18 05:39:14 +0100
commit1e86f3ab70ad20971a800089ec531f567dcc58da (patch)
tree6719dd2d510dad9a046e271e153a7c9f44543356 /appimage
parent356e71522856b73456bb82b3ddbd253f441fa209 (diff)
downloadqpdf-1e86f3ab70ad20971a800089ec531f567dcc58da.tar.zst
Complete .travis.yml and AppImage support (fixes #160, #161)
Diffstat (limited to 'appimage')
-rw-r--r--appimage/AppRun19
-rwxr-xr-xappimage/build-appimage36
-rw-r--r--appimage/qpdf.desktop7
3 files changed, 62 insertions, 0 deletions
diff --git a/appimage/AppRun b/appimage/AppRun
new file mode 100644
index 00000000..8a2e5935
--- /dev/null
+++ b/appimage/AppRun
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+# The purpose of this custom AppRun script is
+# to allow symlinking the AppImage and invoking
+# the corresponding binary depending on which
+# symlink was used to invoke the AppImage
+
+HERE="$(dirname "$(readlink -f "${0}")")"
+
+if [ ! -z $APPIMAGE ] ; then
+ BINARY_NAME=$(basename "$ARGV0")
+ if [ -e "$HERE/usr/bin/$BINARY_NAME" ] ; then
+ exec "$HERE/usr/bin/$BINARY_NAME" "$@"
+ else
+ exec "$HERE/usr/bin/qpdf" "$@"
+ fi
+else
+ exec "$HERE/usr/bin/qpdf" "$@"
+fi
diff --git a/appimage/build-appimage b/appimage/build-appimage
new file mode 100755
index 00000000..a00761be
--- /dev/null
+++ b/appimage/build-appimage
@@ -0,0 +1,36 @@
+#!/bin/sh
+set -ex
+here="$(dirname $(readlink -f "$0"))"
+top=$(dirname $here)
+cd $top
+appdir=$here/build/appdir
+rm -rf $here/build
+./autogen.sh
+./configure --prefix=/usr --enable-werror --enable-show-failed-test-output
+make -j$(nproc)
+make check
+mkdir -p $appdir
+make install DESTDIR=$appdir; find $appdir
+cd $here/build
+# Don't bundle developer stuff
+rm -rf appdir/usr/include appdir/usr/lib/pkgconfig appdir/usr/lib/*.{a,la,so}
+rm -rf appdir/usr/share/doc appdir/usr/share/man
+for i in appdir/usr/share/icons/hicolor/128x128/apps; do
+ mkdir -p $i
+ cp $top/logo/qpdf.svg $i
+ convert -resize '128x128>' $top/logo/qpdf.svg $i/qpdf.png
+done
+for i in appdir/usr/share/applications; do mkdir -p $i; cp $top/appimage/qpdf.desktop $i; done
+wget -c "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage"
+chmod a+x linuxdeployqt*.AppImage
+unset QTDIR; unset QT_PLUGIN_PATH ; unset LD_LIBRARY_PATH
+./linuxdeployqt*.AppImage appdir/usr/share/applications/*.desktop -bundle-non-qt-libs
+# In addition to the main executable, we have additional ones to process
+./linuxdeployqt*.AppImage appdir/usr/bin/zlib-flate -bundle-non-qt-libs
+# Generate AppImage
+./linuxdeployqt*.AppImage --appimage-extract
+rm appdir/AppRun ; cp $top/appimage/AppRun appdir; chmod a+x appdir/AppRun # Replace symlink with custom script
+PATH=./squashfs-root/usr/bin:$PATH ./squashfs-root/usr/bin/appimagetool appdir
+echo ""
+echo "*** AppImage is ready in appimage/build ***"
+echo ""
diff --git a/appimage/qpdf.desktop b/appimage/qpdf.desktop
new file mode 100644
index 00000000..b030a6db
--- /dev/null
+++ b/appimage/qpdf.desktop
@@ -0,0 +1,7 @@
+[Desktop Entry]
+Type=Application
+Terminal=true
+Exec=qpdf
+Name=QPDF
+Comment=Structural, content-preserving transformations on PDF files
+Icon=qpdf