From 3431dc91df992f5b84cc4cfdf0dc5702a2c3107c Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Sat, 26 Jul 2025 13:45:58 +0200 Subject: [PATCH] yosys: fetch patch to fix amaranth code compilation Addresses https://github.com/NixOS/nixpkgs/pull/397611#issuecomment-3121635236 --- pkgs/by-name/yo/yosys/package.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/by-name/yo/yosys/package.nix b/pkgs/by-name/yo/yosys/package.nix index 66107035aec5..de1b7f3f5227 100644 --- a/pkgs/by-name/yo/yosys/package.nix +++ b/pkgs/by-name/yo/yosys/package.nix @@ -2,6 +2,7 @@ lib, stdenv, fetchFromGitHub, + fetchpatch2, # nativeBuildInputs bison, @@ -134,6 +135,14 @@ stdenv.mkDerivation (finalAttrs: { makeFlags = [ "PREFIX=${placeholder "out"}" ]; patches = [ + # Backport fix amaranth code compilation + # TODO remove when updating to 0.56 + # https://github.com/YosysHQ/yosys/pull/5182 + (fetchpatch2 { + name = "treat-zero-width-constant-as-zero.patch"; + url = "https://github.com/YosysHQ/yosys/commit/478b6a2b3fbab0fd4097b841914cbe8bb9f67268.patch"; + hash = "sha256-KeLoZfkXMk2KIPN9XBQdqWqohywQONlWUIvrGwgphKs="; + }) ./plugin-search-dirs.patch ./fix-clang-build.patch ];