From ec2f3eb855ed22df4a56ccded9d285321fd4a69d Mon Sep 17 00:00:00 2001 From: Allen Nelson Date: Tue, 19 May 2015 15:59:55 -0500 Subject: [PATCH] added gfortran expression for darwin --- .../compilers/gcc/gfortran-darwin.nix | 22 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 3 ++- 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/compilers/gcc/gfortran-darwin.nix diff --git a/pkgs/development/compilers/gcc/gfortran-darwin.nix b/pkgs/development/compilers/gcc/gfortran-darwin.nix new file mode 100644 index 000000000000..58f30f677b6d --- /dev/null +++ b/pkgs/development/compilers/gcc/gfortran-darwin.nix @@ -0,0 +1,22 @@ +# This is a derivation customized to work on OS X (Darwin). +{gmp, mpfr, libmpc, fetchurl, stdenv}: + +# This package is only intended for OSX. +assert stdenv.isDarwin; + +stdenv.mkDerivation rec { + name = "gfortran"; + version = "5.1.0"; + buildInputs = [gmp mpfr libmpc]; + src = fetchurl { + url = "https://ftp.gnu.org/gnu/gcc/gcc-${version}/gcc-${version}.tar.bz2"; + sha256 = "1bd5vj4px3s8nlakbgrh38ynxq4s654m6nxz7lrj03mvkkwgvnmp"; + }; + configureFlags = '' + --enable-languages=fortran --enable-checking=release --disable-bootstrap + --with-gmp=${gmp} + --with-mpfr=${mpfr} + --with-mpc=${libmpc} + ''; + makeFlags = ["CC=/usr/bin/gcc"]; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 40a77f8a623d..86f71ddb5025 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3676,7 +3676,8 @@ let isl = isl_0_14; })); - gfortran = gfortran48; + gfortran = if !stdenv.isDarwin then gfortran48 + else callPackage ../development/compilers/gcc/gfortran-darwin.nix {}; gfortran48 = wrapCC (gcc48.cc.override { name = "gfortran";