about summary refs log tree commit diff
path: root/shell.nix
blob: 07629a197143fc2f3035824e829fdc94ea600101 (plain) (blame)
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
{ toolchain ? "",
  nixpkgs ? (import <nixpkgs> {}).fetchFromGitHub {
    owner  = "NixOS";
    repo   = "nixpkgs";
    rev    = "053ad4e0db7241ae6a02394d62750fdc5d64aa9f";
    sha256 = "11l9sr8zg8j1n5p43zjkqwpj59gn8c84z1kf16icnsbnv2smzqdc";
  }}:

with import nixpkgs {};

let
  # For the documentation tools we use an older Nixpkgs since the
  # newer versions seem to be not working great...
  oldNixpkgsSrc = fetchFromGitHub {
                    owner  = "NixOS";
                    repo   = "nixpkgs";
                    rev    = "d0d905668c010b65795b57afdf7f0360aac6245b";
                    sha256 = "1kqxfmsik1s1jsmim20n5l4kq6wq8743h5h17igfxxbbwwqry88l";
                  };
  oldNixpkgs    = import oldNixpkgsSrc {};
  docs          = import ./nix/docs.nix { nixpkgs = oldNixpkgsSrc; };
  benchmarks    = import ./nix/benchmarks.nix { inherit nixpkgs; };
  tc            =
    if toolchain == ""        then { stdenv = stdenv; cc = stdenv.cc; } else
    if toolchain == "gnu-6"   then { stdenv = gcc6Stdenv; cc = gcc6; } else
    if toolchain == "gnu-7"   then { stdenv = gcc7Stdenv; cc = gcc7; } else
    if toolchain == "gnu-8"   then { stdenv = gcc8Stdenv; cc = gcc8; } else
    if toolchain == "gnu-9"   then { stdenv = gcc9Stdenv; cc = gcc9; } else
    if toolchain == "llvm-39" then { stdenv = llvmPackages_39.libcxxStdenv; cc = llvmPackages_39.libcxxClang; } else
    if toolchain == "llvm-4"  then { stdenv = llvmPackages_4.libcxxStdenv; cc = llvmPackages_4.libcxxClang; } else
    if toolchain == "llvm-5"  then { stdenv = llvmPackages_5.libcxxStdenv; cc = llvmPackages_5.libcxxClang; } else
    if toolchain == "llvm-6"  then { stdenv = llvmPackages_6.libcxxStdenv; cc = llvmPackages_6.libcxxClang; } else
    if toolchain == "llvm-7"  then { stdenv = llvmPackages_7.libcxxStdenv; cc = llvmPackages_7.libcxxClang; } else
    if toolchain == "llvm-8"  then { stdenv = llvmPackages_8.libcxxStdenv; cc = llvmPackages_8.libcxxClang; } else
    if toolchain == "llvm-9"  then { stdenv = llvmPackages_9.stdenv; cc = llvmPackages_9.clang; } else
    abort "unknown toolchain";

in
tc.stdenv.mkDerivation rec {
  name = "immer-env";
  buildInputs = [
    tc.cc
    git
    cmake
    pkgconfig
    ninja
    gdb
    lldb
    ccache
    boost
    boehmgc
    benchmarks.c_rrb
    benchmarks.steady
    benchmarks.chunkedseq
    benchmarks.immutable_cpp
    benchmarks.hash_trie
    oldNixpkgs.doxygen
    (oldNixpkgs.python.withPackages (ps: [
      ps.sphinx
      docs.breathe
      docs.recommonmark
    ]))
  ];
  hardeningDisable = [ "fortify" ];
}