guix_mirror_bot pushed a commit to branch master
in repository guix.

commit 8b6da7f8aa47e0d16f9ba87b02fd084176defa8d
Author: Cayetano Santos <[email protected]>
AuthorDate: Fri Nov 21 09:44:39 2025 +0100

    gnu: yosys: Default to clang backend.
    
    * gnu/packages/electronics.scm (yosys)[arguments]<#:make-flags>: Remove
    CC and CXX.
    <#:phases>: Use a user modifiable backend in ’configure.
    [inputs]: Add clang.
    * gnu/packages/electronics.scm (yosys-clang): Remove variable.
    
    Change-Id: I7467058b0c2b9e3180d94c2d1efddb3281f93c5c
---
 gnu/packages/electronics.scm | 42 ++++++++++++++----------------------------
 1 file changed, 14 insertions(+), 28 deletions(-)

diff --git a/gnu/packages/electronics.scm b/gnu/packages/electronics.scm
index 47aa1a2b13..b96937e71a 100644
--- a/gnu/packages/electronics.scm
+++ b/gnu/packages/electronics.scm
@@ -2968,13 +2968,7 @@ parallel computing platforms.  It also supports serial 
execution.")
     (arguments
      (list
       #:test-target "test"
-      #:make-flags
-      #~(list (string-append "CC="
-                             #$(cc-for-target))
-              (string-append "CXX="
-                             #$(cxx-for-target))
-              (string-append "PREFIX="
-                             #$output))
+      #:make-flags #~(list (string-append "PREFIX=" #$output))
       #:phases
       #~(modify-phases %standard-phases
           (add-before 'configure 'fix-paths
@@ -2998,8 +2992,17 @@ parallel computing platforms.  It also supports serial 
execution.")
                 (("fuser")
                  (search-input-file inputs "bin/fuser")))))
           (replace 'configure
-            (lambda* (#:key make-flags #:allow-other-keys)
-              (apply invoke "make" "config-gcc" make-flags)))
+            (lambda* (#:key (configure-flags '()) #:allow-other-keys)
+              ;; Default to clang-toolchain.
+              ;; Fall back to gcc-toolchain with:
+              ;;     "--with-configure-flag=yosys=config-gcc"
+              (let* ((flags (if (null? configure-flags)
+                                (list "config-clang" "CC=clang" "CXX=clang++")
+                                `(,@configure-flags
+                                  ,(string-append "CC="#$(cc-for-target))
+                                  ,(string-append "CXX="#$(cxx-for-target))))))
+                (format #t "CONFIGURE FLAGS: ~s~%" flags)
+                (apply invoke "make" flags))))
           (add-after 'configure 'configure-makefile
             (lambda* (#:key inputs #:allow-other-keys)
               (substitute* '("Makefile")
@@ -3038,6 +3041,7 @@ parallel computing platforms.  It also supports serial 
execution.")
                          tcl)) ;tclsh for the tests
     (inputs (list abc-yosyshq
                   bash-minimal
+                  clang
                   graphviz
                   gtkwave
                   libffi
@@ -3054,22 +3058,4 @@ parallel computing platforms.  It also supports serial 
execution.")
     (description "Yosys synthesizes Verilog-2005.")
     (license license:isc)))
 
-(define-public yosys-clang
-  (package
-    (inherit yosys)
-    (name "yosys-clang")
-    (arguments
-     (substitute-keyword-arguments (package-arguments yosys)
-       ((#:make-flags _ #f)
-        #~(list "CC=clang"
-                "CXX=clang++"
-                (string-append "PREFIX=" #$output)))
-       ((#:phases phases)
-        #~(modify-phases #$phases
-            (replace 'configure
-              (lambda* (#:key make-flags #:allow-other-keys)
-                (apply invoke "make" "config-clang" make-flags)))))))
-    (inputs
-     (modify-inputs (package-inputs yosys)
-       (append clang)))
-    (synopsis "FPGA Verilog RTL synthesizer (Clang variant)")))
+(define-deprecated-package yosys-clang yosys)

Reply via email to