at master 181 lines 4.6 kB view raw
1{ 2 lib, 3 stdenvNoLibc, 4 stdenvNoCC, 5 makeScopeWithSplicing', 6 generateSplicesForMkScope, 7 buildPackages, 8}: 9 10let 11 otherSplices = generateSplicesForMkScope "netbsd"; 12 buildNetbsd = otherSplices.selfBuildHost; 13in 14 15makeScopeWithSplicing' { 16 inherit otherSplices; 17 f = ( 18 self: 19 lib.packagesFromDirectoryRecursive { 20 callPackage = self.callPackage; 21 directory = ./pkgs; 22 } 23 // { 24 version = "9.2"; 25 26 defaultMakeFlags = [ 27 "MKSOFTFLOAT=${ 28 if 29 stdenvNoCC.hostPlatform.gcc.float or (stdenvNoCC.hostPlatform.parsed.abi.float or "hard") == "soft" 30 then 31 "yes" 32 else 33 "no" 34 }" 35 ]; 36 37 compatIfNeeded = lib.optional (!stdenvNoCC.hostPlatform.isNetBSD) self.compat; 38 39 stdenvLibcMinimal = stdenvNoLibc.override (old: { 40 cc = old.cc.override { 41 libc = self.libcMinimal; 42 noLibc = false; 43 bintools = old.cc.bintools.override { 44 libc = self.libcMinimal; 45 noLibc = false; 46 sharedLibraryLoader = null; 47 }; 48 }; 49 }); 50 51 # The manual callPackages below should in principle be unnecessary because 52 # they're just selecting arguments that would be selected anyway. However, 53 # if we don't perform these manual calls, we get infinite recursion issues 54 # because of the splices. 55 56 compat = self.callPackage ./pkgs/compat/package.nix { 57 inherit (buildPackages) coreutils; 58 inherit (buildNetbsd) makeMinimal; 59 inherit (self) install; 60 }; 61 62 config = self.callPackage ./pkgs/config.nix { 63 inherit (buildNetbsd) makeMinimal install; 64 inherit (self) cksum; 65 }; 66 67 csu = self.callPackage ./pkgs/csu.nix { 68 inherit (self) headers sys-headers ld_elf_so; 69 inherit (buildNetbsd) 70 netbsdSetupHook 71 makeMinimal 72 install 73 genassym 74 gencat 75 lorder 76 tsort 77 statHook 78 ; 79 }; 80 81 include = self.callPackage ./pkgs/include.nix { 82 inherit (buildNetbsd) 83 makeMinimal 84 install 85 nbperf 86 rpcgen 87 ; 88 inherit (buildPackages) stdenv; 89 }; 90 91 install = self.callPackage ./pkgs/install/package.nix { 92 inherit (self) 93 fts 94 mtree 95 make 96 compatIfNeeded 97 ; 98 inherit (buildNetbsd) makeMinimal; 99 }; 100 101 libcMinimal = self.callPackage ./pkgs/libcMinimal/package.nix { 102 inherit (self) headers csu; 103 inherit (buildNetbsd) 104 netbsdSetupHook 105 makeMinimal 106 install 107 genassym 108 gencat 109 lorder 110 tsort 111 statHook 112 rpcgen 113 ; 114 }; 115 116 libpthread-headers = self.callPackage ./pkgs/libpthread/headers.nix { }; 117 118 librpcsvc = self.callPackage ./pkgs/librpcsvc.nix { 119 inherit (buildNetbsd) 120 netbsdSetupHook 121 makeMinimal 122 install 123 lorder 124 tsort 125 statHook 126 rpcgen 127 ; 128 }; 129 130 libutil = self.callPackage ./pkgs/libutil.nix { 131 inherit (buildNetbsd) 132 netbsdSetupHook 133 makeMinimal 134 install 135 lorder 136 tsort 137 statHook 138 ; 139 }; 140 141 lorder = self.callPackage ./pkgs/lorder.nix { inherit (buildNetbsd) makeMinimal install; }; 142 143 mtree = self.callPackage ./pkgs/mtree.nix { inherit (self) mknod; }; 144 145 mkDerivation = self.callPackage ./pkgs/mkDerivation.nix { 146 inherit (buildNetbsd) 147 netbsdSetupHook 148 makeMinimal 149 install 150 tsort 151 lorder 152 ; 153 inherit (buildPackages) mandoc; 154 inherit (buildPackages.buildPackages) rsync; 155 }; 156 157 makeMinimal = self.callPackage ./pkgs/makeMinimal.nix { inherit (self) make; }; 158 159 # See note in pkgs/stat/package.nix 160 stat = self.callPackage ./pkgs/stat/package.nix { inherit (buildNetbsd) makeMinimal install; }; 161 162 # See note in pkgs/stat/hook.nix 163 statHook = self.callPackage ./pkgs/stat/hook.nix { inherit (self) stat; }; 164 165 sys-headers = self.callPackage ./pkgs/sys/headers.nix { 166 inherit (buildNetbsd) 167 makeMinimal 168 install 169 tsort 170 lorder 171 statHook 172 uudecode 173 config 174 genassym 175 ; 176 }; 177 178 tsort = self.callPackage ./pkgs/tsort.nix { inherit (buildNetbsd) makeMinimal install; }; 179 } 180 ); 181}