Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
Ericson2314 committed Apr 1, 2019
1 parent e8177a5 commit 16e7381
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,23 @@
let
fetchNixpkgs = import ./nix/fetch-tarball-with-override.nix "custom_nixpkgs";
in
{ nixpkgsPin ? ./nix/pins/nixpkgs.src-json
, nixpkgs ? import (fetchNixpkgs nixpkgsPin) {}
{ nixpkgsFun ? import (fetchNixpkgs nixpkgsPin)
, crossSystem ? null
, nixpkgs ? nixpkgsFun { inherit crossSystem; }
, bootghc ? "ghc844"
, version ? "8.7"
, hadrianCabal ? (builtins.getEnv "PWD") + "/hadrian/hadrian.cabal"
, useClang ? false # use Clang for C compilation
, withLlvm ? false
, withDocs ? true
, withHadrianDeps ? false
, 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
, cores ? 4
}:

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

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

depsSystem = with stdenv.lib; (
depsSystemForHost = with stdenv.lib; (
[ autoconf automake m4
gmp.dev gmp.out glibcLocales
ncurses.dev ncurses.out
Expand All @@ -62,6 +64,15 @@ let
);
depsTools = with hspkgs; [ alex cabal-install happy ];

depsSystemForTarget = with stdenv.lib; with targetPackages;
[ gmp.dev gmp.out glibcLocales
ncurses.dev ncurses.out
zlib.out
zlib.dev
]
++ optional withNuma targetPackages.numactl
;

hadrianCabalExists = builtins.pathExists hadrianCabal;
hsdrv = if (withHadrianDeps &&
builtins.trace "checking if ${toString hadrianCabal} is present: ${if hadrianCabalExists then "yes" else "no"}"
Expand All @@ -84,7 +95,7 @@ let
in
(hspkgs.shellFor rec {
packages = pkgset: [ hsdrv ];
buildInputs = depsSystem ++ depsTools;
buildInputs = depsSystem ++ depsSystemForTarget ++ depsTools;

hardeningDisable = ["fortify"] ; ## Effectuated by cc-wrapper
# Without this, we see a whole bunch of warnings about LANG, LC_ALL and locales in general.
Expand Down

0 comments on commit 16e7381

Please sign in to comment.