1{ lib, stdenv, fetchurl }:
2
3stdenv.mkDerivation {
4 pname = "f2c";
5 version = "20240312";
6
7 src = fetchurl {
8 url = "https://www.netlib.org/f2c/src.tgz";
9 sha256 = "sha256-TTPve2fe31/Ad+xFAWy6NUIes2QyUi6NjFucN0pdb5k=";
10 };
11
12 makeFlags = [ "-f" "makefile.u" ];
13
14 # Ensure xsum binary is built from scratch
15 preBuild = "rm xsum";
16
17 installPhase = ''
18 runHook preInstall
19
20 mkdir -p $out/bin $out/share/man/man1
21 install -m755 f2c $out/bin
22 install -m755 xsum $out/bin
23 install f2c.1t $out/share/man/man1
24
25 runHook postInstall
26 '';
27
28 meta = with lib; {
29 description = "Convert Fortran 77 source code to C";
30 homepage = "https://www.netlib.org/f2c/";
31 license = licenses.mit;
32 maintainers = [ maintainers.markuskowa ];
33 platforms = platforms.unix;
34 };
35}