]> granicus.if.org Git - imagemagick/commitdiff
Generate AppImage
authorprobonopd <probonopd@users.noreply.github.com>
Thu, 9 Nov 2017 18:32:56 +0000 (19:32 +0100)
committerDirk Lemstra <dlemstra@users.noreply.github.com>
Sun, 12 Nov 2017 18:11:45 +0000 (19:11 +0100)
.travis.yml
AppRun [new file with mode: 0644]
imagemagick.desktop [new file with mode: 0644]

index 874810d90dc92508401dfb481f44480d174793d7..2a0f78f76abdb77762eb3adadefe741ba7c486fc 100644 (file)
@@ -3,7 +3,6 @@ dist: trusty   # needed for HarfBuzz
 
 language: c
 
-
 compiler:
   - clang
   - gcc
@@ -17,10 +16,33 @@ before_script:
   - sudo apt-get install -y libraqm-dev libfreetype6-dev libharfbuzz-dev libfribidi-dev
 
 script:
-    - export OMP_NUM_THREADS=1
-    - export CFLAGS="-Wno-deprecated-declarations -Wdeclaration-after-statement -Wno-error=unused-variable"
-    - ./configure --disable-openmp --with-quantum-depth=16 --enable-hdri=no --with-perl
-    - make
+  - export OMP_NUM_THREADS=1
+  - export CFLAGS="-Wno-deprecated-declarations -Wdeclaration-after-statement -Wno-error=unused-variable"
+  - ./configure --disable-openmp --with-quantum-depth=16 --enable-hdri=no --without-perl --prefix=/usr
+  - make -j$(nproc)
+  - # Generate AppImage
+  - make install DESTDIR=$(readlink -f appdir) ; find appdir/
+  - mkdir -p appdir/usr/share/applications/ ; cp imagemagick.desktop appdir/usr/share/applications/
+  - mkdir -p appdir/usr/share/icons/hicolor/128x128/apps/ ; touch appdir/usr/share/icons/hicolor/128x128/apps/imagemagick.png # FIXME
+  - 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
+  - export VERSION=$(git rev-parse --short HEAD)-$CC
+  - ./linuxdeployqt*.AppImage ./appdir/usr/share/applications/imagemagick.desktop -bundle-non-qt-libs
+  - ./linuxdeployqt*.AppImage --appimage-extract
+  - rm ./appdir/AppRun ; cp AppRun appdir/ ; chmod a+x ./appdir/AppRun # Replace symlink with custom script
+  - PATH=./squashfs-root/usr/bin:$PATH ./squashfs-root/usr/bin/appimagetool -g ./appdir/
+
+after_success:
+  - find ./appdir -executable -type f -exec ldd {} \; | grep " => /usr" | cut -d " " -f 2-3 | sort | uniq
+  - wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh
+  - bash upload.sh ImageMagick*AppImage*
+  
+branches:
+  except:
+    - # Do not build tags that we create when we upload to GitHub Releases
+    - /^(?i:continuous)$/
+
 #    - cd PerlMagick
 #    - perl Makefile.PL
 #    - make
diff --git a/AppRun b/AppRun
new file mode 100644 (file)
index 0000000..36c09ea
--- /dev/null
+++ b/AppRun
@@ -0,0 +1,30 @@
+#!/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}")")"
+
+export MAGICK_HOME="$HERE/usr" # http://www.imagemagick.org/QuickStart.txt
+export MAGICK_CONFIGURE_PATH="$HERE/usr/lib/ImageMagick-7.0.7/config-Q16/" # Undocumented?
+export MANPATH="$HERE/usr/share/man:$MANPATH"
+export INFOPATH="$HERE/usr/share/info:$MANPATH"
+
+if [ "$1" == "man" ] ; then
+  shift ; exec "$@" ; exit $?
+elif [ "$1" == "info" ] ; then
+  shift ; exec "$@" ; exit $?
+fi
+
+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/magick" "$@"
+  fi
+else
+  exec "$HERE/usr/bin/magick" "$@"
+fi
diff --git a/imagemagick.desktop b/imagemagick.desktop
new file mode 100644 (file)
index 0000000..b21e9e0
--- /dev/null
@@ -0,0 +1,8 @@
+[Desktop Entry]
+Name=ImageMagick
+Type=Application
+Exec=magick
+Icon=imagemagick
+Comment=Create, edit, compose, or convert bitmap images
+Categories=Graphics;
+Terminal=true