Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

darwin: gfortran: add needed inputs and other fixes

Close #10532.

authored by Asko Soukka and committed by Vladimír Čunát efd65296 1e285a7e

+50 -7
+21 -6
pkgs/development/compilers/gcc/gfortran-darwin.nix
··· 1 - # This is a derivation specific to OS X (Darwin). It may work on other 2 - # systems as well but has not been tested. 3 - {gmp, mpfr, libmpc, fetchurl, stdenv}: 1 + # This is a derivation specific to OS X (Darwin) 2 + {gmp, mpfr, libmpc, isl_0_14, cloog, zlib, fetchurl, stdenv 3 + 4 + , Libsystem 5 + }: 4 6 5 7 stdenv.mkDerivation rec { 6 8 name = "gfortran-${version}"; 7 9 version = "5.1.0"; 8 - buildInputs = [gmp mpfr libmpc]; 10 + buildInputs = [gmp mpfr libmpc isl_0_14 cloog zlib]; 9 11 src = fetchurl { 10 12 url = "mirror://gnu/gcc/gcc-${version}/gcc-${version}.tar.bz2"; 11 13 sha256 = "1bd5vj4px3s8nlakbgrh38ynxq4s654m6nxz7lrj03mvkkwgvnmp"; 12 14 }; 15 + patches = ./gfortran-darwin.patch; 13 16 configureFlags = '' 14 - --enable-languages=fortran --enable-checking=release --disable-bootstrap 17 + --disable-bootstrap 18 + --disable-cloog-version-check 19 + --disable-isl-version-check 20 + --disable-multilib 21 + --enable-checking=release 22 + --enable-languages=fortran 23 + --with-cloog=${cloog} 15 24 --with-gmp=${gmp} 25 + --with-isl=${isl_0_14} 26 + --with-mpc=${libmpc} 16 27 --with-mpfr=${mpfr} 17 - --with-mpc=${libmpc} 28 + --with-native-system-header-dir=${Libsystem}/include 29 + --with-system-zlib 30 + ''; 31 + postConfigure = '' 32 + export DYLD_LIBRARY_PATH=`pwd`/`uname -m`-apple-darwin`uname -r`/libgcc 18 33 ''; 19 34 makeFlags = ["CC=clang"]; 20 35 passthru.cc = stdenv.cc.cc;
+26
pkgs/development/compilers/gcc/gfortran-darwin.patch
··· 1 + --- a/gcc/config/darwin-c.c 2015-01-09 22:18:42.000000000 +0200 2 + +++ b/gcc/config/darwin-c.c 2015-06-27 04:17:58.000000000 +0300 3 + @@ -490,8 +490,7 @@ 4 + 5 + static const char *framework_defaults [] = 6 + { 7 + - "/System/Library/Frameworks", 8 + - "/Library/Frameworks", 9 + +// stdenvDarwinPure 10 + }; 11 + 12 + /* Register the GNU objective-C runtime include path if STDINC. */ 13 + 14 + /* Register the GNU objective-C runtime include path if STDINC. */ 15 + --- a/gcc/cppdefault.c 2015-01-05 14:33:28.000000000 +0200 16 + +++ b/gcc/cppdefault.c 2015-06-27 04:16:15.000000000 +0300 17 + @@ -35,6 +35,9 @@ 18 + # undef CROSS_INCLUDE_DIR 19 + #endif 20 + 21 + +// stdenvDarwinPure 22 + +# undef LOCAL_INCLUDE_DIR 23 + + 24 + const struct default_include cpp_include_defaults[] 25 + #ifdef INCLUDE_DEFAULTS 26 + = INCLUDE_DEFAULTS;
+3 -1
pkgs/top-level/all-packages.nix
··· 3939 3939 })); 3940 3940 3941 3941 gfortran = if !stdenv.isDarwin then gfortran49 3942 - else callPackage ../development/compilers/gcc/gfortran-darwin.nix {}; 3942 + else callPackage ../development/compilers/gcc/gfortran-darwin.nix { 3943 + inherit (darwin) Libsystem; 3944 + }; 3943 3945 3944 3946 gfortran48 = wrapCC (gcc48.cc.override { 3945 3947 name = "gfortran";