aboutsummaryrefslogtreecommitdiffstats
path: root/community/imagemagick6/APKBUILD
blob: db10abb5cd47b825c6324dd896c6952c8b229691 (plain)
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
# Contributor: Łukasz Jendrysik <scadu@yandex.com>
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=imagemagick6
_pkgname=ImageMagick
pkgver=6.9.10.44
_pkgver=${pkgver%.*}-${pkgver##*.}
_abiver=${pkgname#imagemagick}
pkgrel=0
pkgdesc="A collection of tools and libraries for many image formats (legacy version $_abiver)"
url="https://www.imagemagick.org/"
arch="all"
license="Apache-2.0"
options="libtool"
depends_dev="!${pkgname%$_abiver}-dev"
makedepends="fontconfig-dev freetype-dev ghostscript-dev lcms2-dev
	libjpeg-turbo-dev libpng-dev librsvg-dev libtool libxml2-dev tiff-dev
	zlib-dev"
checkdepends="freetype fontconfig ghostscript ghostscript-fonts lcms2 graphviz"
subpackages="$pkgname-doc $pkgname-dev $pkgname-c++:_cxx $pkgname-libs"
source="https://www.imagemagick.org/download/releases/$_pkgname-$_pkgver.tar.xz"
builddir="$srcdir/$_pkgname-$_pkgver"

# secfixes:
#   6.9.10.44-r0:
#     - CVE-2019-11598
#     - CVE-2019-11597
#     - CVE-2019-11472
#   6.9.10.39-r0:
#     - CVE-2019-10649
#     - CVE-2019-10650
#     - CVE-2019-7175
#     - CVE-2019-7395
#     - CVE-2019-7396
#     - CVE-2019-7397
#     - CVE-2019-7398
#     - CVE-2019-9956
#     - CVE-2018-12599
#     - CVE-2018-12600
#     - CVE-2018-13153
#     - CVE-2018-14434
#     - CVE-2018-14435
#     - CVE-2018-14436
#     - CVE-2018-14437
#     - CVE-2018-14551
#     - CVE-2018-15607
#     - CVE-2018-16329
#     - CVE-2018-16412
#     - CVE-2018-16413
#     - CVE-2018-16640
#     - CVE-2018-16642
#     - CVE-2018-16643
#     - CVE-2018-16644
#     - CVE-2018-16645
#     - CVE-2018-16749
#     - CVE-2018-16750
#     - CVE-2018-17965
#     - CVE-2018-17966
#     - CVE-2018-17967
#     - CVE-2018-18016
#     - CVE-2018-18024
#     - CVE-2018-18025
#     - CVE-2018-18544
#     - CVE-2018-20467
#     - CVE-2018-5246
#     - CVE-2018-5247
#     - CVE-2018-5357
#     - CVE-2018-5358
#     - CVE-2018-6405
#     - CVE-2018-7443
#     - CVE-2018-7470
#     - CVE-2018-8804
#     - CVE-2018-8960
#     - CVE-2018-9133
#     - CVE-2018-9135

prepare() {
	default_prepare

	if [ "${pkgver%%.*}" != "$_abiver" ]; then
		error "This abuild is for major version $_abiver, but pkgver=$pkgver!"
		return 1
	fi
}

build() {
	cd "$builddir"

	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--program-suffix="-$_abiver" \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--disable-docs \
		--disable-static \
		--with-threads \
		--without-x \
		--without-perl \
		--with-tiff \
		--with-png \
		--with-rsvg \
		--with-gslib \
		--with-gs-font-dir=/usr/share/fonts/Type1 \
		--with-modules \
		--with-xml
	make
}

check() {
	cd "$builddir"
	make check
}

package() {
	cd "$builddir"

	make -j1 DESTDIR="$pkgdir" install

	if [ ! -e "$pkgdir"/usr/lib/libMagickCore-$_abiver.Q16.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

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

dev() {
	default_dev

	cd "$subpkgdir"

	mkdir -p ./usr/bin
	mv "$pkgdir"/usr/bin/*-config-$_abiver ./usr/bin/

	cd ./usr/bin
	local f; for f in *; do
		ln -s $f ${f%-$_abiver}
	done
}

libs() {
	default_libs

	cd "$subpkgdir"

	mv "$pkgdir"/etc .
	mv "$pkgdir"/usr/lib/* ./usr/lib/
	mv "$pkgdir"/usr/share ./usr/
}

_cxx() {
	pkgdesc="ImageMagick Magick++ library (C++ bindings)"

	mkdir -p "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/libMagick++*.so.* "$subpkgdir"/usr/lib/
}

sha512sums="520f93cada3b439198301916a3b59f5f4cbc2ff4dd3e8ba8e9023a109db024591e36c52e976906335e6f3eec9682cc987c025a1ed342db89206a660ce2d21d5e  ImageMagick-6.9.10-44.tar.xz"