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