Files
nixpkgs/pkgs/by-name/li/libf2c/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

59 lines
1.3 KiB
Nix

{
lib,
stdenv,
fetchurl,
unzip,
}:
stdenv.mkDerivation rec {
pname = "libf2c";
version = "20160102";
src = fetchurl {
url = "http://www.netlib.org/f2c/libf2c.zip";
sha256 = "1q78y8j8xpl8zdzdxmn5ablss56hi5a7vz3idam9l2nfx5q40h6a";
};
unpackPhase = ''
mkdir build
cd build
unzip ${src}
'';
postPatch = ''
substituteInPlace makefile.u \
--replace-fail "ld" "${stdenv.cc.targetPrefix}ld"
'';
makeFlags = [
"-f"
"makefile.u"
"CC=${stdenv.cc.targetPrefix}cc"
];
installPhase = ''
mkdir -p $out/include $out/lib
cp libf2c.a $out/lib
cp f2c.h $out/include
'';
nativeBuildInputs = [ unzip ];
hardeningDisable = [ "format" ];
# Makefile is missing depepdencies on generated headers:
# main.c:4:10: fatal error: signal1.h: No such file or directory
enableParallelBuilding = false;
meta = {
description = "F2c converts Fortran 77 source code to C";
homepage = "http://www.netlib.org/f2c/";
license = lib.licenses.mit;
platforms = lib.platforms.unix;
# Generates arith.h at build time. Uses non-standard fpu_control.h.
broken =
(!stdenv.buildPlatform.canExecute stdenv.hostPlatform)
|| (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.libc != "glibc");
};
}