summaryrefslogtreecommitdiffstats
path: root/imagemagick-compat/PKGBUILD
blob: ef9dc90d87f96057a9d45683999a1f7100387b27 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# Maintainer: kj_sh604 <406hs_jk@proton.me>

pkgname=imagemagick
pkgver=7.1.2.8
_pkgver=${pkgver%.*}-${pkgver##*.}
pkgrel=1
pkgdesc='An image viewing/manipulation program with "convert" compatibility wrapper script'
url='https://www.imagemagick.org/'
arch=(x86_64)
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'
            'libultrahdr: UHDR 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/ImageMagick-7/{colors,delegates,log,mime,policy,quantization-table,thresholds,type,type-{dejavu,ghostscript}}.xml)
provides=(libmagick)
makedepends=(chrpath
             djvulibre
             ghostscript
             git
             glu
             jbigkit
             libheif
             libjpeg-turbo
             libjxl
             libraw
             librsvg
             libultrahdr
             libwebp
             libwmf
             libzip
             ocl-icd
             opencl-headers
             openexr
             openjpeg2)
checkdepends=(gsfonts
              ttf-dejavu)
replaces=(imagemagick-doc)
source=(git+https://github.com/ImageMagick/ImageMagick#tag=$_pkgver)
sha256sums=('3468666570fab914250c05f4ade6f9843d021e5bfe66a7f1c0ed4039f90cbc42')

build() {
  cd ImageMagick
  ./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 \
    --enable-opencl \
    --without-gslib \
    --with-djvu \
    --with-fftw \
    --with-jxl \
    --with-lqr \
    --with-modules \
    --with-openexr \
    --with-openjp2 \
    --with-perl \
    --with-perl-options='INSTALLDIRS=vendor INSTALL_BASE=' \
    --with-rsvg \
    --with-uhdr \
    --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 ImageMagick
  ulimit -n 4096
  make check
)

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

  find "$pkgdir/usr/lib/perl5" -name '*.so' -exec chrpath -d {} +
  rm "$pkgdir"/etc/ImageMagick-*/type-{apple,urw-base35,windows}.xml
  rm "$pkgdir"/usr/lib/*.la

  install -Dm644 LICENSE NOTICE -t "$pkgdir"/usr/share/licenses/$pkgname

  # Add a wrapper script for "convert" to use "magick convert"
  install -Dm755 /dev/stdin "$pkgdir/usr/bin/convert" <<END
#!/bin/sh
exec magick "\$@"
END
}

# vim :set ts=2 sw=2 et: