From 7e176490863adb2a553010733aab2ce5211514fb Mon Sep 17 00:00:00 2001 From: Diogo Costa Date: Tue, 26 Sep 2023 15:34:48 +0100 Subject: [PATCH] feat(nix): abstract platform-specific configurations of baremetal-tf.nix Signed-off-by: Diogo Costa --- pkgs/guest/baremetal-tf.nix | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pkgs/guest/baremetal-tf.nix b/pkgs/guest/baremetal-tf.nix index 4b86e7e..cd48ae3 100644 --- a/pkgs/guest/baremetal-tf.nix +++ b/pkgs/guest/baremetal-tf.nix @@ -7,7 +7,7 @@ , python3 , python3Packages , rsync -, platform +, platform_cfg , list_tests , list_suites , bao-tests @@ -20,6 +20,10 @@ stdenv.mkDerivation rec { pname = "baremetal-tf"; version = "1.0.0"; + platform = platform_cfg.platform_name; + plat_arch = platform_cfg.platforms-arch.${platform}; + plat_toolchain = platform_cfg.platforms-toolchain.${platform}; + src = ../../../../.; nativeBuildInputs = [ toolchain]; #build time dependencies @@ -38,8 +42,8 @@ stdenv.mkDerivation rec { echo "Platform: ${platform}" echo "Suites: ${list_suites}" echo "Testes: ${list_tests}" - export ARCH=aarch64 - export CROSS_COMPILE=aarch64-none-elf- + export ARCH=${plat_arch} + export CROSS_COMPILE=${plat_toolchain} export TESTF_TESTS_DIR=$out/tests export TESTF_REPO_DIR=$out/bao-tests chmod -R u+w bao-tests #make sure we can write to bao-tests