comparison graphics/graphviz/graphviz.sh @ 364:ea6c40075e00

graphics/graphviz: initial import, closes #1269
author David Demelier <markand@malikania.fr>
date Sat, 30 Mar 2019 09:47:42 +0100
parents
children 7828241c9634
comparison
equal deleted inserted replaced
363:acf210415c64 364:ea6c40075e00
1 #!/bin/sh
2 #
3 # Copyright (c) 2019 David Demelier <markand@malikania.fr>
4 #
5 # Permission to use, copy, modify, and/or distribute this software for any
6 # purpose with or without fee is hereby granted, provided that the above
7 # copyright notice and this permission notice appear in all copies.
8 #
9 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 #
17
18 PKGNAME=graphviz
19 PKGVERSION=2.40.1
20 PKGREVISION=1
21 PKGLICENSE="CUSTOM"
22 PKGSUMMARY="graph drawing programs"
23 PKGDOWNLOAD="http://files.malikania.fr/distfiles/$PKGNAME-$PKGVERSION.tar.gz"
24 PKGDEPENDS="dev/libtool"
25 PKGOPTIONS="FONTCONFIG FREETYPE GD GTK PANGO WEBP X XML"
26
27 : ${CHOST:=$(uname -m)-linux-musl}
28 : ${CBUILD:=$(uname -m)-linux-musl}
29 : ${CC:=gcc}
30 : ${CFLAGS:=-O2}
31 : ${CXX:=g++}
32 : ${CXXFLAGS:=-O2}
33 : ${LDFLAGS:=}
34 : ${LIBS:=}
35 : ${FONTCONFIG:=yes}
36 : ${FREETYPE:=yes}
37 : ${GD:=yes}
38 : ${GTK:=yes}
39 : ${PANGO:=yes}
40 : ${WEBP:=no}
41 : ${X:=yes}
42 : ${XML:=yes}
43
44 if [ "$FONTCONFIG" = "yes" ]; then
45 PKGDEPENDS="fonts/fontconfig $PKGDEPENDS"
46 with_fontconfig="--with-fontconfig"
47 else
48 with_fontconfig="--without-fontconfig"
49 fi
50
51 if [ "$FREETYPE" = "yes" ]; then
52 PKGDEPENDS="fonts/freetype $PKGDEPENDS"
53 with_freetype="--with-freetype2"
54 else
55 with_freetype="--without-freetype2"
56 fi
57
58 if [ "$GD" = "yes" ]; then
59 PKGDEPENDS="graphics/libgd $PKGDEPENDS"
60 with_gd="--with-libgd"
61 else
62 with_gd="--without-libgd"
63 fi
64
65 if [ "$GTK" = "yes" ]; then
66 PKGDEPENDS="graphics/gtk $PKGDEPENDS"
67 with_gtk="--with-gdk --with-gtk --with-gdk-pixbuf"
68 else
69 with_gtk="--without-gdk --without-gtk --without-gdk-pixbuf"
70 fi
71
72 if [ "$PANGO" = "yes" ]; then
73 PKGDEPENDS="fonts/pango $PKGDEPENDS"
74 with_pango="--with-pangocairo"
75 else
76 with_pango="--without-pangocairo"
77 fi
78
79 if [ "$WEBP" = "yes" ]; then
80 PKGDEPENDS="graphics/webp $PKGDEPENDS"
81 with_webp="--with-webp"
82 else
83 with_webp="--without-webp"
84 fi
85
86 if [ "$X" = "yes" ]; then
87 PKGDEPENDS="x11/libx11 $PKGDEPENDS"
88 PKGDEPENDS="x11/libxaw $PKGDEPENDS"
89 PKGDEPENDS="x11/libxmu $PKGDEPENDS"
90 PKGDEPENDS="x11/libxpm $PKGDEPENDS"
91 PKGDEPENDS="x11/libxt $PKGDEPENDS"
92 with_x="--with-x"
93 else
94 with_x="--without-x"
95 fi
96
97 if [ "$XML" = "yes" ]; then
98 PKGDEPENDS="lib/expat $PKGDEPENDS"
99 with_expat="--with-expat"
100 else
101 with_expat="--without-expat"
102 fi
103
104 build()
105 {
106 rm -rf $PKGNAME-$PKGVERSION
107 tar xvaf $PKGNAME-$PKGVERSION.tar.gz
108 pushd $PKGNAME-$PKGVERSION
109
110 # TODO: enable features as they become available.
111 CC="$CC" \
112 CFLAGS="$CFLAGS" \
113 CXX="$CXX" \
114 CXXFLAGS="$CXXFLAGS" \
115 LDFLAGS="$LDFLAGS" \
116 LIBS="$LIBS" \
117 ./configure \
118 --build=$CBUILD \
119 --host=$CHOST \
120 --prefix=/usr \
121 --disable-ltdl-install \
122 --without-included-ltdl \
123 --without-qt \
124 --without-devil \
125 --without-poppler \
126 --without-rsvg \
127 --without-ghostscript \
128 --without-visio \
129 --without-lasi \
130 --without-glitz \
131 --without-gtkgl \
132 --without-gtkglext \
133 --without-gts \
134 --without-ann \
135 --without-glade \
136 --without-ming \
137 --without-qt\
138 --without-quartz \
139 --without-gdiplus \
140 --without-glut \
141 --without-smyrna \
142 --without-ortho \
143 --without-digcola \
144 --without-ipsepcola \
145 --with-sfdp \
146 $with_fontconfig \
147 $with_freetype \
148 $with_gd \
149 $with_gtk \
150 $with_pango \
151 $with_webp \
152 $with_x \
153 $with_xml
154 make
155 make install DESTDIR=$DESTDIR
156 rm -f $DESTDIR/usr/lib/graphviz/*.la
157 rm -f $DESTDIR/usr/lib/graphviz/perl/*.la
158 rm -f $DESTDIR/usr/lib/libcdt.la
159 rm -f $DESTDIR/usr/lib/libcgraph.la
160 rm -f $DESTDIR/usr/lib/libgvc.la
161 rm -f $DESTDIR/usr/lib/libgvpr.la
162 rm -f $DESTDIR/usr/lib/liblab_gamut.la
163 rm -f $DESTDIR/usr/lib/libpathplan.la
164 rm -f $DESTDIR/usr/lib/libxdot.la
165
166 popd
167 rm -rf $PKGNAME-$PKGVERSION
168 }