sourceHighlight: fix tests with llvm (#329993)

This commit is contained in:
Aleksana 2024-09-21 23:32:20 +08:00 committed by GitHub
commit 1f66cddf4d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,4 +1,4 @@
{ lib, stdenv, fetchpatch, fetchurl, boost, updateAutotoolsGnuConfigScriptsHook }:
{ lib, stdenv, fetchpatch, fetchurl, boost, updateAutotoolsGnuConfigScriptsHook, llvmPackages }:
stdenv.mkDerivation rec {
pname = "source-highlight";
@ -46,7 +46,10 @@ stdenv.mkDerivation rec {
# necessary to build on FreeBSD native pending inclusion of
# https://git.savannah.gnu.org/cgit/config.git/commit/?id=e4786449e1c26716e3f9ea182caf472e4dbc96e0
nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook ];
buildInputs = [ boost ];
buildInputs = [ boost ]
++ lib.optional (stdenv.targetPlatform.useLLVM or false) (llvmPackages.compiler-rt.override {
doFakeLibgcc = true;
});
configureFlags = [
"--with-boost=${boost.out}"
@ -71,4 +74,7 @@ stdenv.mkDerivation rec {
platforms = platforms.unix;
maintainers = with maintainers; [ SuperSandro2000 ];
};
} // lib.optionalAttrs (stdenv.targetPlatform.useLLVM or false) {
# Force linking to "libgcc" so tests pass
NIX_CFLAGS_COMPILE = "-lgcc";
}