aboutsummaryrefslogtreecommitdiffstats
path: root/community/imagemagick6/APKBUILD
blob: 1f3e1e4f34e34cb22a15978c56e33c9c0884a2b9 (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
# 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.9.47
_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"
subpackages="$pkgname-doc $pkgname-dev $pkgname-c++:_cxx $pkgname-libs"
source="http://www.imagemagick.org/download/releases/$_pkgname-$_pkgver.tar.xz"
builddir="$srcdir/$_pkgname-$_pkgver"

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
}

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="7bf7ae7fc276c2857f546370851ef7aaf1704c1b5bbad1a739d964e8e48a4ece9d9274e154a5aaa18c24f31e60e03d2df661cca922a3fff780cbcddd86524cb5  ImageMagick-6.9.9-47.tar.xz"