From: probonopd Date: Thu, 9 Nov 2017 18:32:56 +0000 (+0100) Subject: Generate AppImage X-Git-Tag: 7.0.7-12~96 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4b45830bd5dedc8b5a64ac7c15186b64f1ec08b7;p=imagemagick Generate AppImage --- diff --git a/.travis.yml b/.travis.yml index 874810d90..2a0f78f76 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 index 000000000..36c09eac9 --- /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 index 000000000..b21e9e093 --- /dev/null +++ b/imagemagick.desktop @@ -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