ports: extract port version from the Genode sources
This commit is contained in:
parent
3479c96be0
commit
81783665f2
|
@ -34,7 +34,16 @@ let
|
|||
substituteInPlace tool/check_abi \
|
||||
--replace "exec nm" "exec ${toolPrefix}nm"
|
||||
'';
|
||||
dontBuild = true;
|
||||
|
||||
buildPhase = ''
|
||||
echo { >> ports.nix
|
||||
find repos/*/ports -name '*.hash' | while read hashFile
|
||||
do
|
||||
echo " $(basename --suffix=.hash $hashFile) = \"$(cut -c -6 $hashFile)\";" >> ports.nix
|
||||
done
|
||||
echo } >> ports.nix
|
||||
'';
|
||||
|
||||
installPhase = "cp -a . $out";
|
||||
};
|
||||
|
||||
|
@ -55,12 +64,13 @@ let
|
|||
{ hash ? "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="
|
||||
, patches ? [ ], ... }@args:
|
||||
let havePatches = patches != [ ];
|
||||
version = builtins.getAttr name (import "${genodeSources}/ports.nix");
|
||||
in stdenvNoCC.mkDerivation (args // {
|
||||
name = name + "-port-" + version;
|
||||
inherit version patches;
|
||||
preferLocalBuild = true;
|
||||
outputHashMode = "recursive";
|
||||
outputHash = hash;
|
||||
pname = name;
|
||||
inherit (genodeSources) version;
|
||||
inherit patches;
|
||||
|
||||
GIT_SSL_CAINFO = "${cacert}/etc/ssl/certs/ca-bundle.crt";
|
||||
VERBOSE = "";
|
||||
|
@ -85,7 +95,7 @@ let
|
|||
export CONTRIB_DIR=$NIX_BUILD_TOP/contrib
|
||||
export GENODE_DIR=${if havePatches then "$(pwd)" else genodeSources}
|
||||
mkdir $CONTRIB_DIR
|
||||
$GENODE_DIR/tool/ports/prepare_port $pname CHECK_HASH=no
|
||||
$GENODE_DIR/tool/ports/prepare_port ${name} CHECK_HASH=no
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
|
|
Loading…
Reference in New Issue