archrelease: copy trunk to extra-x86_64
[arch-packages.git] / imagemagick / repos / extra-x86_64 / PKGBUILD
blobeb871481393cde49fc7899e62a637b3cd8b407bb
1 # Maintainer: Antonio Rojas <arojas@archlinux.org>
2 # Contributor: Eric BĂ©langer <eric@archlinux.org>
4 pkgbase=imagemagick
5 pkgname=(imagemagick imagemagick-doc)
6 pkgver=7.1.0.38
7 pkgrel=1
8 pkgdesc='An image viewing/manipulation program'
9 url='https://www.imagemagick.org/'
10 arch=(x86_64)
11 license=(custom)
12 makedepends=(ghostscript openexr libwmf librsvg libxml2 openjpeg2 libraw opencl-headers libwebp libzip libjxl highway
13              chrpath ocl-icd glu ghostpcl ghostxps libheif jbigkit lcms2 libxext liblqr libraqm libpng djvulibre)
14 checkdepends=(gsfonts ttf-dejavu)
15 _relname=ImageMagick-${pkgver%%.*}
16 _tarname=ImageMagick-${pkgver%.*}-${pkgver##*.}
17 source=(https://imagemagick.org/archive/$_tarname.tar.xz{,.asc}
18         arch-fonts.diff)
19 sha256sums=('22efa8aac4c048631e6e7c20ab3fe2fa0b4c93ca9cd2311173855270af4df7d3'
20             'SKIP'
21             'a85b744c61b1b563743ecb7c7adad999d7ed9a8af816650e3ab9321b2b102e73')
22 validpgpkeys=(D8272EF51DA223E4D05B466989AB63D48277377A)  # Lexie Parsimoniae
23 options=(debug)
25 shopt -s extglob
27 prepare() {
28   mkdir -p docpkg/usr/share
30   cd $_tarname
32   # Fix up typemaps to match our packages, where possible
33   patch -p1 -i ../arch-fonts.diff
36 build() {
37   cd $_tarname
38   ./configure \
39     --prefix=/usr \
40     --sysconfdir=/etc \
41     --enable-shared \
42     --disable-static \
43     --with-dejavu-font-dir=/usr/share/fonts/TTF \
44     --with-gs-font-dir=/usr/share/fonts/gsfonts \
45     PSDelegate=/usr/bin/gs \
46     XPSDelegate=/usr/bin/gxps \
47     PCLDelegate=/usr/bin/gpcl6 \
48     --enable-hdri \
49     --enable-opencl \
50     --without-gslib \
51     --with-djvu \
52     --with-jxl \
53     --with-lqr \
54     --with-modules \
55     --with-openexr \
56     --with-openjp2 \
57     --with-perl \
58     --with-perl-options=INSTALLDIRS=vendor \
59     --with-rsvg \
60     --with-webp \
61     --with-wmf \
62     --with-xml \
63     --without-autotrace \
64     --without-dps \
65     --without-fftw \
66     --without-fpx \
67     --without-gcc-arch \
68     --without-gvc
69   sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
70   make
73 check() (
74   cd $_tarname
75   ulimit -n 4096
76   make check
79 package_imagemagick() {
80   depends=(libltdl lcms2 fontconfig libxext liblqr libraqm libpng libxml2)
81   optdepends=('ghostscript: PS/PDF support'
82               'libheif: HEIF support'
83               'libjxl: JPEG XL support'
84               'libraw: DNG support'
85               'librsvg: SVG support'
86               'libwebp: WEBP support'
87               'libwmf: WMF support'
88               'libxml2: Magick Scripting Language'
89               'libzip: OpenRaster support'
90               'ocl-icd: OpenCL support'
91               'openexr: OpenEXR support'
92               'openjpeg2: JPEG2000 support'
93               'djvulibre: DJVU support'
94               'pango: Text rendering'
95               'imagemagick-doc: manual and API docs')
96   options+=(!emptydirs libtool)
97   backup=(etc/$_relname/{colors,delegates,log,mime,policy,quantization-table,thresholds,type,type-{dejavu,ghostscript}}.xml)
98   conflicts=(imagemagick6)
99   provides=(libmagick)
100   replaces=(imagemagick6 libmagick)
102   cd $_tarname
103   make DESTDIR="$pkgdir" install
105   find "$pkgdir/usr/lib/perl5" -name '*.so' -exec chrpath -d {} +
106   rm "$pkgdir"/etc/$_relname/type-{apple,urw-base35,windows}.xml
107   rm "$pkgdir"/usr/lib/*.la
109   install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 LICENSE NOTICE
111 # Split docs
112   mv "$pkgdir/usr/share/doc" "$srcdir/docpkg/usr/share/"
115 package_imagemagick-doc() {
116   pkgdesc+=" (manual and API docs)"
118   mv docpkg/* "$pkgdir"
120   cd $_tarname
121   install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 LICENSE NOTICE