about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/graphics/graphviz/base.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/tools/graphics/graphviz/base.nix')
-rw-r--r--nixpkgs/pkgs/tools/graphics/graphviz/base.nix12
1 files changed, 6 insertions, 6 deletions
diff --git a/nixpkgs/pkgs/tools/graphics/graphviz/base.nix b/nixpkgs/pkgs/tools/graphics/graphviz/base.nix
index cd2302efd165..3b9d8a4cca5d 100644
--- a/nixpkgs/pkgs/tools/graphics/graphviz/base.nix
+++ b/nixpkgs/pkgs/tools/graphics/graphviz/base.nix
@@ -7,7 +7,7 @@
 assert stdenv.isDarwin -> ApplicationServices != null;
 
 let
-  inherit (stdenv.lib) optionals optionalString;
+  inherit (stdenv.lib) optional optionals optionalString;
   raw_patch =
     # https://gitlab.com/graphviz/graphviz/issues/1367 CVE-2018-10196
     fetchpatch {
@@ -17,11 +17,13 @@ let
       excludes = ["tests/*"]; # we don't run them and they don't apply
     };
   # the patch needs a small adaption for older versions
-  patch = if stdenv.lib.versionAtLeast version "2.37" then raw_patch else
+  patchToUse = if stdenv.lib.versionAtLeast version "2.37" then raw_patch else
   stdenv.mkDerivation {
     inherit (raw_patch) name;
     buildCommand = "sed s/dot_root/agroot/g ${raw_patch} > $out";
   };
+  # 2.42 has the patch included
+  patches = optional (stdenv.lib.versionOlder version "2.42") patchToUse;
 in
 
 stdenv.mkDerivation {
@@ -50,11 +52,9 @@ stdenv.mkDerivation {
   configureFlags = [
     "--with-ltdl-lib=${libtool.lib}/lib"
     "--with-ltdl-include=${libtool}/include"
-  ] ++ stdenv.lib.optional (xorg == null) [ "--without-x" ];
+  ] ++ stdenv.lib.optional (xorg == null) "--without-x";
 
-  patches = [
-    patch
-  ];
+  inherit patches;
 
   postPatch = ''
     for f in $(find . -name Makefile.in); do