forked from input-output-hk/cardano-sl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshell.nix
32 lines (32 loc) · 1.14 KB
/
shell.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
let
localLib = import ./lib.nix;
jemallocOverlay = self: super: {
# jemalloc has a bug that caused cardano-sl-db to fail to link (via
# rocksdb, which can use jemalloc).
# https://github.com/jemalloc/jemalloc/issues/937
# Using jemalloc 510 with the --disable-initial-exec-tls flag seems to
# fix it.
jemalloc = self.callPackage ./nix/jemalloc/jemalloc510.nix {};
};
in
{ system ? builtins.currentSystem
, config ? {}
, pkgs ? (import (localLib.fetchNixPkgs) { inherit system config; overlays = [ jemallocOverlay ]; })
}:
with pkgs;
let
hsPkgs = haskell.packages.ghc822;
in
haskell.lib.buildStackProject {
name = "cardano-sl";
ghc = hsPkgs.ghc;
buildInputs = [
zlib openssh autoreconfHook openssl
gmp rocksdb git bsdiff ncurses
hsPkgs.happy hsPkgs.cpphs lzma
perl bash
# cabal-install and stack pull in lots of dependencies on OSX so skip them
# See https://github.com/NixOS/nixpkgs/issues/21200
] ++ (lib.optionals stdenv.isLinux [ cabal-install stack ])
++ (lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ Cocoa CoreServices libcxx libiconv ]));
}