pkgname=libmagick6 _pkgname=imagemagick6 pkgver=6.9.10.13 pkgrel=1 pkgdesc="An image viewing/manipulation program (version 6)" url="https://legacy.imagemagick.org/" arch=(x86_64) license=(custom) depends=('libltdl' 'lcms2' 'fontconfig' 'libxext' 'liblqr' 'libpng') makedepends=('ghostscript' 'openexr' 'libwmf' 'librsvg' 'libxml2' 'openjpeg2' 'libraw' 'opencl-headers' 'libwebp' 'chrpath' 'ocl-icd' 'glu' 'libheif' 'jbigkit') checkdepends=('gsfonts' 'ttf-dejavu') optdepends=('ghostscript: PS/PDF support' 'libheif: HEIF support' 'libraw: DNG support' 'librsvg: SVG support' 'libwebp: WEBP support' 'libwmf: WMF support' 'libxml2: Magick Scripting Language' 'ocl-icd: OpenCL support' 'openexr: OpenEXR support' 'openjpeg2: JPEG2000 support' 'pango: Text rendering') backup=(etc/$_relname/{coder,colors,delegates,log,magic,mime,policy,quantization-table,thresholds,type,type-{dejavu,ghostscript}}.xml) options=('!docs' '!emptydirs' libtool) _relname=ImageMagick-${pkgver%%.*} _tarname=ImageMagick-${pkgver%.*}-${pkgver##*.} source=(https://www.imagemagick.org/download/$_tarname.tar.xz{,.asc} IM6-GS-policy.patch) sha256sums=('20f4e224c0546aeb910df0adeb156a94a4c9bfb8ca4df2a805d88274818b0910' 'SKIP' 'f20c09860da65a4259ec9627ceeca7d993949b7460fa199c5ffd874633814cf6') validpgpkeys=(D8272EF51DA223E4D05B466989AB63D48277377A) # Lexie Parsimoniae prepare() { mkdir -p binpkg/usr/lib/pkgconfig {binpkg,docpkg}/usr/share cd $_tarname # Workaround ghostscript security issues https://bugs.archlinux.org/task/59778 patch -p1 -i ../IM6-GS-policy.patch # Don't run auto(re)conf; assumes use of git } build() { cd $_tarname ./configure \ PKG_CONFIG="/usr/bin/env PKG_CONFIG_PATH=/usr/lib/$_pkgname/pkgconfig pkg-config" \ --prefix=/usr \ --sysconfdir=/etc \ --with-dejavu-font-dir=/usr/share/fonts/TTF \ --with-gs-font-dir=/usr/share/fonts/gsfonts \ PSDelegate=/usr/bin/gs \ XPSDelegate=/usr/bin/gxps \ PCLDelegate=/usr/bin/gpcl6 \ --enable-hdri \ --enable-opencl \ --with-gslib \ --with-lqr \ --with-modules \ --with-openexr \ --with-openjp2 \ --with-perl \ --with-perl-options=INSTALLDIRS=vendor \ --with-rsvg \ --with-webp \ --with-wmf \ --with-xml \ --without-autotrace \ --without-djvu \ --without-dps \ --without-fftw \ --without-fpx \ --without-gcc-arch \ --without-gvc sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool make } check() ( cd $_tarname ulimit -n 4096 sed -e '/validate-formats/d' -i Makefile # these fail due to the security patch make check || : ) package() { cd $_tarname make DESTDIR="$pkgdir" install pkgconfigdir="/usr/lib/$_pkgname/pkgconfig" rm "$pkgdir"/etc/$_relname/type-{apple,urw-base35,windows}.xml rm "$pkgdir"/usr/lib/*.la install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 LICENSE NOTICE # Remove 'imagemagick6' cd ../binpkg rm -rf "$pkgdir/usr/bin" rm -rf "$pkgdir/usr/lib/perl5" rm -rf "$pkgdir/usr/share/man" }