piston/runtimes/gcc-fortran.nix

39 lines
744 B
Nix
Raw Permalink Normal View History

2022-02-16 18:59:05 +01:00
{pkgs, piston, ...}:
let
pkg = pkgs.gfortran;
in piston.mkRuntime {
language = "fortran";
version = pkg.version;
runtime = "gcc";
aliases = [
"gfortran"
"f90"
];
compile = ''
rename 's/.code$/\.f90/' "$@" # Add .f90 extension
${pkg}/bin/gfortran *.f90
'';
run = ''
shift
./a.out "$@"
'';
tests = [
(piston.mkTest {
files = {
"test.f90" = ''
program test
print "(a)", 'OK'
end program test
'';
};
args = [];
stdin = "";
packages = [];
main = "test.f90";
})
];
}