-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcrlibm-fortran.nix
More file actions
39 lines (35 loc) · 801 Bytes
/
Copy pathcrlibm-fortran.nix
File metadata and controls
39 lines (35 loc) · 801 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{
stdenv,
gfortran,
fetchgit,
crlibm,
}:
let
version = "1.1";
in
stdenv.mkDerivation {
pname = "crmath";
inherit version;
src = fetchgit {
url = "https://github.com/rhdtownsend/crmath";
rev = "62822222b94810dd9601a4076a6ca36a20211bff";
hash = "sha256-JAdDURvFLZtPMWTZ9jyxSzhhlYuwc/y//IYNOvmi948=";
};
nativeBuildInputs = [ gfortran ];
propagatedBuildInputs = [ crlibm ];
installPhase = ''
mkdir -p $out/lib
mkdir -p $out/lib/pkgconfig
mkdir -p $out/include
cp libcrmath.a $out/lib
cp crmath.mod *.smod $out/include
cat <<EOF > $out/lib/pkgconfig/crmath.pc
Name: crmath
Version: ${version}
Requires: crlibm
Description: FORTRAN bindings for crlibm
Cflags: -I$out/include
Libs: -L$out/lib -lcrmath
EOF
'';
}