diff --git a/packages/default.nix b/packages/default.nix index 6eb9625..14d9e09 100644 --- a/packages/default.nix +++ b/packages/default.nix @@ -51,4 +51,11 @@ in upstream // { stdcxx = callPackage ./stdcxx { }; + worldSources = buildPackages.fetchFromGitHub { + owner = "genodelabs"; + repo = "genode-world"; + rev = "521f9fb5a66b18441f53a96e3993a84b772f27e5"; + sha256 = "0dy906ffbw6khkwd05vhppcw2mr4ma0h3b6n52a71cfail87jfnw"; + }; + } diff --git a/packages/genodelabs/default.nix b/packages/genodelabs/default.nix index 91d9e3e..8b44ad2 100644 --- a/packages/genodelabs/default.nix +++ b/packages/genodelabs/default.nix @@ -57,14 +57,14 @@ let # Prepare a "port" of source code declared in the Genode sources name: { hash ? "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" - , patches ? [ ], ... }@args: + , patches ? [ ], extraRepos ? [ ], ... }@args: let - havePatches = patches != [ ]; - version = portVersions.${name}; + dontUnpack = patches == [ ] && extraRepos == [ ]; + version = portVersions.${name} or args.version; in with buildPackages.buildPackages; stdenvNoCC.mkDerivation (args // { name = name + "-port-" + version; - inherit version patches; + inherit version patches dontUnpack extraRepos; preferLocalBuild = true; outputHashMode = "recursive"; outputHash = hash; @@ -76,8 +76,7 @@ let impureEnvVars = lib.fetchers.proxyImpureEnvVars ++ [ "GIT_PROXY_COMMAND" "SOCKS_SERVER" ]; - src = if havePatches then genodeSources else null; - dontUnpack = !havePatches; + src = if dontUnpack then null else genodeSources; dontConfigure = true; @@ -90,7 +89,10 @@ let '' runHook preBuild export CONTRIB_DIR=$NIX_BUILD_TOP/contrib - export GENODE_DIR=${if havePatches then "$(pwd)" else genodeSources} + export GENODE_DIR=${if dontUnpack then genodeSources else "$(pwd)"} + for repo in $extraRepos; do + ln -s $repo $GENODE_DIR/repos/ + done mkdir $CONTRIB_DIR $GENODE_DIR/tool/ports/prepare_port ${name} CHECK_HASH=no runHook postBuild @@ -116,7 +118,9 @@ let }); ports = lib.mapAttrs preparePort (import ./ports.nix { - pkgs = flake.inputs.nixpkgs.legacyPackages.x86_64-linux; + pkgs = flake.inputs.nixpkgs.legacyPackages.x86_64-linux // { + inherit (pkgs) genodePackages; + }; }); # The "ports" mechanism is hardly deterministic, so prepare with # a pinned nixpkgs revision for a pinned platform.