about summary refs log tree commit diff
path: root/pkgs/os-specific/bsd/freebsd/default.nix
blob: b7cf5484c9e943ca338368b84d06680dd3c85a28 (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
{ stdenv, lib, stdenvNoCC
, makeScopeWithSplicing', generateSplicesForMkScope
, buildPackages
, fetchgit, fetchzip
}:

let
  inherit (buildPackages.buildPackages) rsync;

  versions = builtins.fromJSON (builtins.readFile ./versions.json);

  version = "13.1.0";
  branch = "release/${version}";

in makeScopeWithSplicing' {
  otherSplices = generateSplicesForMkScope "freebsd";
  f = (self: lib.packagesFromDirectoryRecursive {
    callPackage = self.callPackage;
    directory = ./pkgs;
  } // {
    sourceData = versions.${branch};

    ports = fetchzip {
      url = "https://cgit.freebsd.org/ports/snapshot/ports-dde3b2b456c3a4bdd217d0bf3684231cc3724a0a.tar.gz";
      sha256 = "BpHqJfnGOeTE7tkFJBx0Wk8ryalmf4KNTit/Coh026E=";
    };

    compatIfNeeded = lib.optional (!stdenvNoCC.hostPlatform.isFreeBSD) self.compat;
    freebsd-lib = import ./lib { inherit version; };

    # The manual callPackages below should in principle be unnecessary, but are
    # necessary. See note in ../netbsd/default.nix

    compat = self.callPackage ./pkgs/compat/package.nix {
      inherit stdenv;
      inherit (buildPackages.freebsd) makeMinimal boot-install;
    };

    csu = self.callPackage ./pkgs/csu.nix {
      inherit (buildPackages.freebsd) makeMinimal install gencat;
      inherit (self) include;
    };

    include = self.callPackage ./pkgs/include/package.nix {
      inherit (buildPackages.freebsd) makeMinimal install rpcgen;
    };

    install = self.callPackage ./pkgs/install.nix {
      inherit (buildPackages.freebsd) makeMinimal;
      inherit (self) mtree libnetbsd;
    };

    libc = self.callPackage ./pkgs/libc/package.nix {
      inherit (buildPackages.freebsd) makeMinimal install gencat rpcgen;
      inherit (self) csu include;
    };

    libnetbsd = self.callPackage ./pkgs/libnetbsd/package.nix {
      inherit (buildPackages.freebsd) makeMinimal;
    };

    mkDerivation = self.callPackage ./pkgs/mkDerivation.nix {
      inherit stdenv;
      inherit (buildPackages.freebsd) makeMinimal install tsort;
    };

    makeMinimal = self.callPackage ./pkgs/makeMinimal.nix {
      inherit (self) make;
    };

  });
}