# Contributor: Ɓukasz Jendrysik # Contributor: Carlo Landmeter # Maintainer: Natanael Copa pkgname=imagemagick pkgver=7.0.8.49 pkgrel=1 _pkgver=${pkgver%.*}-${pkgver##*.} _abiver=7 pkgdesc="Collection of tools and libraries for many image formats" url="https://www.imagemagick.org/" arch="all" license="ImageMagick" options="libtool !checkroot" makedepends="zlib-dev libpng-dev libjpeg-turbo-dev freetype-dev fontconfig-dev perl-dev ghostscript-dev libwebp-dev libtool tiff-dev lcms2-dev libwebp-dev libxml2-dev librsvg-dev libx11-dev libxext-dev chrpath libheif-dev" checkdepends="freetype fontconfig ghostscript ghostscript-fonts lcms2 graphviz" subpackages="$pkgname-doc $pkgname-dev $pkgname-c++:_cxx $pkgname-libs $pkgname-perlmagick:_perlmagick $pkgname-perlmagick-doc:_perlmagick_doc" source="https://www.imagemagick.org/download/releases/ImageMagick-$_pkgver.tar.xz disable-avaraging-tests.patch" builddir="$srcdir/ImageMagick-${_pkgver}" # secfixes: # 7.0.8.44-r0: # - CVE-2019-11598 # - CVE-2019-11597 # - CVE-2019-11472 # 7.0.8.38-r0: # - CVE-2019-9956 # - CVE-2019-10649 # - CVE-2019-10650 build() { cd "$builddir" # fix doc dir, Gentoo bug 91911 sed -i -e \ 's:DOCUMENTATION_PATH="${DATA_DIR}/doc/${DOCUMENTATION_RELATIVE_PATH}":DOCUMENTATION_PATH="/usr/share/doc/imagemagick":g' \ configure ./configure \ --build=$CBUILD \ --host=$CHOST \ --prefix=/usr \ --sysconfdir=/etc \ --mandir=/usr/share/man \ --infodir=/usr/share/info \ --disable-static \ --disable-openmp \ --with-threads \ --with-x \ --with-tiff \ --with-png \ --with-webp \ --with-rsvg \ --with-gslib \ --with-gs-font-dir=/usr/share/fonts/Type1 \ --with-heic \ --with-modules \ --with-xml \ --with-perl \ --with-perl-options=PREFIX=/usr \ $_pic make } check() { cd "$builddir" make check } package() { cd "$builddir" make -j1 DESTDIR="$pkgdir" install if ! [ -e "$pkgdir"/usr/lib/libMagickCore-$_abiver.Q16HDRI.so ]; then error "Has ABI verision changed? (current is $_abiver)" return 1 fi # we cannot let abuild delete the *.la files due to we need *.la # for the modules rm "$pkgdir"/usr/lib/*.la find "$pkgdir" -name '.packlist' -o -name 'perllocal.pod' \ -o -name '*.bs' -delete } _cxx() { pkgdesc="ImageMagick Magick++ library (C++ bindings)" mkdir -p "$subpkgdir"/usr/lib mv "$pkgdir"/usr/lib/libMagick++*.so.* "$subpkgdir"/usr/lib/ } _perlmagick() { pkgdesc="PerlMagick Perl Modules for ImageMagick" mkdir -p "$subpkgdir"/usr/lib mv "$pkgdir"/usr/lib/perl5 "$subpkgdir"/usr/lib/ chrpath -d "$subpkgdir"/usr/lib/perl5/site_perl/auto/Image/Magick/Q16HDRI/Q16HDRI.so } _perlmagick_doc() { pkgdesc="PerlMagick Perl Module Documentation for ImageMagick" mkdir -p "$subpkgdir" cd "$builddir"/PerlMagick make -j1 DESTDIR="$subpkgdir" doc_vendor_install } sha512sums="8dd4a45f4d95d949bcd797f44d1602a3767386ee7d73888fb8a1ee6d4d8be7c4881a88262e7261a253da6f4b3c8ac9442d5eacb44e267e2d25e11bda10b12526 ImageMagick-7.0.8-49.tar.xz 58afb2da075a6208b6a990ff297b3a827d260687c3355198a8b4d987e1596c0b0cd78aff6f0be0e1896e537fbe44a3d467473183f5f149664ea6e6fb3d3291a9 disable-avaraging-tests.patch"