2017-12-16 01:33:52 +01:00
|
|
|
{ rev, sha256, version }:
|
|
|
|
|
|
|
|
{ stdenv, fetchFromGitLab, autoreconfHook, pkgconfig, cairo, expat, flex
|
|
|
|
, fontconfig, gd, gettext, gts, libdevil, libjpeg, libpng, libtool, pango
|
|
|
|
, yacc, xorg ? null, ApplicationServices ? null }:
|
|
|
|
|
|
|
|
assert stdenv.isDarwin -> ApplicationServices != null;
|
|
|
|
|
|
|
|
let
|
2018-07-20 21:36:12 +02:00
|
|
|
inherit (stdenv.lib) optionals optionalString;
|
2017-12-16 01:33:52 +01:00
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "graphviz-${version}";
|
|
|
|
|
|
|
|
src = fetchFromGitLab {
|
|
|
|
owner = "graphviz";
|
|
|
|
repo = "graphviz";
|
|
|
|
inherit sha256 rev;
|
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ autoreconfHook pkgconfig ];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
libpng libjpeg expat yacc libtool fontconfig gd gts libdevil flex pango
|
2018-03-14 23:58:20 +01:00
|
|
|
gettext
|
2017-12-16 01:33:52 +01:00
|
|
|
] ++ optionals (xorg != null) (with xorg; [ libXrender libXaw libXpm ])
|
2018-03-14 23:58:20 +01:00
|
|
|
++ optionals (stdenv.isDarwin) [ ApplicationServices ];
|
2017-12-16 01:33:52 +01:00
|
|
|
|
|
|
|
hardeningDisable = [ "fortify" ];
|
|
|
|
|
|
|
|
CPPFLAGS = stdenv.lib.optionalString (xorg != null && stdenv.isDarwin)
|
|
|
|
"-I${cairo.dev}/include/cairo";
|
|
|
|
|
2018-02-05 21:25:43 +01:00
|
|
|
configureFlags = [
|
|
|
|
"--with-ltdl-lib=${libtool.lib}/lib"
|
|
|
|
"--with-ltdl-include=${libtool}/include"
|
|
|
|
] ++ stdenv.lib.optional (xorg == null) [ "--without-x" ];
|
2017-12-16 01:33:52 +01:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
for f in $(find . -name Makefile.in); do
|
|
|
|
substituteInPlace $f --replace "-lstdc++" "-lc++"
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2018-04-25 05:20:18 +02:00
|
|
|
# ''
|
|
|
|
# substituteInPlace rtest/rtest.sh \
|
|
|
|
# --replace "/bin/ksh" "${mksh}/bin/mksh"
|
|
|
|
# '';
|
|
|
|
|
|
|
|
doCheck = false; # fails with "Graphviz test suite requires ksh93" which is not in nixpkgs
|
|
|
|
|
2017-12-16 01:33:52 +01:00
|
|
|
preAutoreconf = "./autogen.sh";
|
|
|
|
|
|
|
|
postFixup = optionalString (xorg != null) ''
|
|
|
|
substituteInPlace $out/bin/dotty --replace '`which lefty`' $out/bin/lefty
|
|
|
|
substituteInPlace $out/bin/vimdot \
|
|
|
|
--replace /usr/bin/vi '$(command -v vi)' \
|
|
|
|
--replace /usr/bin/vim '$(command -v vim)' \
|
|
|
|
--replace /usr/bin/vimdot $out/bin/vimdot \
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
homepage = https://graphviz.org;
|
|
|
|
description = "Graph visualization tools";
|
|
|
|
license = licenses.epl10;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with maintainers; [ bjornfor raskin ];
|
|
|
|
};
|
|
|
|
}
|