From 4f6f668b741433e8677c67e82e9aa9296a5b4452 Mon Sep 17 00:00:00 2001 From: Las Safin Date: Sun, 5 Sep 2021 16:06:44 +0000 Subject: [PATCH] Try to get libresoc working --- flake.nix | 3 ++- nix/libresoc.nix | 41 ++++++++++++++++++++++++++++++++++++----- 2 files changed, 38 insertions(+), 6 deletions(-) diff --git a/flake.nix b/flake.nix index 14974a0a..b995c2e4 100644 --- a/flake.nix +++ b/flake.nix @@ -104,7 +104,7 @@ ) {}; libresoc = nixpkgsFor.${system}.callPackage ( - import ./nix/libresoc.nix { inherit soclayout pinmux; } + import ./nix/libresoc.nix { inherit alliance-check-toolkit soclayout pinmux; } ) {}; unittests = override (nixpkgsFor.${system}.callPackage ( @@ -130,5 +130,6 @@ hydraJobs.combined = forAllSystems (system: self.packages.${system}.combined); hydraJobs.alliance-check-toolkit = forAllSystems (system: self.checks.${system}.alliance-check-toolkit); hydraJobs.unittests = forAllSystems (system: self.checks.${system}.unittests); + hydraJobs.libresoc = forAllSystems (system: self.checks.${system}.libresoc); }; } diff --git a/nix/libresoc.nix b/nix/libresoc.nix index c4acca12..2d507cc4 100644 --- a/nix/libresoc.nix +++ b/nix/libresoc.nix @@ -1,14 +1,45 @@ -{ soclayout, pinmux, ... }: +{ alliance-check-toolkit, soclayout, pinmux, ... }: -{ stdenv }: -stdenv.mkDerivation { +{ stdenv, coriolis-combined, coriolis-unicorn, coriolis-cumulus +, python2Packages, alliance, yosys, writeShellScriptBin }: + +let + fakegit = writeShellScriptBin "git" "exit 0"; +in stdenv.mkDerivation rec { name = "libresoc-check"; src = soclayout; + YOSYS_TOP = "${yosys}"; + ALLIANCE_TOP = "${alliance}"; + ALLIANCE_TOOLKIT = "${alliance-check-toolkit}"; + CHECK_TOOLKIT = ALLIANCE_TOOLKIT; + CORIOLIS_TOP = "${coriolis-combined}"; + # The user configuration for verhaegs is empty, + # which is why we use it. + USER = "verhaegs"; + + nativeBuildInputs = [ fakegit alliance coriolis-unicorn coriolis-cumulus yosys ]; + prePatch = '' - rm pinmux + rmdir pinmux ln -s ${pinmux} pinmux ''; + postPatch = "patchShebangs ."; - meta.isBroken = true; + buildPhase = '' + runHook preBuild + cd experiments9 + ./mksym.sh + ln -s ${alliance-check-toolkit}/etc/mk/users.d/user-${USER}.mk mk/users.d/user-${USER}.mk + ./build_full_4ksram.sh + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + mv -T "$PWD" "$out" + runHook postInstall + ''; + + fixupPhase = "true"; }