1 # Copyright 1999-2019 Gentoo Authors
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 git-r3
9 DESCRIPTION="Open Source Graph Visualization Software"
10 HOMEPAGE="https://www.graphviz.org/ https://gitlab.com/graphviz/graphviz/"
12 EGIT_REPO_URI="https://gitlab.com/graphviz/graphviz.git"
18 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"
21 !cairo? ( !X !gtk !postscript !lasi )
22 python? ( ${PYTHON_REQUIRED_USE} )"
29 >=dev-libs/glib-2.11.1:2
31 >=media-libs/fontconfig-2.3.95
32 >=media-libs/freetype-2.1.10
33 >=media-libs/gd-2.0.34:=[fontconfig,jpeg,png,truetype,zlib]
34 >=media-libs/libpng-1.2:0
39 >=x11-libs/cairo-1.1.10[svg]
42 devil? ( media-libs/devil[png,jpeg] )
43 gtk? ( x11-libs/gtk+:2 )
45 lasi? ( media-libs/lasi )
46 pdf? ( app-text/poppler )
47 perl? ( dev-lang/perl:= )
48 postscript? ( app-text/ghostscript-gpl )
49 python? ( ${PYTHON_DEPS} )
53 dev-qt/qtprintsupport:5
56 ruby? ( dev-lang/ruby:* )
57 svg? ( gnome-base/librsvg )
58 tcl? ( >=dev-lang/tcl-8.3:0= )
66 DEPEND="${COMMON_DEPEND}
70 guile? ( dev-lang/swig dev-scheme/guile )
71 java? ( dev-lang/swig >=virtual/jdk-1.5 )
72 nls? ( >=sys-devel/gettext-0.14.5 )
73 perl? ( dev-lang/swig )
74 python? ( dev-lang/swig )
75 ruby? ( dev-lang/swig )
76 tcl? ( dev-lang/swig )"
77 RDEPEND="${COMMON_DEPEND}
78 !<=sci-chemistry/cluster-1.3.081231"
80 # Dependency description / Maintainer-Info:
82 # Rendering is done via the following plugins (/plugins):
83 # - core, dot_layout, neato_layout, gd , dot
84 # the ones which are always compiled in, depend on zlib, gd
86 # Directly depends on gtk-2.
87 # needs 'pangocairo' enabled in graphviz configuration
88 # gtk-2 depends on pango, cairo and libX11 directly.
90 # Disabled, GTK-1 junk.
92 # Disabled, no particular reason
93 # needs 'pangocairo' enabled in graphviz configuration
95 # flash plugin via -Tswf requires media-libs/ming-0.4. Disabled as it's
98 # Needs pango for text layout, uses cairo methods to draw stuff
101 # can make use of gnomeui and inotify support (??? unsure),
102 # needs libXaw for UI
103 # UI also links directly against libX11, libXmu, and libXt
104 # and uses libXpm if available so we make sure it always is
106 # There can be swig-generated bindings for the following languages (/tclpkg/gv):
107 # - c-sharp (disabled)
108 # - scheme (enabled via guile) ... no longer broken on ~x86
110 # - java (enabled via java) *2
111 # - lua (enabled via lua)
112 # - ocaml (enabled via ocaml)
113 # - perl (enabled via perl) *1
114 # - php (enabled via php) *2
115 # - python (enabled via python) *1
116 # - ruby (enabled via ruby) *1
117 # - tcl (enabled via tcl)
118 # *1 = The ${P}-bindings.patch takes care that those bindings are installed to the right location
119 # *2 = Those bindings don't build because the paths for the headers/libs aren't
120 # detected correctly and/or the options passed to swig are wrong (-php instead of -php4/5)
122 # There are several other tools in /tclpkg:
123 # gdtclft, tcldot, tclhandle, tclpathplan, tclstubs ; enabled with: --with-tcl
124 # tkspline, tkstubs ; enabled with: --with-tk
126 # And the commands (/cmd):
127 # - dot, dotty, gvedit, gvpr, lefty, lneato, smyrna, tools/* :)
128 # sci-libs/gts can be used for some of these
130 # needs Xaw and X to build
131 # - gvedit (via 'qt5'):
132 # based on ./configure it needs qt-core and qt-gui only
133 # - smyrna : experimental opengl front-end (via 'smyrna')
134 # currently disabled -- it segfaults a lot
135 # needs x11-libs/gtkglext, gnome-base/libglade, media-libs/freeglut
136 # sci-libs/gts, x11-libs/gtk. Also needs 'gtk','glade','glut','gts' and 'png'
137 # with flags enabled at configure time
140 "${FILESDIR}"/${PN}-2.34.0-Xaw-configure.patch
144 use python && python-single-r1_pkg_setup
146 java-pkg-opt-2_pkg_setup
154 # ToDo: Do the same thing for examples and/or
155 # write a patch for a configuration-option
156 # and send it to upstream
157 # note - the longer sed expression removes multi-line assignments that are extended via '\'
159 find . -iname Makefile.am \
160 | xargs sed -i -e '/^\(html\|pdf\)_DATA.*\\[[:space:]]*$/{:m;N;s/\\\n//;tm;d}' \
161 -e '/^\(html\|pdf\)_DATA/d' || die
164 # This is an old version of libtool
165 # use the ./configure option to exclude its use, and
166 # delete the dir since we don't need to eautoreconf it
169 # no nls, no gettext, no iconv macro, so disable it
171 sed -i -e '/^AM_ICONV/d' configure.ac || die
174 # Nuke the dead symlinks for the bindings
175 sed -i -e '/$(pkgluadir)/d' tclpkg/gv/Makefile.am || die
177 # replace the whitespace with tabs
178 sed -i -e 's: :\t:g' doc/info/Makefile.am || die
180 # use correct version of qmake. bug #567236
181 sed -i -e "/AC_CHECK_PROGS(QMAKE/a AC_SUBST(QMAKE,$(qt5_get_bindir)/qmake)" configure.ac || die
183 # workaround for http://www.graphviz.org/mantisbt/view.php?id=1895
184 use elibc_FreeBSD && append-flags $(test-flags -fno-builtin-sincos)
186 use java && append-cppflags $(java-pkg_get-jni-cflags)
188 append-cxxflags -std=c++11 # bug 648764
196 --disable-silent-rules
197 $(use_enable static-libs static)
200 # libtool file collision, bug 276609
201 myconf+=( --without-included-ltdl --disable-ltdl-install )
204 $(use_with cairo pangocairo)
210 $(use_with pdf poppler)
211 $(use_with postscript ghostscript)
222 $(use_enable gdk-pixbuf)
226 # new/experimental features, to be tested, disable for now
255 sed -i -e "s:htmldir:htmlinfodir:g" doc/info/Makefile || die
257 emake DESTDIR="${D}" \
258 txtdir="${EPREFIX}"/usr/share/doc/${PF} \
259 htmldir="${EPREFIX}"/usr/share/doc/${PF}/html \
260 htmlinfodir="${EPREFIX}"/usr/share/doc/${PF}/html/info \
261 pdfdir="${EPREFIX}"/usr/share/doc/${PF}/pdf \
262 pkgconfigdir="${EPREFIX}"/usr/$(get_libdir)/pkgconfig \
265 if ! use examples; then
266 rm -rf "${ED}"/usr/share/graphviz/demo || die
269 if ! use static-libs; then
270 find "${ED}" -name '*.la' -delete || die
273 dodoc AUTHORS ChangeLog NEWS README
275 use python && python_optimize \
276 "${D}$(python_get_sitedir)" \
277 "${D}/usr/$(get_libdir)/graphviz/python"
281 # This actually works if --enable-ltdl is passed
287 # Remove cruft, bug #547344
288 rm -rf "${EROOT}"usr/lib/graphviz/config{,6} || die