From 1f9f2518fc51246a1e91975f927b50d171b2c801 Mon Sep 17 00:00:00 2001 From: "Emil J. Tywoniak" Date: Sat, 11 May 2024 00:42:53 +0200 Subject: [PATCH] nix: fix abc --- flake.nix | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index d97be4ef671..26c21cc8996 100644 --- a/flake.nix +++ b/flake.nix @@ -12,19 +12,23 @@ pkgs = import nixpkgs { inherit system; }; + # TODO: don't override src when ./abc is empty + # which happens when the command used is `nix build` and not `nix build ?submodules=1` + abc-verifier = pkgs.abc-verifier.overrideAttrs(x: y: {src = ./abc;}); customYosys = pkgs.clangStdenv.mkDerivation { name = "yosys"; src = ./. ; buildInputs = with pkgs; [ clang bison flex libffi tcl readline python3 llvmPackages.libcxxClang zlib git pkg-configUpstream ]; checkInputs = with pkgs; [ gtest ]; - propagatedBuildInputs = with pkgs; [ abc-verifier ]; + propagatedBuildInputs = [ abc-verifier ]; preConfigure = "make config-clang"; checkTarget = "test"; installPhase = '' - make install PREFIX=$out + make install PREFIX=$out ABCEXTERNAL=yosys-abc + ln -s ${abc-verifier}/bin/abc $out/bin/yosys-abc ''; buildPhase = '' - make -j$(nproc) + make -j$(nproc) ABCEXTERNAL=yosys-abc ''; meta = with pkgs.lib; { description = "Yosys Open SYnthesis Suite";