Subject: [bug#77067] [PATCH] gnu: icestorm: Update to 0.0-5.7fbf8c0.

From: Cayetano Santos <[email-masked]>
Date: Mon, 17 Mar 2025 11:21:33 +0100

* gnu/packages/fpga.scm (icestorm): Update to 0.0-5.7fbf8c0.

Change-Id: I545ac91c94a97989c3a1494479d36cb5bb46930d
---
 gnu/packages/fpga.scm | 91 +++++++++++++++++++++++--------------------
 1 file changed, 48 insertions(+), 43 deletions(-)

diff --git a/gnu/packages/fpga.scm b/gnu/packages/fpga.scm
index c09fe9bc76..efe0fe89c3 100644
--- a/gnu/packages/fpga.scm
+++ b/gnu/packages/fpga.scm
@@ -269,49 +269,54 @@ (define-public yosys-clang
     (synopsis "FPGA Verilog RTL synthesizer (Clang variant)")))
 
 (define-public icestorm
-  (let ((commit "2bc541743ada3542c6da36a50e66303b9cbd2059")
-        (revision "4"))
-   (package
-    (name "icestorm")
-    (version (git-version "0.0" revision commit))
-    (source (origin
-              (method git-fetch)
-              (uri (git-reference
-                     (url "https://github.com/cliffordwolf/icestorm")
-                     (commit commit)))
-              (file-name (git-file-name name version))
-              (sha256
-                (base32
-                 "0d0ibdq3rzmjcbv97h4b9wgq8ikvgwlfw60spi2w81mis317lis8"))))
-    (build-system gnu-build-system)
-    (arguments
-     `(#:tests? #f ; no unit tests that don't need an FPGA exist.
-       #:make-flags (list "CC=gcc" "CXX=g++"
-                          (string-append "PREFIX=" (assoc-ref %outputs "out")))
-       #:phases
-        (modify-phases %standard-phases
-          (add-after 'unpack 'remove-usr-local
-            (lambda _
-              (substitute* "iceprog/Makefile"
-                (("-I/usr/local/include") "")
-                (("-L/usr/local/lib") ""))
-              #t))
-          (add-after 'remove-usr-local 'fix-usr-local
-            (lambda* (#:key outputs #:allow-other-keys)
-              (substitute* "icebox/icebox_vlog.py"
-                (("/usr/local/share") (string-append (assoc-ref outputs "out") "/share")))
-              #t))
-          (delete 'configure))))
-    (inputs
-     (list libftdi))
-    (native-inputs
-     `(("python-3" ,python)
-       ("pkg-config" ,pkg-config)))
-    (home-page "https://www.clifford.at/icestorm/")
-    (synopsis "Project IceStorm - Lattice iCE40 FPGAs bitstream tools")
-    (description "Project IceStorm - Lattice iCE40 FPGAs Bitstream Tools.
-Includes the actual FTDI connector.")
-    (license license:isc))))
+  (let ((commit "7fbf8c0afbcf7665c45499b090409859b1815184")
+        (revision "5"))
+    (package
+      (name "icestorm")
+      (version (git-version "0.0" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/YosysHQ/icestorm/")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32 "0vwl0j5sw2awsv82s18zby522h2b6wa5jyc6dkpqfxybak19kv7f"))))
+      (build-system gnu-build-system)
+      (arguments
+       (list
+        #:tests? #f ;no unit tests that don't need an FPGA exist.
+        #:make-flags
+        #~(list (string-append "CC=" #$(cc-for-target))
+                (string-append "CXX=" #$(cxx-for-target))
+                (string-append "PREFIX=" #$output)
+                "ICEPROG=1")
+        #:phases
+        #~(modify-phases %standard-phases
+            (add-after 'unpack 'fix-usr-local
+              (lambda* (#:key outputs #:allow-other-keys)
+                (with-directory-excursion "icepack"
+                  (substitute* "Makefile"
+                    (("/usr/local")
+                     #$output)))
+                (with-directory-excursion "icebox"
+                  (substitute* "Makefile"
+                    (("/usr/local/share")
+                     (string-append #$output "/share")))
+                  (substitute* "icebox_vlog.py"
+                    (("/usr/local/share")
+                     (string-append #$output "/share"))))))
+            (delete 'configure))))
+      (inputs (list libftdi))
+      (native-inputs (list python pkg-config))
+      (home-page "https://prjicestorm.readthedocs.io/")
+      (synopsis "Project IceStorm")
+      (description
+       "Project IceStorm aims at documenting the bitstream format of
+Lattice iCE40 FPGAs and providing simple tools for analyzing and creating bitstream
+files.")
+      (license license:isc))))
 
 (define-public nextpnr-ice40
   (let* ((version "0.7")

base-commit: fd19785a9a7f111c6a97da25187c3351e7e8f3fd
-- 
2.48.1