aboutsummaryrefslogtreecommitdiffstats
path: root/main/graphviz/APKBUILD
blob: c6a123ed3a1260c54b43d67e950420d6da534dba (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
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=graphviz
pkgver=2.34.0
pkgrel=1
pkgdesc="Graph Visualization Tools"
url="http://www.graphviz.org/"
arch="all"
license="EPL"
depends=""
depends_dev="zlib-dev libpng-dev libjpeg-turbo-dev expat-dev freetype-dev
	bison m4 flex fontconfig-dev libtool libsm-dev libxext-dev cairo-dev
	pango-dev librsvg-dev gmp-dev lua5.2-dev gtk+2.0-dev swig python-dev"
makedepends="$depends_dev"
install=""
subpackages="$pkgname-dev $pkgname-doc py-$pkgname:py lua-$pkgname:_lua
	$pkgname-gtk $pkgname-graphs"
source="http://www.graphviz.org/pub/graphviz/stable/SOURCES/graphviz-$pkgver.tar.gz
	0001-clone-nameclash.patch"

_builddir="$srcdir"/graphviz-$pkgver
prepare() {
	local i
	cd "$_builddir"
	update_config_sub || return 1
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
	# use /usr/lib instead of /usr/lib64
	sed -i -e 's/LIBPOSTFIX="64"/LIBPOSTFIX=/' configure || return 1
}

build() {
	cd "$_builddir"
	LUA=lua5.2 \
	LUA_CFLAGS="$(pkg-config --cflags lua5.2)" \
	LUA_LIBS="$(pkg-config --libs lua5.2)" \
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--with-x \
		--disable-static \
		--disable-dependency-tracking \
		--enable-lua=yes \
		--without-mylibgd \
		--with-ipsepcola \
		--with-pangocairo \
		--with-gdk-pixbuf \
		--with-png \
		--with-jpeg \
		--with-rsvg \
		|| return 1
	if [ "$CARCH" = "x86_64" ]; then
		# the configure script thinks we have sincos. we dont.
		sed -i -e '/HAVE_SINCOS/d' config.h || return 1
	fi
	make || return 1
}

package() {
	cd "$_builddir"
	make DESTDIR="$pkgdir" \
		pkgconfigdir=/usr/lib/pkgconfig \
		install || return 1
	mkdir -p "$pkgdir"/usr/share/doc
	mv "$pkgdir"/usr/share/graphviz/doc "$pkgdir"/usr/share/doc/graphviz || return 1
	rm -f "$pkgdir"/usr/lib/*.la \
		"$pkgdir"/usr/lib/graphviz/*.la \
		"$pkgdir"/usr/lib/graphviz/*/*.la \
		|| return 1
}

py() {
	pkgdesc="Python extension for graphviz"
	mkdir -p "$subpkgdir"/usr/lib/graphviz \
		"$subpkgdir"/usr/lib || return 1
	mv "$pkgdir"/usr/lib/graphviz/python* \
		"$subpkgdir"/usr/lib/graphviz || return 1
	mv "$pkgdir"/usr/lib/python* "$subpkgdir"/usr/lib/
}

_lua() {
	pkgdesc="Lua extension for graphviz"
	mkdir -p "$subpkgdir"/usr/lib/graphviz \
		"$subpkgdir"/usr/lib/lua || return 1
	mv "$pkgdir"/usr/lib/graphviz/lua \
		"$subpkgdir"/usr/lib/graphviz || return 1
	mv "$pkgdir"/usr/lib/lua "$subpkgdir"/usr/lib/
}

gtk() {
	pkgdesc="Gtk extension for graphviz"
	mkdir -p "$subpkgdir"/usr/lib/graphviz || return 1
	mv "$pkgdir"/usr/lib/graphviz/libgvplugin_g?k* \
		"$pkgdir"/usr/lib/graphviz/libgvplugin_rsvg* \
		"$subpkgdir"/usr/lib/graphviz || return 1
}

graphs() {
	pkgdesc="Demo graphs for graphviz"
	mkdir -p "$subpkgdir"/usr/share/graphviz || return 1
	mv "$pkgdir"/usr/share/graphviz/graphs \
		"$subpkgdir"/usr/share/graphviz/
}
md5sums="a8a54f8abac5bcdafd9a568e85a086d6  graphviz-2.34.0.tar.gz
bce8a9ae4c3a8c52c1bcf0e03d5ce364  0001-clone-nameclash.patch"
sha256sums="d94abca5745aa4c5808ab56cd3d0ec9ed14fb76a5a88d39e1f234fa84d22d764  graphviz-2.34.0.tar.gz
2b6c8186bf2799658494428d68597f63b91799f37809cbe59d8adcab60c27363  0001-clone-nameclash.patch"
sha512sums="73dc8c25bc5747fda717d6d2162a8b37bf883544a13b487354a6000d528816a69a021f33cbeec0f6e718a7e9905ab2a04ee63f787ca7f79226055b2da21f4832  graphviz-2.34.0.tar.gz
aa4cbc341906a949a6bf78cadd96c437d6bcc90369941fe03519aa4447731ecbf6063a0dd0366d3e7aaadf22b69e4bcab3f8632a7da7a01f8e08a3be05c2bc5d  0001-clone-nameclash.patch"