lol
1{ stdenv, fetchurl, pkgconfig, libpng, libjpeg, expat
2, yacc, libtool, fontconfig, pango, gd, xorg, gts, libdevil, gettext, cairo
3, flex
4, ApplicationServices
5}:
6
7stdenv.mkDerivation rec {
8 version = "2.40.1";
9 name = "graphviz-${version}";
10
11 src = fetchurl {
12 url = "http://www.graphviz.org/pub/graphviz/ARCHIVE/${name}.tar.gz";
13 sha256 = "08d4ygkxz2f553bxj6087da56a23kx1khv0j8ycxa102vvx1hlna";
14 };
15
16 hardeningDisable = [ "fortify" ];
17
18 patches = [ ];
19
20 buildInputs =
21 [ pkgconfig libpng libjpeg expat yacc libtool fontconfig gd gts libdevil flex pango
22 ] ++ stdenv.lib.optionals (xorg != null)
23 (with xorg; [ xlibsWrapper libXrender libXaw libXpm ])
24 ++ stdenv.lib.optionals (stdenv.isDarwin) [ ApplicationServices gettext ];
25
26 CPPFLAGS = stdenv.lib.optionalString (xorg != null && stdenv.isDarwin)
27 "-I${cairo.dev}/include/cairo";
28
29 configureFlags = stdenv.lib.optional (xorg == null) "--without-x";
30
31 postPatch = (stdenv.lib.optionalString stdenv.isDarwin ''
32 for foo in cmd/dot/Makefile.in cmd/edgepaint/Makefile.in \
33 cmd/mingle/Makefile.in plugin/gdiplus/Makefile.in; do
34 substituteInPlace "$foo" --replace "-lstdc++" "-lc++"
35 done
36 '') + ''
37 substituteInPlace "plugin/xlib/vimdot.sh" --replace "/usr/bin/vim" "\$(command -v vim)"
38 '';
39
40 preBuild = ''
41 sed -e 's@am__append_5 *=.*@am_append_5 =@' -i lib/gvc/Makefile
42 '';
43
44 # "command -v" is POSIX, "which" is not
45 postInstall = stdenv.lib.optionalString (xorg != null) ''
46 sed -i 's|`which lefty`|"'$out'/bin/lefty"|' $out/bin/dotty
47 sed -i 's|which|command -v|' $out/bin/vimdot
48 '';
49
50 meta = {
51 homepage = http://www.graphviz.org/;
52 description = "Open source graph visualization software";
53
54 longDescription = ''
55 Graphviz is open source graph visualization software. Graph
56 visualization is a way of representing structural information as
57 diagrams of abstract graphs and networks. It has important
58 applications in networking, bioinformatics, software engineering,
59 database and web design, machine learning, and in visual
60 interfaces for other technical domains.
61 '';
62
63 platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin;
64 maintainers = with stdenv.lib.maintainers; [ bjornfor raskin ];
65 downloadPage = "http://www.graphviz.org/pub/graphviz/ARCHIVE/";
66 inherit version;
67 updateWalker = true;
68 };
69}