|
|
|
@ -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.
|
|
|
|
|