From 646e7aa079fbe894e49efb6aa3a4fe3585bf8163 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Fri, 10 Sep 2021 12:29:06 +0100 Subject: [PATCH 1/2] sourceHighlight: apply upstream fix for gcc-11 Tested as: $ nix-build -E 'with import ./. {}; sourceHighlight.override { stdenv = gcc11Stdenv; }' --- pkgs/tools/text/source-highlight/default.nix | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/text/source-highlight/default.nix b/pkgs/tools/text/source-highlight/default.nix index 6e1a7b24b594..c1802e04779e 100644 --- a/pkgs/tools/text/source-highlight/default.nix +++ b/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" ''; From 1123630e12cb3089bd5695894b00095c52f8bf68 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sat, 11 Sep 2021 09:33:33 +0100 Subject: [PATCH 2/2] sourceHighlight: enable tests, disable parallelism in tests only --- pkgs/tools/text/source-highlight/default.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/text/source-highlight/default.nix b/pkgs/tools/text/source-highlight/default.nix index c1802e04779e..0732bf59c624 100644 --- a/pkgs/tools/text/source-highlight/default.nix +++ b/pkgs/tools/text/source-highlight/default.nix @@ -30,7 +30,12 @@ stdenv.mkDerivation rec { configureFlags = [ "--with-boost=${boost.out}" ]; - enableParallelBuilding = false; + doCheck = true; + + 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" ];