Files
John Ericson 853bc44bad gccNGPackages.libquadmath: keep longlong.h in the source
`printf/gmp-impl.h` includes `longlong.h`, and the `Makefile` looks for it in
`../include`, but the source subset never copied that directory:

    gmp-impl.h:71:10: fatal error: longlong.h: No such file or directory

`libiberty`, `libgomp` and `libstdcxx` all copy `include` already; do the
same. Not new in 16 -- 15 fails the same way, so nothing had built this.

Assisted-by: Claude Code (Claude Opus 5)
2026-09-01 12:04:46 -04:00

61 lines
1.2 KiB
Nix

{
lib,
stdenv,
gcc_meta,
release_version,
version,
monorepoSrc ? null,
runCommand,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "libquadmath";
inherit version;
src = runCommand "libquadmath-src-${version}" { src = monorepoSrc; } (
''
runPhase unpackPhase
mkdir -p "$out/gcc"
cp gcc/BASE-VER "$out/gcc"
cp gcc/DATESTAMP "$out/gcc"
cp -r libquadmath "$out"
# `printf/gmp-impl.h` includes `longlong.h`, which lives here; the
# `Makefile` already looks in `../include` for it.
cp -r include "$out"
cp config.guess "$out"
cp config.rpath "$out"
cp config.sub "$out"
cp config-ml.in "$out"
cp ltmain.sh "$out"
cp install-sh "$out"
cp mkinstalldirs "$out"
''
# `MD5SUMS` exists only in release tarballs, not in a VCS checkout.
+ ''
if [[ -f MD5SUMS ]]; then cp MD5SUMS "$out"; fi
''
);
sourceRoot = "${finalAttrs.src.name}/libquadmath";
preConfigure = ''
mkdir ../../build
cd ../../build
configureScript=../$sourceRoot/configure
'';
doCheck = true;
passthru = {
isGNU = true;
};
meta = gcc_meta // {
homepage = "https://gcc.gnu.org/";
};
})