Subject: [PATCH electronics-team] gnu: Add python-apycula.
From: Cayetano Santos <[email-masked]>
To: [email-masked]
Cc: Cayetano Santos <[email-masked]>
Date: Wed, 14 May 2025 12:30:07 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

* gnu/packages/electronics.scm (python-apycula): New variable.

Change-Id: I8e65416c1a555be189e9b8433d1ec7165aee16e9
---
 gnu/packages/electronics.scm | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/gnu/packages/electronics.scm b/gnu/packages/electronics.scm
index da37a9fb33..36e1909d36 100644
--- a/gnu/packages/electronics.scm
+++ b/gnu/packages/electronics.scm
@@ -563,6 +563,39 @@ (define-public pulseview
 for sigrok.")
     (license license:gpl3+)))
 
+(define-public python-apycula
+  (package
+    (name "python-apycula")
+    (version "0.18")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/YosysHQ/apicula/")
+             (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0r1qx2q5dyjj3085g4ql41b21108m0s3wb7ylsy7xllvw527798l"))))
+    (build-system pyproject-build-system)
+    (arguments
+     (list
+      #:tests? #f                       ;requires network
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'sanity-check-fix
+            (lambda _
+              (substitute* "setup.py"
+                (("'gowin_bba")
+                 "# 'gowin_bbva")))))))
+    (propagated-inputs (list python-crc))
+    (native-inputs (list python-setuptools python-wheel))
+    (home-page "https://github.com/YosysHQ/apicula/")
+    (synopsis "Gowin FPGA bitstream format")
+    (description
+     "The project Apycula provides tools to support development and
+generating bitstreams with Gowin FPGAs.")
+    (license license:expat)))
+
 (define-public python-edalize
   (package
     (name "python-edalize")

base-commit: 5f5d84beccc180f1b51474c0e47eb6e0d0c9175f
-- 
2.49.0