From b75f83bfae27223aa04d6407262162719febf3c3 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Tue, 9 Sep 2025 16:48:55 +0900 Subject: [PATCH] gnu: iverilog: Set correct native compilers in installed script. * gnu/packages/fpga.scm (iverilog) [#:make-flags]: Delete. [#:phases]: Add ensure-native-baked-CC/CXX phase. Change-Id: I218f062de3a51765cbb9adf4558ea16e152e1f97 --- gnu/packages/fpga.scm | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/gnu/packages/fpga.scm b/gnu/packages/fpga.scm index 028a6151dfa73fcd66fd4993303855b97f8076b4..1034553fcf008d9b8a158ac1755ee1706623a76b 100644 --- a/gnu/packages/fpga.scm +++ b/gnu/packages/fpga.scm @@ -175,17 +175,28 @@ generating bitstreams with Gowin FPGAs.") (origin (method git-fetch) (uri (git-reference - (url "https://github.com/steveicarus/iverilog") - (commit - (string-append "v" (string-replace-substring version "." "_"))))) + (url "https://github.com/steveicarus/iverilog") + (commit + (string-append "v" (string-replace-substring version "." "_"))))) (file-name (git-file-name name version)) (sha256 (base32 "1cm3ksxyyp8ihs0as5c2nk3a0y2db8dmrrw0f9an3sl255smxn17")))) (build-system gnu-build-system) (arguments (list - #:make-flags #~(list (string-append "PREFIX=" #$output)) - #:bootstrap-scripts #~(list "autoconf.sh"))) + #:bootstrap-scripts #~(list "autoconf.sh") + #:phases #~(modify-phases %standard-phases + (add-after 'unpack 'ensure-native-baked-CC/CXX + (lambda _ + ;; The compilers used to build are retained in + ;; bin/iverilog-vpi, which is a Makefile + ;; script. Normalize these to just 'gcc' and 'g++' to + ;; avoid having these set to cross compilers. + (substitute* "Makefile.in" + (("s;@IVCC@;\\$\\(CC);") + "s;@IVCC@;gcc;") + (("s;@IVCXX@;\\$\\(CXX);") + "s;@IVCXX@;g++;"))))))) (native-inputs (list autoconf bison flex gperf)) (inputs (list zlib)) (home-page "https://steveicarus.github.io/iverilog/")