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 flag-o-matic java-pkg-opt-2 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 static-libs svg tcl X elibc_FreeBSD"
19 !cairo? ( !X !gtk !postscript !lasi )
20 python? ( ${PYTHON_REQUIRED_USE} )"
27 >=dev-libs/glib-2.11.1:2
29 >=media-libs/fontconfig-2.3.95
30 >=media-libs/freetype-2.1.10
31 >=media-libs/gd-2.0.34:=[fontconfig,jpeg,png,truetype,zlib]
32 >=media-libs/libpng-1.2:0
37 >=x11-libs/cairo-1.1.10[svg]
40 devil? ( media-libs/devil[png,jpeg] )
41 gtk? ( x11-libs/gtk+:2 )
43 lasi? ( media-libs/lasi )
44 pdf? ( app-text/poppler )
45 perl? ( dev-lang/perl:= )
46 postscript? ( app-text/ghostscript-gpl )
47 python? ( ${PYTHON_DEPS} )
51 dev-qt/qtprintsupport:5
54 ruby? ( dev-lang/ruby:* )
55 svg? ( gnome-base/librsvg )
56 tcl? ( >=dev-lang/tcl-8.3:0= )
64 DEPEND="${COMMON_DEPEND}
68 guile? ( dev-lang/swig dev-scheme/guile )
69 java? ( dev-lang/swig >=virtual/jdk-1.5 )
70 nls? ( >=sys-devel/gettext-0.14.5 )
71 perl? ( dev-lang/swig )
72 python? ( dev-lang/swig )
73 ruby? ( dev-lang/swig )
74 tcl? ( dev-lang/swig )"
75 RDEPEND="${COMMON_DEPEND}
76 !<=sci-chemistry/cluster-1.3.081231"
78 # Dependency description / Maintainer-Info:
80 # Rendering is done via the following plugins (/plugins):
81 # - core, dot_layout, neato_layout, gd , dot
82 # the ones which are always compiled in, depend on zlib, gd
84 # Directly depends on gtk-2.
85 # needs 'pangocairo' enabled in graphviz configuration
86 # gtk-2 depends on pango, cairo and libX11 directly.
88 # Disabled, GTK-1 junk.
90 # Disabled, no particular reason
91 # needs 'pangocairo' enabled in graphviz configuration
93 # flash plugin via -Tswf requires media-libs/ming-0.4. Disabled as it's
96 # Needs pango for text layout, uses cairo methods to draw stuff
99 # can make use of gnomeui and inotify support (??? unsure),
100 # needs libXaw for UI
101 # UI also links directly against libX11, libXmu, and libXt
102 # and uses libXpm if available so we make sure it always is
104 # There can be swig-generated bindings for the following languages (/tclpkg/gv):
105 # - c-sharp (disabled)
106 # - scheme (enabled via guile) ... no longer broken on ~x86
108 # - java (enabled via java) *2
109 # - lua (enabled via lua)
110 # - ocaml (enabled via ocaml)
111 # - perl (enabled via perl) *1
112 # - php (enabled via php) *2
113 # - python (enabled via python) *1
114 # - ruby (enabled via ruby) *1
115 # - tcl (enabled via tcl)
116 # *1 = The ${P}-bindings.patch takes care that those bindings are installed to the right location
117 # *2 = Those bindings don't build because the paths for the headers/libs aren't
118 # detected correctly and/or the options passed to swig are wrong (-php instead of -php4/5)
120 # There are several other tools in /tclpkg:
121 # gdtclft, tcldot, tclhandle, tclpathplan, tclstubs ; enabled with: --with-tcl
122 # tkspline, tkstubs ; enabled with: --with-tk
124 # And the commands (/cmd):
125 # - dot, dotty, gvedit, gvpr, lefty, lneato, smyrna, tools/* :)
126 # sci-libs/gts can be used for some of these
128 # needs Xaw and X to build
129 # - gvedit (via 'qt5'):
130 # based on ./configure it needs qt-core and qt-gui only
131 # - smyrna : experimental opengl front-end (via 'smyrna')
132 # currently disabled -- it segfaults a lot
133 # needs x11-libs/gtkglext, gnome-base/libglade, media-libs/freeglut
134 # sci-libs/gts, x11-libs/gtk. Also needs 'gtk','glade','glut','gts' and 'png'
135 # with flags enabled at configure time
138 "${FILESDIR}"/${PN}-2.34.0-Xaw-configure.patch
139 "${FILESDIR}"/${P}-qt5.patch
143 use python && python-single-r1_pkg_setup
145 java-pkg-opt-2_pkg_setup
151 # ToDo: Do the same thing for examples and/or
152 # write a patch for a configuration-option
153 # and send it to upstream
154 # note - the longer sed expression removes multi-line assignments that are extended via '\'
156 find . -iname Makefile.am \
157 | xargs sed -i -e '/^\(html\|pdf\)_DATA.*\\[[:space:]]*$/{:m;N;s/\\\n//;tm;d}' \
158 -e '/^\(html\|pdf\)_DATA/d' || die
161 # This is an old version of libtool
162 # use the ./configure option to exclude its use, and
163 # delete the dir since we don't need to eautoreconf it
166 # no nls, no gettext, no iconv macro, so disable it
168 sed -i -e '/^AM_ICONV/d' configure.ac || die
171 # Nuke the dead symlinks for the bindings
172 sed -i -e '/$(pkgluadir)/d' tclpkg/gv/Makefile.am || die
174 # replace the whitespace with tabs
175 sed -i -e 's: :\t:g' doc/info/Makefile.am || die
177 # use correct version of qmake. bug #567236
178 sed -i -e "/AC_CHECK_PROGS(QMAKE/a AC_SUBST(QMAKE,$(qt5_get_bindir)/qmake)" configure.ac || die
180 # workaround for http://www.graphviz.org/mantisbt/view.php?id=1895
181 use elibc_FreeBSD && append-flags $(test-flags -fno-builtin-sincos)
183 use java && append-cppflags $(java-pkg_get-jni-cflags)
191 --disable-silent-rules
192 $(use_enable static-libs static)
195 # libtool file collision, bug 276609
196 myconf+=( --without-included-ltdl --disable-ltdl-install )
199 $(use_with cairo pangocairo)
205 $(use_with pdf poppler)
206 $(use_with postscript ghostscript)
217 $(use_enable gdk-pixbuf)
221 # new/experimental features, to be tested, disable for now
250 sed -i -e "s:htmldir:htmlinfodir:g" doc/info/Makefile || die
252 emake DESTDIR="${D}" \
253 txtdir="${EPREFIX}"/usr/share/doc/${PF} \
254 htmldir="${EPREFIX}"/usr/share/doc/${PF}/html \
255 htmlinfodir="${EPREFIX}"/usr/share/doc/${PF}/html/info \
256 pdfdir="${EPREFIX}"/usr/share/doc/${PF}/pdf \
257 pkgconfigdir="${EPREFIX}"/usr/$(get_libdir)/pkgconfig \
260 if use !examples; then
261 rm -r "${ED}"/usr/share/graphviz/demo || die
264 if use !static-libs; then
265 find "${ED}" -name '*.la' -delete || die
268 dodoc AUTHORS ChangeLog NEWS README
270 use python && python_optimize \
271 "${D}$(python_get_sitedir)" \
272 "${D}/usr/$(get_libdir)/graphviz/python"
276 # This actually works if --enable-ltdl is passed
282 # Remove cruft, bug #547344
283 rm -rf "${EROOT}"usr/lib/graphviz/config{,6} || die