add piston nix pkg for gcc-fortran

This commit is contained in:
Dan Vargas 2022-02-16 10:59:05 -07:00
parent 11882b2085
commit 3fac94b683
11 changed files with 40 additions and 108 deletions

39
runtimes/gcc-fortran.nix Normal file
View file

@ -0,0 +1,39 @@
{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";
})
];
}