Message ID | 95f594e9bb4e2a081499d9f17d70266afd6a14dd.1747664177.git.csantosb@inventati.org |
---|---|
State | New |
Headers |
Return-Path: <guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org> X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 4DC1627BC4B; Mon, 19 May 2025 15:17:33 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id C75B727BC49 for <patchwork@mira.cbaines.net>; Mon, 19 May 2025 15:17:32 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <guix-patches-bounces@gnu.org>) id 1uH1Ik-0006Ow-FS; Mon, 19 May 2025 10:17:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1uH1Ih-0006Oi-Be for guix-patches@gnu.org; Mon, 19 May 2025 10:17:08 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1uH1If-0004Li-MR for guix-patches@gnu.org; Mon, 19 May 2025 10:17:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:In-Reply-To:References:Subject; bh=ExQJaDx7FMu8c9sbaDBrhGJpj27bPnu+7mycTJFt1Vg=; b=GPIEyUEZ/1GQyOoY61oZbhRGTCwhfou7mS3EHTZaNVj6LM/rAF+vn1l0lCYFcmcz8jP0p+uyF3zJmo2AiGMd4aZM2BxCM6iiel9z9RYfGHOqeGVSZocwcCNrj8KngKLT/wqNvydDL92A+QPj1GXNE9JLLhEjHAibaYTNoA/ICbadx7hJgDEvd2ZDyudr/M9ElyY4igWkJP4qgeQrtnBMSetWGUq6RRhXOM3JlG0EGEe4tUtm8cimIvbKBf5K9EzKKUcDpvP6lyEHleHuARYvrjks2TcBOrKZS7zErAa96xZeHb9eBkNfyecOlXMMKJG/wVvFlBGJ/vqyVHqmVMO9sA==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1uH1Ic-0003A5-Nq; Mon, 19 May 2025 10:17:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#78422] [PATCH electronics-team v3] gnu: Add python-apycula. References: <bdbbe7aa15ba9167c6c0ad515b239281a23d625c.1747218607.git.csantosb@inventati.org> In-Reply-To: <bdbbe7aa15ba9167c6c0ad515b239281a23d625c.1747218607.git.csantosb@inventati.org> Resent-From: Cayetano Santos <csantosb@inventati.org> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org> Resent-CC: csantosb@inventati.org, ekaitz@elenq.tech, gabriel@erlikon.ch, maxim.cournoyer@gmail.com, guix-patches@gnu.org Resent-Date: Mon, 19 May 2025 14:17:02 +0000 Resent-Message-ID: <handler.78422.B78422.174766421912131@debbugs.gnu.org> Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 78422 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: moreinfo patch To: 78422@debbugs.gnu.org Cc: Cayetano Santos <csantosb@inventati.org>, Cayetano Santos <csantosb@inventati.org>, Ekaitz Zarraga <ekaitz@elenq.tech>, Gabriel Wicki <gabriel@erlikon.ch>, Maxim Cournoyer <maxim.cournoyer@gmail.com> X-Debbugs-Original-Xcc: Cayetano Santos <csantosb@inventati.org>, Ekaitz Zarraga <ekaitz@elenq.tech>, Gabriel Wicki <gabriel@erlikon.ch>, Maxim Cournoyer <maxim.cournoyer@gmail.com> Received: via spool by 78422-submit@debbugs.gnu.org id=B78422.174766421912131 (code B ref 78422); Mon, 19 May 2025 14:17:02 +0000 Received: (at 78422) by debbugs.gnu.org; 19 May 2025 14:16:59 +0000 Received: from localhost ([127.0.0.1]:41654 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>) id 1uH1IY-00039Q-7F for submit@debbugs.gnu.org; Mon, 19 May 2025 10:16:58 -0400 Received: from latitanza.investici.org ([2001:888:2000:56::19]:20791) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <csantosb@inventati.org>) id 1uH1IU-00038o-Jz for 78422@debbugs.gnu.org; Mon, 19 May 2025 10:16:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inventati.org; s=stigmate; t=1747664211; bh=ExQJaDx7FMu8c9sbaDBrhGJpj27bPnu+7mycTJFt1Vg=; h=From:To:Cc:Subject:Date:From; b=PGfB/AxXQJyGaAVJgagnVhItxScd1wf2e9LsZe8y0B3yDl+kylyiafCXO0cad55Kg AX3UeRKmaziwRTIIEsDDuBcEYMA89//9PJfpSJdHEulXIENC19XMXTigiktw0Akr/V xc9EWQw9rdt1QDsmaBV7dnJQzAW3s0z40dwi2mMI= Received: from mx3.investici.org (unknown [127.0.0.1]) by latitanza.investici.org (Postfix) with ESMTP id 4b1KW71VFmzGprF; Mon, 19 May 2025 14:16:51 +0000 (UTC) Received: from [82.94.249.234] (mx3.investici.org [82.94.249.234]) (Authenticated sender: cayetano.santos@inventati.org) by localhost (Postfix) with ESMTPSA id 4b1KW66YF8zGpr9; Mon, 19 May 2025 14:16:50 +0000 (UTC) Date: Mon, 19 May 2025 16:16:17 +0200 Message-ID: <95f594e9bb4e2a081499d9f17d70266afd6a14dd.1747664177.git.csantosb@inventati.org> X-Mailer: git-send-email 2.49.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: <guix-patches.gnu.org> List-Unsubscribe: <https://lists.gnu.org/mailman/options/guix-patches>, <mailto:guix-patches-request@gnu.org?subject=unsubscribe> List-Archive: <https://lists.gnu.org/archive/html/guix-patches> List-Post: <mailto:guix-patches@gnu.org> List-Help: <mailto:guix-patches-request@gnu.org?subject=help> List-Subscribe: <https://lists.gnu.org/mailman/listinfo/guix-patches>, <mailto:guix-patches-request@gnu.org?subject=subscribe> Reply-to: Cayetano Santos <csantosb@inventati.org> X-ACL-Warn: , Cayetano Santos via Guix-patches <guix-patches@gnu.org> From: Cayetano Santos via Guix-patches via <guix-patches@gnu.org> Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches |
Series |
[bug#78422,electronics-team,v3] gnu: Add python-apycula.
|
|
Commit Message
Cayetano Santos
May 19, 2025, 2:16 p.m. UTC
* gnu/packages/electronics.scm (python-apycula): New variable. Change-Id: I8e65416c1a555be189e9b8433d1ec7165aee16e9 --- gnu/packages/electronics.scm | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) base-commit: 450a361532573a02389530a6a80b7821683ed41b -- 2.49.0
Comments
LGTM
Hi, Cayetano Santos <csantosb@inventati.org> writes: > * 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 dc9de79ffa..2736df4b3c 100644 > --- a/gnu/packages/electronics.scm > +++ b/gnu/packages/electronics.scm > @@ -29,6 +29,7 @@ (define-module (gnu packages electronics) > #:use-module (guix build-system cmake) > #:use-module (guix build-system gnu) > #:use-module (guix build-system pyproject) > + #:use-module (guix build-system python) > #:use-module (guix download) > #:use-module (guix gexp) > #:use-module (guix git-download) > @@ -560,6 +561,38 @@ (define-public pulseview > (description "PulseView is a Qt based logic analyzer, oscilloscope and MSO GUI > for sigrok.") > (license license:gpl3+))) > +(define-public python-apycula > + (package > + (name "python-apycula") > + (version "0.19") > + ;; The pypi tar.gz file includes the necessary .pickle files, not available > + ;; in the home-page repository. That sounds like potentially bundled pre-generated sources (I hope not binaries?). How are these generated? Ideally we'd generate everything needed from sources.
Hi, Cayetano Santos <csantosb@inventati.org> writes: > * 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 dc9de79ffa..2736df4b3c 100644 > --- a/gnu/packages/electronics.scm > +++ b/gnu/packages/electronics.scm > @@ -29,6 +29,7 @@ (define-module (gnu packages electronics) > #:use-module (guix build-system cmake) > #:use-module (guix build-system gnu) > #:use-module (guix build-system pyproject) > + #:use-module (guix build-system python) > #:use-module (guix download) > #:use-module (guix gexp) > #:use-module (guix git-download) > @@ -560,6 +561,38 @@ (define-public pulseview > (description "PulseView is a Qt based logic analyzer, oscilloscope and MSO GUI > for sigrok.") > (license license:gpl3+))) > +(define-public python-apycula > + (package > + (name "python-apycula") > + (version "0.19") > + ;; The pypi tar.gz file includes the necessary .pickle files, not available > + ;; in the home-page repository. It looks like running just 'make' in the repository should suffice to generate the .pickle files, which are apparently some database files ("chipdb") [0]. Could you give it a try, and perhaps fetch from git instead to avoid the pregenerated sources (else clean it up in a snippet phase) ? Thanks! [0] https://github.com/YosysHQ/apicula/blob/master/Makefile
Hi, I tried locally, this is my local changes so far: --8<---------------cut here---------------start------------->8--- (define-public apycula (package (name "apycula") (version "0.19") ;; The pypi tar.gz file includes the necessary .pickle files, not available ;; in the home-page repository. (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 "0i3p3x3hs7c2dw5g6wa5g9lh551f5drb0abp7p3gkcfq4hi7bwm0")))) (build-system pyproject-build-system) (arguments (list #:tests? #f ;requires Gowin EDA tools #:phases #~(modify-phases %standard-phases (add-after 'unpack 'generate-chipdb-files (lambda _ (invoke "make" "GOWINHOME=/tmp"))) (add-after 'unpack 'sanity-check-fix (lambda _ ;; The module name changed (see: ;; https://github.com/YosysHQ/apicula/issues/337). (substitute* "setup.py" (("'gowin_bba") "# 'gowin_bbva"))))))) (native-inputs (list python-setuptools python-wheel ;gowin-eda ;; PACKAGE ME! )) (inputs (list python-crc)) (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))) --8<---------------cut here---------------end--------------->8--- I'm fetching from git, and renamed the package to just 'apycula' since it appears intended to be used as tools (commands), not as a library. I've also reported the bug found upstream and linked it here. Thus we can also make propagated-inputs just inputs, since they are captured in the command wrapper scripts. The problem now is that to generate the chipdb files we need gowin-eda. Since this would also enable running the test suite, I think gowin-eda should be packaged first and added to the native inputs here: --8<---------------cut here---------------start------------->8--- starting phase `generate-chipdb-files' python3 -m apycula.tiled_fuzzer GW1N-1 Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "/tmp/guix-build-apycula-0.19.drv-0/source/apycula/tiled_fuzzer.py", line 231, in <module> with open(f"{gowinhome}/IDE/share/device/{device}/{device}.fse", 'rb') as f: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FileNotFoundError: [Errno 2] No such file or directory: '/tmp/IDE/share/device/GW1N-1/GW1N-1.fse' make: *** [Makefile:12: GW1N-1_stage1.pickle] Error 1 error: in phase 'generate-chipdb-files': uncaught exception: %exception #<&invoke-error program: "make" arguments: ("GOWINHOME=/tmp") exit-status: 2 term-signal: #f stop-signal: #f> phase `generate-chipdb-files' failed after 0.1 seconds --8<---------------cut here---------------end--------------->8--- Cayetano, could you please try packaging gowin-eda and using it here, to get past the above issue? And see if we can enable the test suite too! -- Thanks, Maxim
>mer. 21 mai 2025 at 08:41, Maxim Cournoyer <maxim.cournoyer@gmail.com> wrote: Hi Maxim, > I'm fetching from git, and renamed the package to just 'apycula' since > it appears intended to be used as tools (commands), not as a library. Just for the record, this package would allow including support for gowin in guix nextpnr package, see [0], implementing a whole guix workflow for gowin fpgas. > The problem now is that to generate the chipdb files we need gowin-eda. > Since this would also enable running the test suite, I think gowin-eda > should be packaged first and added to the native inputs here: Sorry, my bad. I assumed pickle files were acceptable for guix, while clearly they are not. Now, gowin-eda [1] are proprietary tools, for as much as I know, so I’m afraid this is a closed path for us, unless I figure out a clean way to obtain the necessary files under a free license. I’ll take the time to investigate, Thanks again for your help, C. [0] https://research.utwente.nl/files/249654527/DeVos2020complete.pdf [1] https://www.gowinsemi.com/en/support/home/
Hello, Cayetano Santos <csantosb@inventati.org> writes: >>mer. 21 mai 2025 at 08:41, Maxim Cournoyer <maxim.cournoyer@gmail.com> wrote: > > Hi Maxim, > >> I'm fetching from git, and renamed the package to just 'apycula' since >> it appears intended to be used as tools (commands), not as a library. > > Just for the record, this package would allow including support for > gowin in guix nextpnr package, see [0], implementing a whole guix > workflow for gowin fpgas. Neat! >> The problem now is that to generate the chipdb files we need gowin-eda. >> Since this would also enable running the test suite, I think gowin-eda >> should be packaged first and added to the native inputs here: > > Sorry, my bad. I assumed pickle files were acceptable for guix, while > clearly they are not. They may be! Since they can be considered data files (thus non-funtional), the license terms per the GNU FSDG are relaxed: the license that applies to these may be non-free, and what matters is being able to redistribute these freely, without any restriction [0]. See the 'Non-functional Data' paragraph at [0]. [0] https://www.gnu.org/distros/free-system-distribution-guidelines.html
>mer. 21 mai 2025 at 18:14, Maxim Cournoyer <maxim.cournoyer@gmail.com> wrote: >>> The problem now is that to generate the chipdb files we need gowin-eda. >>> Since this would also enable running the test suite, I think gowin-eda >>> should be packaged first and added to the native inputs here: >> >> Sorry, my bad. I assumed pickle files were acceptable for guix, while >> clearly they are not. > > They may be! Since they can be considered data files (thus > non-funtional), the license terms per the GNU FSDG are relaxed: the > license that applies to these may be non-free, and what matters is being > able to redistribute these freely, without any restriction [0]. See the > 'Non-functional Data' paragraph at [0]. This means a v4, including a ref to the issue you just open, might be accepted ? Otherwise, we have the huge and public educational distribution of the gowin ide [0] (the 784.12MB thing), but we’d rather avoid such an horror; anyway it is unclear to me the license which applies here. [0] https://www.gowinsemi.com.cn/faq.aspx
diff --git a/gnu/packages/electronics.scm b/gnu/packages/electronics.scm index dc9de79ffa..2736df4b3c 100644 --- a/gnu/packages/electronics.scm +++ b/gnu/packages/electronics.scm @@ -29,6 +29,7 @@ (define-module (gnu packages electronics) #:use-module (guix build-system cmake) #:use-module (guix build-system gnu) #:use-module (guix build-system pyproject) + #:use-module (guix build-system python) #:use-module (guix download) #:use-module (guix gexp) #:use-module (guix git-download) @@ -560,6 +561,38 @@ (define-public pulseview (description "PulseView is a Qt based logic analyzer, oscilloscope and MSO GUI for sigrok.") (license license:gpl3+))) +(define-public python-apycula + (package + (name "python-apycula") + (version "0.19") + ;; The pypi tar.gz file includes the necessary .pickle files, not available + ;; in the home-page repository. + (source + (origin + (method url-fetch) + (uri (pypi-uri "Apycula" version)) + (sha256 + (base32 "034crnlrb3dlwwc75gpskyz47jvhcv0c3l74z5rpyz622ajv46d6")))) + (build-system pyproject-build-system) + (arguments + (list + #:tests? #f ;requires Gowin EDA tools + #:phases + #~(modify-phases %standard-phases + ;; Fix error related to import of 'apycula.gowin_bba'. + (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