diff options
author | Alyssa Ross <hi@alyssa.is> | 2022-03-30 13:30:47 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2022-03-31 10:13:20 +0000 |
commit | f2e61678de300336b3666afd19af7565efb0c4cf (patch) | |
tree | 49f6906c9d557f7fdd58257ff85ec17fc4495f31 /nixpkgs/pkgs/top-level/stage.nix | |
parent | f920d5e07c29a9aa1b77d9b88bd604cf1a1f3664 (diff) | |
parent | 00e27c78d3d2de6964096ceee8d70e5b487365e3 (diff) | |
download | nixlib-f2e61678de300336b3666afd19af7565efb0c4cf.tar nixlib-f2e61678de300336b3666afd19af7565efb0c4cf.tar.gz nixlib-f2e61678de300336b3666afd19af7565efb0c4cf.tar.bz2 nixlib-f2e61678de300336b3666afd19af7565efb0c4cf.tar.lz nixlib-f2e61678de300336b3666afd19af7565efb0c4cf.tar.xz nixlib-f2e61678de300336b3666afd19af7565efb0c4cf.tar.zst nixlib-f2e61678de300336b3666afd19af7565efb0c4cf.zip |
Merge commit '00e27c78d3d2de6964096ceee8d70e5b487365e3'
Conflicts: nixpkgs/nixos/modules/system/boot/systemd.nix nixpkgs/pkgs/applications/networking/browsers/firefox/common.nix nixpkgs/pkgs/applications/version-management/git-and-tools/cgit/common.nix nixpkgs/pkgs/applications/version-management/git-and-tools/cgit/default.nix nixpkgs/pkgs/applications/version-management/git-and-tools/cgit/pink.nix nixpkgs/pkgs/top-level/all-packages.nix
Diffstat (limited to 'nixpkgs/pkgs/top-level/stage.nix')
-rw-r--r-- | nixpkgs/pkgs/top-level/stage.nix | 44 |
1 files changed, 26 insertions, 18 deletions
diff --git a/nixpkgs/pkgs/top-level/stage.nix b/nixpkgs/pkgs/top-level/stage.nix index 9d34ddb3685f..1945762c50df 100644 --- a/nixpkgs/pkgs/top-level/stage.nix +++ b/nixpkgs/pkgs/top-level/stage.nix @@ -64,6 +64,30 @@ } @args: let + # This is a function from parsed platforms (like + # stdenv.hostPlatform.parsed) to parsed platforms. + makeMuslParsedPlatform = parsed: + # The following line guarantees that the output of this function + # is a well-formed platform with no missing fields. It will be + # uncommented in a separate PR, in case it breaks the build. + #(x: lib.trivial.pipe x [ (x: builtins.removeAttrs x [ "_type" ]) lib.systems.parse.mkSystem ]) + (parsed // { + abi = { + gnu = lib.systems.parse.abis.musl; + gnueabi = lib.systems.parse.abis.musleabi; + gnueabihf = lib.systems.parse.abis.musleabihf; + gnuabin32 = lib.systems.parse.abis.muslabin32; + gnuabi64 = lib.systems.parse.abis.muslabi64; + # The following two entries ensure that this function is idempotent. + musleabi = lib.systems.parse.abis.musleabi; + musleabihf = lib.systems.parse.abis.musleabihf; + muslabin32 = lib.systems.parse.abis.muslabin32; + muslabi64 = lib.systems.parse.abis.muslabi64; + }.${parsed.abi.name} + or lib.systems.parse.abis.musl; + }); + + stdenvAdapters = self: super: let res = import ../stdenv/adapters.nix { @@ -188,14 +212,7 @@ let })] ++ overlays; ${if stdenv.hostPlatform == stdenv.buildPlatform then "localSystem" else "crossSystem"} = { - parsed = stdenv.hostPlatform.parsed // { - abi = { - gnu = lib.systems.parse.abis.musl; - gnueabi = lib.systems.parse.abis.musleabi; - gnueabihf = lib.systems.parse.abis.musleabihf; - }.${stdenv.hostPlatform.parsed.abi.name} - or lib.systems.parse.abis.musl; - }; + parsed = makeMuslParsedPlatform stdenv.hostPlatform.parsed; }; } else throw "Musl libc only supports Linux systems."; @@ -239,16 +256,7 @@ let } // lib.optionalAttrs stdenv.hostPlatform.isLinux { crossSystem = { isStatic = true; - parsed = stdenv.hostPlatform.parsed // { - abi = { - gnu = lib.systems.parse.abis.musl; - gnueabi = lib.systems.parse.abis.musleabi; - gnueabihf = lib.systems.parse.abis.musleabihf; - musleabi = lib.systems.parse.abis.musleabi; - musleabihf = lib.systems.parse.abis.musleabihf; - }.${stdenv.hostPlatform.parsed.abi.name} - or lib.systems.parse.abis.musl; - }; + parsed = makeMuslParsedPlatform stdenv.hostPlatform.parsed; } // lib.optionalAttrs (stdenv.hostPlatform.system == "powerpc64-linux") { gcc.abi = "elfv2"; }; |