1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
5 PYTHON_COMPAT=( python2_7 )
7 inherit autotools eutils flag-o-matic java-pkg-opt-2 multilib python-single-r1 qmake-utils
9 DESCRIPTION="Open Source Graph Visualization Software"
10 HOMEPAGE="http://www.graphviz.org/ https://gitlab.com/graphviz/graphviz/"
11 SRC_URI="http://www.graphviz.org/pub/graphviz/stable/SOURCES/${P}.tar.gz"
15 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris"
16 IUSE="+cairo devil doc examples gdk-pixbuf gtk gts guile java lasi nls pdf perl postscript python qt5 ruby svg static-libs tcl X elibc_FreeBSD"
24 >=dev-libs/glib-2.11.1:2
26 >=media-libs/fontconfig-2.3.95
27 >=media-libs/freetype-2.1.10
28 >=media-libs/gd-2.0.34:=[fontconfig,jpeg,png,truetype,zlib]
29 >=media-libs/libpng-1.2:0
30 !<=sci-chemistry/cluster-1.3.081231
42 >=x11-libs/cairo-1.1.10[svg]
44 devil? ( media-libs/devil[png,jpeg] )
45 postscript? ( app-text/ghostscript-gpl )
46 gtk? ( x11-libs/gtk+:2 )
48 lasi? ( media-libs/lasi )
49 pdf? ( app-text/poppler )
50 perl? ( dev-lang/perl:= )
51 python? ( ${PYTHON_DEPS} )
55 dev-qt/qtprintsupport:5
58 ruby? ( dev-lang/ruby:* )
59 svg? ( gnome-base/librsvg )
60 tcl? ( >=dev-lang/tcl-8.3:0= )"
65 guile? ( dev-scheme/guile dev-lang/swig )
66 java? ( >=virtual/jdk-1.5 dev-lang/swig )
67 nls? ( >=sys-devel/gettext-0.14.5 )
68 perl? ( dev-lang/swig )
69 python? ( dev-lang/swig )
70 ruby? ( dev-lang/swig )
71 tcl? ( dev-lang/swig )"
73 !cairo? ( !X !gtk !postscript !lasi )
74 python? ( ${PYTHON_REQUIRED_USE} )"
76 # Dependency description / Maintainer-Info:
78 # Rendering is done via the following plugins (/plugins):
79 # - core, dot_layout, neato_layout, gd , dot
80 # the ones which are always compiled in, depend on zlib, gd
82 # Directly depends on gtk-2.
83 # needs 'pangocairo' enabled in graphviz configuration
84 # gtk-2 depends on pango, cairo and libX11 directly.
86 # Disabled, GTK-1 junk.
88 # Disabled, no particular reason
89 # needs 'pangocairo' enabled in graphviz configuration
91 # flash plugin via -Tswf requires media-libs/ming-0.4. Disabled as it's
94 # Needs pango for text layout, uses cairo methods to draw stuff
97 # can make use of gnomeui and inotify support (??? unsure),
99 # UI also links directly against libX11, libXmu, and libXt
100 # and uses libXpm if available so we make sure it always is
102 # There can be swig-generated bindings for the following languages (/tclpkg/gv):
103 # - c-sharp (disabled)
104 # - scheme (enabled via guile) ... no longer broken on ~x86
106 # - java (enabled via java) *2
107 # - lua (enabled via lua)
108 # - ocaml (enabled via ocaml)
109 # - perl (enabled via perl) *1
110 # - php (enabled via php) *2
111 # - python (enabled via python) *1
112 # - ruby (enabled via ruby) *1
113 # - tcl (enabled via tcl)
114 # *1 = The ${P}-bindings.patch takes care that those bindings are installed to the right location
115 # *2 = Those bindings don't build because the paths for the headers/libs aren't
116 # detected correctly and/or the options passed to swig are wrong (-php instead of -php4/5)
118 # There are several other tools in /tclpkg:
119 # gdtclft, tcldot, tclhandle, tclpathplan, tclstubs ; enabled with: --with-tcl
120 # tkspline, tkstubs ; enabled with: --with-tk
122 # And the commands (/cmd):
123 # - dot, dotty, gvedit, gvpr, lefty, lneato, smyrna, tools/* :)
124 # sci-libs/gts can be used for some of these
126 # needs Xaw and X to build
127 # - gvedit (via 'qt5'):
128 # based on ./configure it needs qt-core and qt-gui only
129 # - smyrna : experimental opengl front-end (via 'smyrna')
130 # currently disabled -- it segfaults a lot
131 # needs x11-libs/gtkglext, gnome-base/libglade, media-libs/freeglut
132 # sci-libs/gts, x11-libs/gtk. Also needs 'gtk','glade','glut','gts' and 'png'
133 # with flags enabled at configure time
136 "${FILESDIR}"/${PN}-2.34.0-Xaw-configure.patch
137 "${FILESDIR}"/${P}-qt5.patch
141 use python && python-single-r1_pkg_setup
143 java-pkg-opt-2_pkg_setup
149 # ToDo: Do the same thing for examples and/or
150 # write a patch for a configuration-option
151 # and send it to upstream
152 # note - the longer sed expression removes multi-line assignments that are extended via '\'
154 find . -iname Makefile.am \
155 | xargs sed -i -e '/^\(html\|pdf\)_DATA.*\\[[:space:]]*$/{:m;N;s/\\\n//;tm;d}' \
156 -e '/^\(html\|pdf\)_DATA/d' || die
159 # This is an old version of libtool
160 # use the ./configure option to exclude its use, and
161 # delete the dir since we don't need to eautoreconf it
164 # no nls, no gettext, no iconv macro, so disable it
166 sed -i -e '/^AM_ICONV/d' configure.ac || die
169 # Nuke the dead symlinks for the bindings
170 sed -i -e '/$(pkgluadir)/d' tclpkg/gv/Makefile.am || die
172 # replace the whitespace with tabs
173 sed -i -e 's: :\t:g' doc/info/Makefile.am || die
175 # use correct version of qmake. bug #567236
176 sed -i -e "/AC_CHECK_PROGS(QMAKE/a AC_SUBST(QMAKE,$(qt5_get_bindir)/qmake)" configure.ac || die
178 # workaround for http://www.graphviz.org/mantisbt/view.php?id=1895
179 use elibc_FreeBSD && append-flags $(test-flags -fno-builtin-sincos)
181 use java && append-cppflags $(java-pkg_get-jni-cflags)
189 --disable-silent-rules
190 $(use_enable static-libs static)
193 # libtool file collision, bug 276609
194 myconf+=( --without-included-ltdl --disable-ltdl-install )
197 $(use_with cairo pangocairo)
203 $(use_with pdf poppler)
204 $(use_with postscript ghostscript)
215 $(use_enable gdk-pixbuf)
219 # new/experimental features, to be tested, disable for now
248 sed -i -e "s:htmldir:htmlinfodir:g" doc/info/Makefile || die
250 emake DESTDIR="${D}" \
251 txtdir="${EPREFIX}"/usr/share/doc/${PF} \
252 htmldir="${EPREFIX}"/usr/share/doc/${PF}/html \
253 htmlinfodir="${EPREFIX}"/usr/share/doc/${PF}/html/info \
254 pdfdir="${EPREFIX}"/usr/share/doc/${PF}/pdf \
255 pkgconfigdir="${EPREFIX}"/usr/$(get_libdir)/pkgconfig \
258 use examples || rm -rf "${ED}"/usr/share/graphviz/demo
260 use static-libs || find "${ED}" -name '*.la' -exec rm -f {} +
262 dodoc AUTHORS ChangeLog NEWS README
264 use python && python_optimize \
265 "${D}$(python_get_sitedir)" \
266 "${D}/usr/$(get_libdir)/graphviz/python"
270 # This actually works if --enable-ltdl is passed
276 # Remove cruft, bug #547344
277 rm -f "${EROOT}usr/lib/graphviz/config{,6}"