packages/genodelabs: support for building ports from world repo
This commit is contained in:
parent
526e7bafc1
commit
bce63a3c17
|
@ -51,4 +51,11 @@ in upstream // {
|
||||||
|
|
||||||
stdcxx = callPackage ./stdcxx { };
|
stdcxx = callPackage ./stdcxx { };
|
||||||
|
|
||||||
|
worldSources = buildPackages.fetchFromGitHub {
|
||||||
|
owner = "genodelabs";
|
||||||
|
repo = "genode-world";
|
||||||
|
rev = "521f9fb5a66b18441f53a96e3993a84b772f27e5";
|
||||||
|
sha256 = "0dy906ffbw6khkwd05vhppcw2mr4ma0h3b6n52a71cfail87jfnw";
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,14 +57,14 @@ let
|
||||||
# Prepare a "port" of source code declared in the Genode sources
|
# Prepare a "port" of source code declared in the Genode sources
|
||||||
name:
|
name:
|
||||||
{ hash ? "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="
|
{ hash ? "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="
|
||||||
, patches ? [ ], ... }@args:
|
, patches ? [ ], extraRepos ? [ ], ... }@args:
|
||||||
let
|
let
|
||||||
havePatches = patches != [ ];
|
dontUnpack = patches == [ ] and extraRepos == [ ];
|
||||||
version = portVersions.${name};
|
version = portVersions.${name} or args.version;
|
||||||
in with buildPackages.buildPackages;
|
in with buildPackages.buildPackages;
|
||||||
stdenvNoCC.mkDerivation (args // {
|
stdenvNoCC.mkDerivation (args // {
|
||||||
name = name + "-port-" + version;
|
name = name + "-port-" + version;
|
||||||
inherit version patches;
|
inherit version patches dontUnpack extraRepos;
|
||||||
preferLocalBuild = true;
|
preferLocalBuild = true;
|
||||||
outputHashMode = "recursive";
|
outputHashMode = "recursive";
|
||||||
outputHash = hash;
|
outputHash = hash;
|
||||||
|
@ -76,8 +76,7 @@ let
|
||||||
impureEnvVars = lib.fetchers.proxyImpureEnvVars
|
impureEnvVars = lib.fetchers.proxyImpureEnvVars
|
||||||
++ [ "GIT_PROXY_COMMAND" "SOCKS_SERVER" ];
|
++ [ "GIT_PROXY_COMMAND" "SOCKS_SERVER" ];
|
||||||
|
|
||||||
src = if havePatches then genodeSources else null;
|
src = if dontUnpack then null else genodeSources;
|
||||||
dontUnpack = !havePatches;
|
|
||||||
|
|
||||||
dontConfigure = true;
|
dontConfigure = true;
|
||||||
|
|
||||||
|
@ -93,6 +92,9 @@ let
|
||||||
export GENODE_DIR=${if havePatches then "$(pwd)" else genodeSources}
|
export GENODE_DIR=${if havePatches then "$(pwd)" else genodeSources}
|
||||||
mkdir $CONTRIB_DIR
|
mkdir $CONTRIB_DIR
|
||||||
$GENODE_DIR/tool/ports/prepare_port ${name} CHECK_HASH=no
|
$GENODE_DIR/tool/ports/prepare_port ${name} CHECK_HASH=no
|
||||||
|
for repo in $extraRepos; do
|
||||||
|
ln -s ${repo} $GENODE_DIR/repos/
|
||||||
|
done
|
||||||
runHook postBuild
|
runHook postBuild
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
@ -116,7 +118,9 @@ let
|
||||||
});
|
});
|
||||||
|
|
||||||
ports = lib.mapAttrs preparePort (import ./ports.nix {
|
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
|
# The "ports" mechanism is hardly deterministic, so prepare with
|
||||||
# a pinned nixpkgs revision for a pinned platform.
|
# a pinned nixpkgs revision for a pinned platform.
|
||||||
|
|
Loading…
Reference in New Issue