Expose prev-overlay nixpkgs to genodePackages

This commit is contained in:
Emery Hemingway 2022-05-05 23:59:32 -05:00
parent 532d6eec0f
commit ae591f0faf
4 changed files with 22 additions and 25 deletions

View File

@ -100,10 +100,7 @@ in nullPkgs // {
genodePackages = genodePackages =
# The Genode-only packages. # The Genode-only packages.
import ../packages { import ../packages { inherit final prev; };
inherit flake;
pkgs = final;
};
grub2 = grub2 =
# No need for a Genode build of GRUB. # No need for a Genode build of GRUB.

View File

@ -1,16 +1,17 @@
{ flake, pkgs }: { final, prev }:
let let
upstream = import ./genodelabs { inherit flake pkgs; }; upstream = import ./genodelabs { inherit final prev; };
inherit (upstream) genodeSources; inherit (upstream) genodeSources;
inherit (pkgs) buildPackages callPackage fetchFromGitHub; inherit (final) callPackage;
inherit (prev) buildPackages;
dhallPackages = dhallPackages =
flake.inputs.nixpkgs.legacyPackages.x86_64-linux.callPackage ./dhall { }; buildPackages.callPackage ./dhall { };
buildDepotWorld = let buildDepotWorld = let
genodeWorld = fetchFromGitHub { genodeWorld = prev.fetchFromGitHub {
owner = "genodelabs"; owner = "genodelabs";
repo = "genode-world"; repo = "genode-world";
rev = "0ed545e55a90c39df23a86eb733961de71d56241"; rev = "0ed545e55a90c39df23a86eb733961de71d56241";
@ -51,7 +52,7 @@ in upstream // {
portInputs = with genodeSources.ports; [ libc libssh openssl zlib ]; portInputs = with genodeSources.ports; [ libc libssh openssl zlib ];
}; };
worldSources = buildPackages.fetchFromGitHub { worldSources = prev.fetchFromGitHub {
owner = "genodelabs"; owner = "genodelabs";
repo = "genode-world"; repo = "genode-world";
rev = "521f9fb5a66b18441f53a96e3993a84b772f27e5"; rev = "521f9fb5a66b18441f53a96e3993a84b772f27e5";

View File

@ -1,9 +1,10 @@
{ flake, pkgs }: { final, prev }:
let let
inherit (pkgs) lib buildPackages; inherit (final) lib;
inherit (prev.buildPackages) buildPackages;
platform = pkgs.targetPlatform; platform = final.targetPlatform;
arch = with platform; arch = with platform;
if isx86_64 then if isx86_64 then
@ -16,7 +17,7 @@ let
upstreamSources = upstreamSources =
# This is where the Genode source tree is defined. # This is where the Genode source tree is defined.
# Must be updated with ./patches/sources.patch. # Must be updated with ./patches/sources.patch.
pkgs.fetchFromGitHub { buildPackages.fetchFromGitHub {
owner = "genodelabs"; owner = "genodelabs";
repo = "genode"; repo = "genode";
rev = "sculpt-21.03"; rev = "sculpt-21.03";
@ -137,9 +138,8 @@ let
# The "ports" mechanism is hardly deterministic, so prepare with # The "ports" mechanism is hardly deterministic, so prepare with
# a pinned nixpkgs revision for a pinned platform for consistency. # a pinned nixpkgs revision for a pinned platform for consistency.
lib.mapAttrs preparePort (import ./ports.nix { lib.mapAttrs preparePort (import ./ports.nix {
pkgs = flake.inputs.nixpkgs.legacyPackages.x86_64-linux // { pkgs = buildPackages;
inherit (pkgs) genodePackages; inherit (final.genodePackages) worldSources;
};
}); });
toolchain = toolchain =
@ -149,7 +149,7 @@ let
stdenv' = stdenv' =
# Special stdenv for use within the upstream sources. # Special stdenv for use within the upstream sources.
# TODO: build with Clang. # TODO: build with Clang.
pkgs.stdenvAdapters.overrideCC pkgs.stdenv toolchain; final.stdenvAdapters.overrideCC final.stdenv toolchain;
buildUpstream = buildUpstream =
# Build from the Genode sources using the least recursive make. # Build from the Genode sources using the least recursive make.
@ -297,8 +297,8 @@ let
# Build everything in ./make-targets.nix. # Build everything in ./make-targets.nix.
let let
overrides = import ./make-targets.nix { overrides = import ./make-targets.nix {
inherit (pkgs) buildPackages genodePackages; inherit (final) genodePackages;
inherit ports; inherit buildPackages ports;
}; };
in lib.attrsets.mapAttrs in lib.attrsets.mapAttrs
(name: value: (buildUpstream ({ inherit name; } // value))) overrides; (name: value: (buildUpstream ({ inherit name; } // value))) overrides;
@ -307,9 +307,8 @@ let
# Build everything in ./depot-targets.nix. # Build everything in ./depot-targets.nix.
(name: value: (buildDepot ({ inherit name; } // value))) (name: value: (buildDepot ({ inherit name; } // value)))
(import ./depot-targets.nix { (import ./depot-targets.nix {
inherit (pkgs) genodePackages; inherit (final) genodePackages;
inherit ports; inherit buildPackages ports;
buildPackages = buildPackages.buildPackages;
}); });
specs = with platform; specs = with platform;

View File

@ -1,7 +1,7 @@
# This file specifies the output hashes of "Ports". # This file specifies the output hashes of "Ports".
# Ports not listed here can still be prepared, but will result in a hash mismatch. # Ports not listed here can still be prepared, but will result in a hash mismatch.
{ pkgs }: { pkgs, worldSources }:
with pkgs; with pkgs;
{ {
@ -66,7 +66,7 @@ with pkgs;
}; };
x86emu.hash = "sha256-QY6OL+cDVjQ67JItP1rS4ufPRGZf43AZtWxwza/0q0w="; x86emu.hash = "sha256-QY6OL+cDVjQ67JItP1rS4ufPRGZf43AZtWxwza/0q0w=";
xkcp = { xkcp = {
extraRepos = [ genodePackages.worldSources ]; extraRepos = [ worldSources ];
hash = "sha256-oB7oFikCFnEtB/ZlV7Gayw3wNa0BU/vi7O5gfzeFGLg="; hash = "sha256-oB7oFikCFnEtB/ZlV7Gayw3wNa0BU/vi7O5gfzeFGLg=";
nativeBuildInputs = [ libxslt ]; nativeBuildInputs = [ libxslt ];
version = "cafc03"; version = "cafc03";