Skip to content

Commit

Permalink
Generate AppImage
Browse files Browse the repository at this point in the history
  • Loading branch information
probonopd authored and dlemstra committed Nov 12, 2017
1 parent b726d62 commit 4b45830
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 5 deletions.
32 changes: 27 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ dist: trusty # needed for HarfBuzz

language: c


compiler:
- clang
- gcc
Expand All @@ -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
30 changes: 30 additions & 0 deletions AppRun
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions imagemagick.desktop
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 4b45830

Please sign in to comment.