about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/text/source-highlight/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/tools/text/source-highlight/default.nix')
-rw-r--r--nixpkgs/pkgs/tools/text/source-highlight/default.nix20
1 files changed, 17 insertions, 3 deletions
diff --git a/nixpkgs/pkgs/tools/text/source-highlight/default.nix b/nixpkgs/pkgs/tools/text/source-highlight/default.nix
index 6e1a7b24b594..8817b7a09fda 100644
--- a/nixpkgs/pkgs/tools/text/source-highlight/default.nix
+++ b/nixpkgs/pkgs/tools/text/source-highlight/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchurl, boost }:
+{ lib, stdenv, fetchpatch, fetchurl, boost }:
 
 stdenv.mkDerivation rec {
   pname = "source-highlight";
@@ -9,10 +9,19 @@ stdenv.mkDerivation rec {
     sha256 = "148w47k3zswbxvhg83z38ifi85f9dqcpg7icvvw1cm6bg21x4zrs";
   };
 
+  patches = [
+    # gcc-11 compat upstream patch
+    (fetchpatch {
+      url = "http://git.savannah.gnu.org/cgit/src-highlite.git/patch/?id=904949c9026cb772dc93fbe0947a252ef47127f4";
+      sha256 = "1wnj0jmkmrwjww7qk9dvfxh8h06jdn7mi8v2fvwh95b6x87z5l47";
+      excludes = [ "ChangeLog" ];
+    })
+  ];
+
   # source-highlight uses it's own binary to generate documentation.
   # During cross-compilation, that binary was built for the target
   # platform architecture, so it can't run on the build host.
-  patchPhase = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
+  postPatch = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
     substituteInPlace Makefile.in --replace "src doc tests" "src tests"
   '';
 
@@ -21,7 +30,12 @@ stdenv.mkDerivation rec {
 
   configureFlags = [ "--with-boost=${boost.out}" ];
 
-  enableParallelBuilding = false;
+  doCheck = !stdenv.cc.isClang;
+
+  enableParallelBuilding = true;
+  # Upstream uses the same intermediate files in multiple tests, running
+  # them in parallel by make will eventually break one or more tests.
+  enableParallelChecking = false;
 
   outputs = [ "out" "doc" "dev" ];