Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
Ericson2314 committed Mar 27, 2019
1 parent ce79420 commit 9181be4
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,22 @@
# nix-shell path/to/ghc.nix/ --run 'hadrian/build.sh -c -j4 --flavour=quickest'
# nix-shell path/to/ghc.nix/ --run 'THREADS=4 ./validate --slow'
#
{ nixpkgs ? import ./nixpkgs.nix {}
{ nixpkgsFun ? import ./nixpkgs.nix
, crossSystem ? null
, nixpkgs ? nixpkgsFun { inherit crossSystem; }
, bootghc ? "ghc844"
, version ? "8.7"
, useClang ? false # use Clang for C compilation
, withLlvm ? false
, withDocs ? true
, withDwarf ? nixpkgs.stdenv.isLinux # enable libdw unwinding support
, withNuma ? nixpkgs.stdenv.isLinux
, withDwarf ? nixpkgs.stdenv.hostPlatform.isLinux # enable libdw unwinding support
, withNuma ? nixpkgs.stdenv.hostPlatform.isLinux
, mkFile ? null
, cores ? 4
}:

with nixpkgs;
# build = host =?= target
with nixpkgs.buildPackages;

let
stdenv =
Expand All @@ -33,7 +36,7 @@ let
fonts = nixpkgs.makeFontsConf { fontDirectories = [ nixpkgs.dejavu_fonts ]; };
docsPackages = if withDocs then [ python3Packages.sphinx ourtexlive ] else [];

deps =
buildDeps =
[ autoconf automake m4
gmp.dev gmp.out glibcLocales
ncurses.dev ncurses.out
Expand All @@ -46,15 +49,26 @@ let
]
++ docsPackages
++ stdenv.lib.optional withLlvm llvm_6
++ stdenv.lib.optional withNuma numactl
++ stdenv.lib.optional withNuma targetPackages.nugactl
++ stdenv.lib.optional withDwarf elfutils
++ stdenv.lib.optional (! stdenv.isDarwin) pxz ;

env = buildEnv {
runDeps =
[ gmp.dev gmp.out glibcLocales
ncurses.dev ncurses.out
zlib.out
zlib.dev
];

buildEnv = buildEnv {
name = "ghc-build-environment";
paths = deps;
};

runEnv = buildEnv {
name = "ghc-run-environment";
paths = deps;
};
in

stdenv.mkDerivation rec {
Expand Down

0 comments on commit 9181be4

Please sign in to comment.