git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #32731 from yegortimoshenko/graphviz/src

graphviz: cleanup, use autoreconfHook, source from GitLab

commit7c912372397773b32b6cdab85fc3de983a49662e authorMichael Raskin <7c6f434c@mail.ru> dateSat 16 Dec 2017, 15:39 (9 years ago) parent0e37c90fcabea6
5 files changed+66−187
pkgs/tools/graphics/graphviz/0001-vimdot-lookup-vim-in-PATH.patch−30 pkgs/tools/graphics/graphviz/2.32.nix+3−65 pkgs/tools/graphics/graphviz/base.nix+59 pkgs/tools/graphics/graphviz/cve-2014-9157.patch−24 pkgs/tools/graphics/graphviz/default.nix+4−68
pkgs/tools/graphics/graphviz/0001-vimdot-lookup-vim-in-PATH.patchdeleted−30
@@ -1,30 +0,0 @@
1−From 2008bf62e13ebe41cdad3e16f8b42f46ae393876 Mon Sep 17 00:00:00 2001
2−From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= <bjorn.forsman@gmail.com>
3−Date: Tue, 6 Jan 2015 20:39:41 +0100
4−Subject: [PATCH] vimdot: lookup 'vim' in $PATH
5−
6−Instead of hardcoding /usr/bin/vim. Needed for NixOS (http://nixos.org), and is
7−probably useful for others too.
8−---
9− plugin/xlib/vimdot.sh | 4 ++--
10− 1 file changed, 2 insertions(+), 2 deletions(-)
11−
12−diff --git a/plugin/xlib/vimdot.sh b/plugin/xlib/vimdot.sh
13−index 749fe6a..4e6dd4b 100755
14−--- a/plugin/xlib/vimdot.sh
15−+++ b/plugin/xlib/vimdot.sh
16−@@ -3,9 +3,9 @@
17−
18− error() { echo "$0: $*" >&2; exit 1; }
19−
20−-editor="/usr/bin/vim"
21−+editor="vim"
22−
23−-if ! test -x "$editor"; then error "the \"$editor\" editor not found or not executable"; fi
24−+if ! test -x "$(command -v "$editor")"; then error "the \"$editor\" editor not found or not executable"; fi
25−
26− default="noname.gv"
27−
28−--
29−2.1.3
30−
pkgs/tools/graphics/graphviz/2.32.nix+3−65
@@ -1,67 +1,5 @@
1−{ stdenv, fetchurl, pkgconfig, libpng, libjpeg, expat, libXaw
2−, yacc, libtool, fontconfig, pango, gd, xorg, gts, gettext, cairo
3−, ApplicationServices
4−}:
5−
6−stdenv.mkDerivation rec {
1+import ./base.nix {
2+ rev = "10c3c34c5198beacfba950764f34960c6884a34f";
73 version = "2.32.0";
8− name = "graphviz-${version}";
9−
10− src = fetchurl {
11− url = "http://www.graphviz.org/pub/graphviz/ARCHIVE/${name}.tar.gz";
12− sha256 = "0ym7lw3xnkcgbk32vfmm3329xymca60gzn90rq6dv8887qqv4lyq";
13− };
14−
15− buildInputs =
16− [ pkgconfig libpng libjpeg expat libXaw yacc libtool fontconfig
17− pango gd gts
18− ] ++ stdenv.lib.optionals (xorg != null) [ xorg.xlibsWrapper xorg.libXrender ]
19− ++ stdenv.lib.optionals stdenv.isDarwin [ ApplicationServices gettext ];
20−
21− CPPFLAGS = stdenv.lib.optionalString (stdenv.system == "x86_64-darwin") "-I${cairo.dev}/include/cairo";
22−
23− configureFlags =
24− [ "--with-pngincludedir=${libpng.dev}/include"
25− "--with-pnglibdir=${libpng.out}/lib"
26− "--with-jpegincludedir=${libjpeg.dev}/include"
27− "--with-jpeglibdir=${libjpeg.out}/lib"
28− "--with-expatincludedir=${expat.dev}/include"
29− "--with-expatlibdir=${expat.out}/lib"
30− "--with-ltdl-include=${libtool}/include"
31− "--with-ltdl-lib=${libtool.lib}/lib"
32− "--with-cgraph=no"
33− "--with-sparse=no"
34− ]
35− ++ stdenv.lib.optional (xorg == null) "--without-x";
36−
37− hardeningDisable = [ "fortify" ];
38−
39− preBuild = ''
40− sed -e 's@am__append_5 *=.*@am_append_5 =@' -i lib/gvc/Makefile
41− '';
42−
43− # "command -v" is POSIX, "which" is not
44− postInstall = ''
45− sed -i 's|`which lefty`|"'$out'/bin/lefty"|' $out/bin/dotty
46− sed -i 's|which|command -v|' $out/bin/vimdot
47− '';
48−
49− meta = {
50− homepage = http://www.graphviz.org/;
51− description = "Open source graph visualization software";
52−
53− longDescription = ''
54− Graphviz is open source graph visualization software. Graph
55− visualization is a way of representing structural information as
56− diagrams of abstract graphs and networks. It has important
57− applications in networking, bioinformatics, software engineering,
58− database and web design, machine learning, and in visual
59− interfaces for other technical domains.
60− '';
61−
62− platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin;
63− maintainers = with stdenv.lib.maintainers; [ bjornfor raskin ];
64− inherit version;
65− branch = "2.32";
66− };
4+ sha256 = "18b2wnz6xk8hndy7dlr1vn9vziyryyflh747n9966778gmh8bick";
675}
pkgs/tools/graphics/graphviz/base.nixnew file+59
@@ -0,0 +1,59 @@
1+{ rev, sha256, version }:
2+
3+{ stdenv, fetchFromGitLab, autoreconfHook, pkgconfig, cairo, expat, flex
4+, fontconfig, gd, gettext, gts, libdevil, libjpeg, libpng, libtool, pango
5+, yacc, xorg ? null, ApplicationServices ? null }:
6+
7+assert stdenv.isDarwin -> ApplicationServices != null;
8+
9+let
10+ inherit (stdenv.lib) optional optionals optionalString;
11+in
12+
13+stdenv.mkDerivation rec {
14+ name = "graphviz-${version}";
15+
16+ src = fetchFromGitLab {
17+ owner = "graphviz";
18+ repo = "graphviz";
19+ inherit sha256 rev;
20+ };
21+
22+ nativeBuildInputs = [ autoreconfHook pkgconfig ];
23+
24+ buildInputs = [
25+ libpng libjpeg expat yacc libtool fontconfig gd gts libdevil flex pango
26+ ] ++ optionals (xorg != null) (with xorg; [ libXrender libXaw libXpm ])
27+ ++ optionals (stdenv.isDarwin) [ ApplicationServices gettext ];
28+
29+ hardeningDisable = [ "fortify" ];
30+
31+ CPPFLAGS = stdenv.lib.optionalString (xorg != null && stdenv.isDarwin)
32+ "-I${cairo.dev}/include/cairo";
33+
34+ configureFlags = optional (xorg == null) "--without-x";
35+
36+ postPatch = ''
37+ for f in $(find . -name Makefile.in); do
38+ substituteInPlace $f --replace "-lstdc++" "-lc++"
39+ done
40+ '';
41+
42+ preAutoreconf = "./autogen.sh";
43+
44+ postFixup = optionalString (xorg != null) ''
45+ substituteInPlace $out/bin/dotty --replace '`which lefty`' $out/bin/lefty
46+ substituteInPlace $out/bin/vimdot \
47+ --replace /usr/bin/vi '$(command -v vi)' \
48+ --replace /usr/bin/vim '$(command -v vim)' \
49+ --replace /usr/bin/vimdot $out/bin/vimdot \
50+ '';
51+
52+ meta = with stdenv.lib; {
53+ homepage = https://graphviz.org;
54+ description = "Graph visualization tools";
55+ license = licenses.epl10;
56+ platforms = platforms.unix;
57+ maintainers = with maintainers; [ bjornfor raskin ];
58+ };
59+}
pkgs/tools/graphics/graphviz/cve-2014-9157.patchdeleted−24
@@ -1,24 +0,0 @@
1−From https://lists.debian.org/debian-qa-packages/2014/12/msg00048.html , which
2−seems to come from Ubuntu.
3−
4−Subject: Fix format string vulnerability (CVE-2014-9157) in yyerror() routine
5−Origin: https://github.com/ellson/graphviz/commit/99eda421f7ddc27b14e4ac1d2126e5fe41719081
6−Author: Emden R. Gansner
7−
8−---
9− lib/cgraph/scan.l | 2 +-
10− 1 file changed, 1 insertion(+), 1 deletion(-)
11−
12−Index: b/lib/cgraph/scan.l
13−===================================================================
14−--- a/lib/cgraph/scan.l
15−+++ b/lib/cgraph/scan.l
16−@@ -225,7 +225,7 @@
17− agxbput (&xb, buf);
18− agxbput (&xb, yytext);
19− agxbput (&xb,"'\n");
20−- agerr(AGERR,agxbuse(&xb));
21−+ agerr(AGERR, "%s", agxbuse(&xb));
22− agxbfree(&xb);
23− }
24− /* must be here to see flex's macro defns */
pkgs/tools/graphics/graphviz/default.nix+4−68
@@ -1,69 +1,5 @@
1−{ stdenv, fetchurl, pkgconfig, libpng, libjpeg, expat
2−, yacc, libtool, fontconfig, pango, gd, xorg, gts, libdevil, gettext, cairo
3−, flex
4−, ApplicationServices
5−}:
6−
7−stdenv.mkDerivation rec {
1+import ./base.nix rec {
2+ rev = "stable_release_${version}";
83 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−}
4+ sha256 = "1xjqq3g2n6jgwp5xzyvibgrxawlskkpam69fjjz9ksrrjas2qwzj";
5+ }