summary refs log tree commit diff
path: root/pkgs/stdenv/freebsd/default.nix
blob: dbb4a0564558a4e8ef78d488e772910fb67c986c (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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
{ lib
, localSystem, crossSystem, config, overlays
}:

assert crossSystem == localSystem;
let inherit (localSystem) system; in


[

  ({}: {
    __raw = true;

    bootstrapTools = derivation {
      inherit system;

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

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

  ({ bootstrapTools, ... }: rec {
    __raw = true;

    inherit bootstrapTools;

    fetchurl = import ../../build-support/fetchurl {
      inherit lib;
      stdenvNoCC = stdenv;
      curl = bootstrapTools;
    };

    stdenv = import ../generic {
      name = "stdenv-freebsd-boot-1";
      buildPlatform = localSystem;
      hostPlatform = localSystem;
      targetPlatform = localSystem;
      inherit config;
      initialPath = [ "/" "/usr" ];
      shell = "${bootstrapTools}/bin/bash";
      fetchurlBoot = null;
      cc = null;
      overrides = self: super: {
      };
    };
  })

  (prevStage: {
    __raw = true;

    stdenv = import ../generic {
      name = "stdenv-freebsd-boot-0";
      inherit config;
      initialPath = [ prevStage.bootstrapTools ];
      inherit (prevStage.stdenv)
        buildPlatform hostPlatform targetPlatform
        shell;
      fetchurlBoot = prevStage.fetchurl;
      cc = null;
    };
  })

  (prevStage: {
    inherit config overlays;
    stdenv = import ../generic {
      name = "stdenv-freebsd-boot-3";
      inherit config;

      inherit (prevStage.stdenv)
        buildPlatform hostPlatform targetPlatform
        initialPath shell fetchurlBoot;

      cc = import ../../build-support/cc-wrapper {
        nativeTools  = true;
        nativePrefix = "/usr";
        nativeLibc   = true;
        stdenvNoCC = prevStage.stdenv;
        cc           = {
          name    = "clang-9.9.9";
          cc      = "/usr";
          outPath = "/usr";
        };
        isClang      = true;
      };

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

]