Skip to content

Commit

Permalink
gfortran/gcc: simplify & clean up on Darwin
Browse files Browse the repository at this point in the history
This should eliminate the branched logic for gfortran on Darwin, as well
as preventing accidental inclusion of impure paths in gcc and gfortran
builds.
  • Loading branch information
copumpkin committed Mar 21, 2017
1 parent 7ad3fd7 commit a2a82db
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 83 deletions.
10 changes: 9 additions & 1 deletion pkgs/development/compilers/gcc/5/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ let version = "5.4.0";
++ optional langAda ../gnat-cflags.patch
++ optional langFortran ../gfortran-driving.patch

# This could be applied unconditionally but I don't want to cause a full Linux rebuild.
# This could be applied unconditionally but I don't want to cause a full
# Linux rebuild.
++ optional stdenv.cc.isClang ./libcxx38-and-above.patch;

javaEcj = fetchurl {
Expand Down Expand Up @@ -234,6 +235,13 @@ stdenv.mkDerivation ({

libc_dev = stdenv.cc.libc_dev;

# This should kill all the stdinc frameworks that gcc and friends like to
# insert into default search paths.
prePatch = if stdenv.isDarwin then ''
substituteInPlace gcc/config/darwin-c.c \
--replace 'if (stdinc)' 'if (0)'
'' else null;

postPatch =
if (stdenv.isGNU
|| (libcCross != null # e.g., building `gcc.crossDrv'
Expand Down
52 changes: 0 additions & 52 deletions pkgs/development/compilers/gcc/gfortran-darwin.nix

This file was deleted.

26 changes: 0 additions & 26 deletions pkgs/development/compilers/gcc/gfortran-darwin.patch

This file was deleted.

5 changes: 1 addition & 4 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5058,10 +5058,7 @@ with pkgs;
isl = if !stdenv.isDarwin then isl_0_14 else null;
}));

gfortran = if !stdenv.isDarwin then gfortran5
else callPackage ../development/compilers/gcc/gfortran-darwin.nix {
inherit (darwin) Libsystem;
};
gfortran = gfortran5;

gfortran48 = wrapCC (gcc48.cc.override {
name = "gfortran";
Expand Down

0 comments on commit a2a82db

Please sign in to comment.