From eb6b48e47d49140ea124e2bd68bbaeb00daa273b Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Sat, 23 May 2020 13:26:20 +0530 Subject: [PATCH] ports: extract port version from the Genode sources --- packages/genodelabs/default.nix | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/packages/genodelabs/default.nix b/packages/genodelabs/default.nix index 459d73b..b21a1d5 100644 --- a/packages/genodelabs/default.nix +++ b/packages/genodelabs/default.nix @@ -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/