summary refs log tree commit diff
path: root/pkgs/stdenv/freebsd/default.nix
blob: 13cb21fe1d887e688d603ed9c00e70f4a296a62e (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
{ system      ? builtins.currentSystem
, allPackages ? import ../../..
, platform    ? null
, config      ? {}
}:

rec {
  inherit allPackages;

  bootstrapTools = derivation {
    inherit system;

    name    = "trivial-bootstrap-tools";
    builder = "/usr/local/bin/bash";
    args    = [ ./trivial-bootstrap.sh ];

    mkdir   = "/bin/mkdir";
    ln      = "/bin/ln";
  };

  fetchurl = import ../../build-support/fetchurl {
    stdenv = import ../generic {
      name = "stdenv-freebsd-boot-1";
      inherit system config;

      initialPath  = [ "/" "/usr" ];
      shell        = "${bootstrapTools}/bin/bash";
      fetchurlBoot = null;
      cc = null;
    };
    curl = bootstrapTools;
  };

  stdenvFreeBSD = import ../generic {
    name = "stdenv-freebsd-boot-3";

    inherit system config;

    initialPath  = [ bootstrapTools ];
    shell        = "${bootstrapTools}/bin/bash";
    fetchurlBoot = fetchurl;

    cc = import ../../build-support/cc-wrapper {
      nativeTools  = true;
      nativePrefix = "/usr";
      nativeLibc   = true;
      stdenv = import ../generic {
        inherit system config;
        name         = "stdenv-freebsd-boot-0";
        initialPath  = [ bootstrapTools ];
        shell = stdenvFreeBSD.shell;
        fetchurlBoot = fetchurl;
        cc           = null;
      };
      cc           = {
        name    = "clang-9.9.9";
        cc      = "/usr";
        outPath = "/usr";
      };
      isClang      = true;
    };

    preHook = ''export NIX_NO_SELF_RPATH=1'';
  };
}