Unverified Commit 2f20501c authored by John Ericson's avatar John Ericson Committed by GitHub
Browse files

Merge pull request #320852 from obsidiansystems/fewer-cross-suffix-attrs

Clean up cross bootstrapping
parents fd469c24 51f1ecaa
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -10,15 +10,15 @@
, stdenvNoCC
, runtimeShell
, bintools ? null, libc ? null, coreutils ? null, gnugrep ? null
, netbsd ? null, netbsdCross ? null
, netbsd ? null
, sharedLibraryLoader ?
  if libc == null then
    null
  else if stdenvNoCC.targetPlatform.isNetBSD then
    if !(targetPackages ? netbsdCross) then
    if !(targetPackages ? netbsd) then
      netbsd.ld_elf_so
    else if libc != targetPackages.netbsdCross.headers then
      targetPackages.netbsdCross.ld_elf_so
    else if libc != targetPackages.netbsd.headers then
      targetPackages.netbsd.ld_elf_so
    else
      null
  else
+2 −1
Original line number Diff line number Diff line
{ lib
, stdenv
, stdenvNoLibc
, buildPackages
, fetchurl
, gitUpdater
@@ -9,6 +9,7 @@
}:

let
  stdenv = stdenvNoLibc;
  isCross = (stdenv.buildPlatform != stdenv.hostPlatform);
  configParser = ''
    function parseconfig {
+2 −2
Original line number Diff line number Diff line
{ stdenv, texinfo, flex, bison, fetchFromGitHub, crossLibcStdenv, buildPackages }:
{ stdenv, texinfo, flex, bison, fetchFromGitHub, stdenvNoLibc, buildPackages }:

crossLibcStdenv.mkDerivation {
stdenvNoLibc.mkDerivation {
  name = "newlib";
  src = fetchFromGitHub {
    owner = "openrisc";
+2 −2
Original line number Diff line number Diff line
{ stdenv, texinfo, flex, bison, fetchFromGitHub, crossLibcStdenv, buildPackages }:
{ stdenv, texinfo, flex, bison, fetchFromGitHub, stdenvNoLibc, buildPackages }:

crossLibcStdenv.mkDerivation {
stdenvNoLibc.mkDerivation {
  name = "newlib";
  src = fetchFromGitHub {
    owner = "itszor";
+25 −37
Original line number Diff line number Diff line
@@ -3,7 +3,6 @@
  makeScopeWithSplicing',
  generateSplicesForMkScope,
  callPackage,
  crossLibcStdenv,
  attributePathToSplice ? [ "freebsd" ],
  branch ? "release/14.0.0",
}:
@@ -24,6 +23,11 @@ let
      Branches can be selected by overriding the `branch` attribute on the freebsd package set.
    '';

  # we do not include the branch in the splice here because the branch
  # parameter to this file will only ever take on one value - more values
  # are provided through overrides.
  otherSplices = generateSplicesForMkScope attributePathToSplice;
in
# `./package-set.nix` should never know the name of the package set we
# are constructing; just this function is allowed to know that. This
# is why we:
@@ -32,14 +36,6 @@ let
#
#  - construct the *anonymized* `buildFreebsd` attribute to be passed
#    to `./package-set.nix`.
  callFreeBSDWithAttrs =
    extraArgs:
    let
      # we do not include the branch in the splice here because the branch
      # parameter to this file will only ever take on one value - more values
      # are provided through overrides.
      otherSplices = generateSplicesForMkScope attributePathToSplice;
    in
makeScopeWithSplicing' {
  inherit otherSplices;
  f =
@@ -47,18 +43,10 @@ let
    {
      inherit branch;
    }
        // callPackage ./package-set.nix (
          {
    // callPackage ./package-set.nix ({
      sourceData = versions.${self.branch} or (throw (badBranchError self.branch));
      versionData = self.sourceData.version;
      buildFreebsd = otherSplices.selfBuildHost;
      patchesRoot = ./patches + "/${self.versionData.revision}";
          }
          // extraArgs
        ) self;
    };
in
{
  freebsd = callFreeBSDWithAttrs { };
  freebsdCross = callFreeBSDWithAttrs { stdenv = crossLibcStdenv; };
    }) self;
}
Loading