git » imagemagick.git » main » tree

[main] / PKGBUILD

# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Contributor: Eric BĂ©langer <eric@archlinux.org>

pkgname=imagemagick
pkgver=7.1.1.32
pkgrel=1
_relname=ImageMagick-${pkgver%%.*}
_tarname=ImageMagick-${pkgver%.*}-${pkgver##*.}
pkgdesc='An image viewing/manipulation program'
url='https://www.imagemagick.org/'
arch=(x86_64 'armv7h')
license=(custom)
depends=(bzip2
         cairo
         fftw
         fontconfig
         freetype2
         gcc-libs
         glib2
         glibc
         lcms2
         liblqr
         libltdl
         libpng
         libraqm
         libxext
         libxml2
         xz
         zlib)
optdepends=('ghostscript: PS/PDF support'
            'jbigkit: JBIG support'
            'libheif: HEIF support'
            'libjpeg-turbo: JPEG support'
            #'libjxl: JPEG XL support'
            'libraw: DNG support'
            'librsvg: SVG support'
            'libtiff: TIFF support'
            'libwebp: WEBP support'
            'libwmf: WMF support'
            'libzip: OpenRaster support'
           # 'ocl-icd: OpenCL support'
            'openexr: OpenEXR support'
            'openjpeg2: JPEG2000 support'
            'djvulibre: DJVU support'
            'pango: Text rendering')
options+=(!emptydirs libtool)
backup=(etc/$_relname/{colors,delegates,log,mime,policy,quantization-table,thresholds,type,type-{dejavu,ghostscript}}.xml)
provides=(libmagick)
makedepends=(chrpath
             djvulibre
             ghostpcl
             ghostscript
             ghostxps
             glu
             jbigkit
             libheif
             libjpeg-turbo
            # libjxl
             libraw
             librsvg
             libwebp
             libwmf
             libzip
            # ocl-icd
             opencl-headers
             openexr
             openjpeg2)
#checkdepends=(gsfonts
#              ttf-dejavu)
replaces=(imagemagick-doc)
source=(https://imagemagick.org/archive/$_tarname.tar.xz{,.asc}
        arch-fonts.diff)
sha256sums=('e7a6b98f105e6b0f4f1b1e1d72f002262cc1a375b8c05b5f9e8dd2be438897d2'
            'SKIP'
            'a85b744c61b1b563743ecb7c7adad999d7ed9a8af816650e3ab9321b2b102e73')
validpgpkeys=(D8272EF51DA223E4D05B466989AB63D48277377A)  # Lexie Parsimoniae

shopt -s extglob

prepare() {
  mkdir -p docpkg/usr/share

  cd $_tarname

  # Fix up typemaps to match our packages, where possible
  patch -p1 -i ../arch-fonts.diff
}

build() {
  cd $_tarname
  ./configure \
    --prefix=/usr \
    --sysconfdir=/etc \
    --enable-shared \
    --disable-static \
    --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 \
    --disable-opencl \
    --without-gslib \
    --with-djvu \
    --with-fftw \
    --without-jxl \
    --with-lqr \
    --with-modules \
    --with-openexr \
    --with-openjp2 \
    --with-perl \
    --with-perl-options='INSTALLDIRS=vendor INSTALL_BASE=' \
    --with-rsvg \
    --with-webp \
    --with-wmf \
    --with-xml \
    --without-autotrace \
    --without-dps \
    --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
#  make check
#)

package() {
  cd $_tarname
  make DESTDIR="$pkgdir" install

  find "$pkgdir/usr/lib/perl5" -name '*.so' -exec chrpath -d {} +
  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
}