ports: extract port version from the Genode sources
This commit is contained in:
parent
f939ff7d39
commit
eb6b48e47d
|
@ -40,7 +40,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";
|
||||
};
|
||||
|
||||
|
@ -53,12 +62,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 = "";
|
||||
|
@ -83,7 +93,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
|
||||
'';
|
||||
|
||||
|
@ -96,6 +106,7 @@ let
|
|||
find $CONTRIB_DIR/* -name .svn -exec rm -rf {} \; || true
|
||||
find $CONTRIB_DIR/* -name '*.t?z' -exec rm -rf {} \; || true
|
||||
find $CONTRIB_DIR/* -name '*.tar.*' -exec rm -rf {} \; || true
|
||||
find $CONTRIB_DIR/* -name '*.zip' -exec rm -rf {} \; || true
|
||||
|
||||
mkdir $out
|
||||
cp -a $CONTRIB_DIR/* $out/
|
||||
|
|
Loading…
Reference in New Issue