Package: guix-patches;
Reported by: Garek Dyszel <garekdyszel <at> disroot.org>
Date: Tue, 13 Sep 2022 15:50:01 UTC
Severity: normal
Tags: moreinfo, patch
To reply to this bug, email your comments to 57774 AT debbugs.gnu.org.
Toggle the display of automated, internal messages from the tracker.
View this report as an mbox folder, status mbox, maintainer mbox
guix-patches <at> gnu.org
:bug#57774
; Package guix-patches
.
(Tue, 13 Sep 2022 15:50:01 GMT) Full text and rfc822 format available.Garek Dyszel <garekdyszel <at> disroot.org>
:guix-patches <at> gnu.org
.
(Tue, 13 Sep 2022 15:50:01 GMT) Full text and rfc822 format available.Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
From: Garek Dyszel <garekdyszel <at> disroot.org> To: guix-patches <at> gnu.org Subject: [PATCH] Add qucs-s. Date: Tue, 13 Sep 2022 11:48:40 -0400
* gnu/packages/engineering.scm (qucs-s): New variable. --- gnu/packages/engineering.scm | 74 ++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm index a8b9f1e786..376cb7e8c1 100644 --- a/gnu/packages/engineering.scm +++ b/gnu/packages/engineering.scm @@ -2006,6 +2006,80 @@ (define-public xyce-parallel ,@(alist-delete "trilinos" (package-inputs xyce-serial)))))) +(define-public qucs-s + (package + (name "qucs-s") + (version "0.0.24") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/ra3xdh/qucs_s") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1lbkaw0grw9w7d37z5dbhaqi8p57cpf9yp071zp6xrairkgimdx8")))) + (build-system qt-build-system) + (outputs '("out")) + (inputs (list qtbase-5 qtscript qtsvg-5)) + (native-inputs (list qttools-5)) + (propagated-inputs (list ngspice)) + (arguments + `(;; There exists no "tests" target in the Makefile generated by + ;; CMake. + ;; No other tests provided. + #:tests? #f + #:phases + (modify-phases %standard-phases + (add-after 'install 'get-ngspice-path + (lambda* (#:key inputs #:allow-other-keys) + ;; Adjust two lines in the ~/.config/qucs/qucs_s.conf + ;; file. + (mkdir-p "etc/xdg/qucs_s") + (with-directory-excursion "etc/xdg/qucs_s" + (invoke "touch" "qucs_s.conf") + ;; Specify where the ngspice executable is located. + (invoke "sed" "-i" + (string-append "1iNgspiceExecutable=/gnu/store/" + (assoc-ref inputs "ngspice") + "/bin/ngspice") "qucs_s.conf") + ;; Set the spice4qucs working directory to + ;; ~/.qucs/spice4qucs. + ;; (The default is /spice4qucs, which is rather + ;; dangerous.) + (invoke "sed" "-i" "2iS4Q_workdir=~/.qucs/spice4qucs" + "qucs_s.conf"))))))) + + (home-page "https://ra3xdh.github.io") + (synopsis "QUCS RF circuit simulator with SPICE") + (description + "Qucs-S is a spin-off of the Qucs cross-platform circuit +simulator. The \"S\" letter indicates SPICE. The purpose of the Qucs-S +subproject is to use free SPICE circuit simulation kernels with the +Qucs GUI. It merges the power of SPICE and the simplicity of the Qucs +GUI. Qucs intentionally uses its own SPICE incompatible simulation +kernel Qucsator. It has advanced RF and AC domain simulation features, +but most of the existing industrial SPICE models are incompatible with +it. Qucs-S is not a simulator by itself, but it requires to use a +simulation backend with it. The schematic document format of Qucs and +Qucs-S are fully compatible. Qucs-S can be used with the following +simulation kernels: +@itemize +@item Ngspice is recommended to use. Ngspice is powerful +mixed-level/mixed-signal circuit simulator. The most of industrial +SPICE models are compatible with Ngspice. It has an excellent +performance for time-domain simulation of switching circuits and +powerful postprocessor. +@item XYCE is a new SPICE-compatible circuit simulator written by +Sandia from the scratch. It supports basic SPICE simulation types and +has an advanced RF simulation features such as harmonic balance +simulation. +@item SpiceOpus is developed by the Faculty of Electrical Engineering +of the Ljubljana University. It is based on the SPICE-3f5 code. +@item Backward compatible with Qucsator. +@end itemize") + (license license:gpl2))) + (define-public freehdl (package (name "freehdl") -- 2.37.2
guix-patches <at> gnu.org
:bug#57774
; Package guix-patches
.
(Tue, 13 Sep 2022 16:16:03 GMT) Full text and rfc822 format available.Message #8 received at 57774 <at> debbugs.gnu.org (full text, mbox):
From: "(" <paren <at> disroot.org> To: "Garek Dyszel" <garekdyszel <at> disroot.org>, <57774 <at> debbugs.gnu.org> Subject: Re: [bug#57774] [PATCH] Add qucs-s. Date: Tue, 13 Sep 2022 17:12:36 +0100
Hey, On Tue Sep 13, 2022 at 4:48 PM BST, Garek Dyszel via Guix-patches via wrote: > + (outputs '("out")) This line is redundant; ``out'' is implicit. > + (propagated-inputs (list ngspice)) Can you try to avoid propagating this somehow? Propagation is a last-resort measure, and usually we try to do something like patching invocations of external commands to refer to the full store path. (Although, looking at the ``modify-phases'' below, it seems like you already do that, so I guess you'll only need to move ``ngspice'' to ``inputs''.) > + (arguments > + `(;; There exists no "tests" target in the Makefile generated by Please use the new style ``(list ...)'' instead of ```(...)''. > + (modify-phases %standard-phases You'll need to gexp this under the new arguments style: ``#~(modify-phases ...)''. > + (with-directory-excursion "etc/xdg/qucs_s" > + (invoke "touch" "qucs_s.conf") > + ;; Specify where the ngspice executable is located. > + (invoke "sed" "-i" > + (string-append "1iNgspiceExecutable=/gnu/store/" > + (assoc-ref inputs "ngspice") > + "/bin/ngspice") "qucs_s.conf") > + ;; Set the spice4qucs working directory to > + ;; ~/.qucs/spice4qucs. > + ;; (The default is /spice4qucs, which is rather > + ;; dangerous.) > + (invoke "sed" "-i" "2iS4Q_workdir=~/.qucs/spice4qucs" > + "qucs_s.conf"))))))) This looks pretty redundant. Try using this instead: > + (call-with-output-file "etc/xdg/qucs_s/qucs_s.conf" > + (cute format <> > + "~ > +NgspiceExecutable=~a > +S4Q_workdir=~/.qucs/spice4qucs~%" > + (search-input-file inputs "bin/ngspice"))) And add this to ``arguments'': #:modules `((ice-9 format) (srfi srfi-26) ,@%gnu-build-system-modules) to import ``format'' and ``cute'', respectively. > + (description > + "Qucs-S is a spin-off of the Qucs cross-platform circuit > +simulator. The \"S\" letter indicates SPICE. The purpose of the Qucs-S > +subproject is to use free SPICE circuit simulation kernels with the > +Qucs GUI. It merges the power of SPICE and the simplicity of the Qucs > +GUI. Qucs intentionally uses its own SPICE incompatible simulation > +kernel Qucsator. It has advanced RF and AC domain simulation features, > +but most of the existing industrial SPICE models are incompatible with > +it. Qucs-S is not a simulator by itself, but it requires to use a > +simulation backend with it. The schematic document format of Qucs and > +Qucs-S are fully compatible. Qucs-S can be used with the following > +simulation kernels: > +@itemize > +@item Ngspice is recommended to use. Ngspice is powerful > +mixed-level/mixed-signal circuit simulator. The most of industrial > +SPICE models are compatible with Ngspice. It has an excellent > +performance for time-domain simulation of switching circuits and > +powerful postprocessor. > +@item XYCE is a new SPICE-compatible circuit simulator written by > +Sandia from the scratch. It supports basic SPICE simulation types and > +has an advanced RF simulation features such as harmonic balance > +simulation. > +@item SpiceOpus is developed by the Faculty of Electrical Engineering > +of the Ljubljana University. It is based on the SPICE-3f5 code. > +@item Backward compatible with Qucsator. > +@end itemize") I think this description would probably be better and far more succint as: > + (description > + "This package provides a fork of the Qucs cross-platform circuit > +simulator, which allows the use of SPICE circuit simulation kernels > +with the Qucs GUI.") -- (
guix-patches <at> gnu.org
:bug#57774
; Package guix-patches
.
(Tue, 13 Sep 2022 17:29:01 GMT) Full text and rfc822 format available.Message #11 received at 57774 <at> debbugs.gnu.org (full text, mbox):
From: "Artyom V. Poptsov" <poptsov.artyom <at> gmail.com> To: garekdyszel <at> disroot.org, 57774 <at> debbugs.gnu.org Subject: [bug#57774] [PATCH] Add qucs-s. Date: Tue, 13 Sep 2022 20:28:11 +0300
[Message part 1 (text/plain, inline)]
Hello Garek Dyszel, For the sake of completeness, I've tried to package "qucs-s" already: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=56768 Wasn't finished the process though due to issues and the lack of time, but maybe two incomplete patches could be merged into a working one. Thanks, - Artyom -- Artyom "avp" Poptsov <poptsov.artyom <at> gmail.com> Home page: https://memory-heap.org/~avp/ CADR Hackerspace co-founder: https://cadrspace.ru/ GPG: D0C2 EAC1 3310 822D 98DE B57C E9C5 A2D9 0898 A02F
[signature.asc (application/pgp-signature, inline)]
guix-patches <at> gnu.org
:bug#57774
; Package guix-patches
.
(Tue, 13 Sep 2022 21:12:02 GMT) Full text and rfc822 format available.Message #14 received at 57774 <at> debbugs.gnu.org (full text, mbox):
From: Garek Dyszel <garekdyszel <at> disroot.org> To: 57774 <at> debbugs.gnu.org Subject: [PATCH v2] Add qucs-s. Date: Tue, 13 Sep 2022 21:11:40 +0000
( and Artyom, I synthesized my last version of this package with Artyom's version in https://debbugs.gnu.org/cgi/bugreport.cgi?bug=56768. Starting over from that version, more or less, automatically fixed the following issues: 1. (outputs '("out")) removed 2. (propagated-inputs (list ngspice)) removed 3. (arguments `( --> (arguments (list : style changed Further changes: 1. Overly long description shortened by blending ('s suggestion and Artyom's version. 2. Regexps in the (substitute*) procedure now correctly detect and replace the lines where ngspice and octave are referenced in qucs/main.cpp. Let me know what you think. Thanks, Garek * gnu/packages/engineering.scm (qucs-s): New variable. --- gnu/packages/engineering.scm | 60 ++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm index a8b9f1e786..e759134ae4 100644 --- a/gnu/packages/engineering.scm +++ b/gnu/packages/engineering.scm @@ -36,6 +36,7 @@ ;;; Copyright © 2022 Artyom V. Poptsov <poptsov.artyom <at> gmail.com> ;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer <at> gmail.com> ;;; Copyright © 2022 Felix Gruber <felgru <at> posteo.net> +;;; Copyright © 2022 Garek Dyszel <garekdyszel <at> disroot.org> ;;; ;;; This file is part of GNU Guix. ;;; @@ -2006,6 +2007,65 @@ (define-public xyce-parallel ,@(alist-delete "trilinos" (package-inputs xyce-serial)))))) +(define-public qucs-s + (package + (name "qucs-s") + (version "0.0.24") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/ra3xdh/qucs_s") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1lbkaw0grw9w7d37z5dbhaqi8p57cpf9yp071zp6xrairkgimdx8")))) + (build-system qt-build-system) + (native-inputs (list qttools-5)) + (inputs (list qtbase-5 qtscript qtsvg-5 ngspice octave)) + (arguments + (list #:tests? #f ;no tests + #:phases #~(modify-phases %standard-phases + (add-after 'unpack 'patch + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "qucs/main.cpp" + ;; Use the user's configuration files in + ;; ~/.config/qucs/qucs_s.conf for the + ;; locations of ngspice and octave. If + ;; the locations are not given in + ;; ~/.config/qucs/qucs_s.conf, use the + ;; locations provided by Guix. + (("QString ngsp_exe = \ +QCoreApplication::applicationDirPath\\(\\) \\+") + (string-append + "QString ngsp_exe = \"" + (search-input-file inputs "/bin/ngspice") + "\";")) + (("QDir::separator\\(\\) \\+ \"ngspice\" \\+ \ +executableSuffix;") "") + (("else QucsSettings.OctaveExecutable = \"octave\" \ +\\+ QString\\(executableSuffix\\);") + (string-append + "else QucsSettings.OctaveExecutable = \"" + (search-input-file inputs "/bin/octave") + "\";")))))))) + (synopsis "GUI for different circuit simulation kernels") + (description + "@code{Qucs-S} provides a fork of the Qucs circuit simulator, +which is used as a graphical user interface for a number of popular +circuit simulation engines. The package contains libraries for +schematic capture, visualization and components. The following +simulation kernels are supported: + +@itemize +@item Ngspice (recommended) +@item Xyce +@item SpiceOpus +@item Qucsator (non-spice) +@end itemize") + (home-page "https://ra3xdh.github.io/") + (license license:gpl2+))) + (define-public freehdl (package (name "freehdl") -- 2.37.2
guix-patches <at> gnu.org
:bug#57774
; Package guix-patches
.
(Wed, 14 Sep 2022 06:27:01 GMT) Full text and rfc822 format available.Message #17 received at 57774 <at> debbugs.gnu.org (full text, mbox):
From: "(" <paren <at> disroot.org> To: "Garek Dyszel" <garekdyszel <at> disroot.org>, <57774 <at> debbugs.gnu.org> Subject: Re: [PATCH v2] Add qucs-s. Date: Wed, 14 Sep 2022 07:26:51 +0100
Hey, On Tue Sep 13, 2022 at 10:11 PM BST, Garek Dyszel wrote: > + #:phases #~(modify-phases %standard-phases To conserve lots of horizontal space, consider moving the ``modify-phases'' to a new line: > + #:phases > + #~(modify-phases %standard-phases > + (search-input-file inputs "/bin/ngspice") > + [...] > + (search-input-file inputs "/bin/octave") You can just do ``(search-input-file inputs "bin/octave")'', no need for the leading slash. Also, wouldn't you want to patch in the paths for Xyce, SpiceOpus, and Qucsator, too? > + (synopsis "GUI for different circuit simulation kernels") s/different/various/, perhaps? > + > +@itemize > +@item Ngspice (recommended) > +@item Xyce > +@item SpiceOpus > +@item Qucsator (non-spice) > +@end itemize") > + (home-page "https://ra3xdh.github.io/") > + (license license:gpl2+))) > + > (define-public freehdl > (package > (name "freehdl") > -- > 2.37.2 -- (
guix-patches <at> gnu.org
:bug#57774
; Package guix-patches
.
(Fri, 16 Sep 2022 18:29:01 GMT) Full text and rfc822 format available.Message #20 received at 57774 <at> debbugs.gnu.org (full text, mbox):
From: Garek Dyszel <garekdyszel <at> disroot.org> To: "(" <paren <at> disroot.org>, 57774 <at> debbugs.gnu.org Subject: Re: [PATCH v2] Add qucs-s. Date: Fri, 16 Sep 2022 14:27:47 -0400
Hi (, I applied your fixes, but in the process found that qucs-s had already been successfully added before by looking at the package definition for libngspice. This led to the following bug link: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27344#236. It looks like support was later dropped because qucs-s still depended on Qt4 at the time, mentioned in this thread: https://lists.gnu.org/archive/html/guix-devel/2016-02/msg00596.html. This suggested it would be a good idea to start from the commit where qucs and qucs-s were removed. Now I'm hacking those old package definitions to work with Qt6. qucs-s 0.0.24 still depends on qt5 (which is already out of date), and I don't want to have to update it right away when this Qt security issue comes up again this year. I'll send an updated patch when that's done. Sorry for jumping around among existing package sources; I suppose how it worked out this time. - Garek At 07:26 2022-09-14 UTC+0100, "(" <paren <at> disroot.org> wrote: > Hey, > > On Tue Sep 13, 2022 at 10:11 PM BST, Garek Dyszel wrote: >> + #:phases #~(modify-phases %standard-phases > > To conserve lots of horizontal space, consider moving the ``modify-phases'' > to a new line: > >> + #:phases >> + #~(modify-phases %standard-phases > >> + (search-input-file inputs "/bin/ngspice") >> + [...] >> + (search-input-file inputs "/bin/octave") > > You can just do ``(search-input-file inputs "bin/octave")'', no need for the > leading slash. Also, wouldn't you want to patch in the paths for Xyce, > SpiceOpus, and Qucsator, too? > >> + (synopsis "GUI for different circuit simulation kernels") > > s/different/various/, perhaps? > >> + >> +@itemize >> +@item Ngspice (recommended) >> +@item Xyce >> +@item SpiceOpus >> +@item Qucsator (non-spice) >> +@end itemize") >> + (home-page "https://ra3xdh.github.io/") >> + (license license:gpl2+))) >> + >> (define-public freehdl >> (package >> (name "freehdl") >> -- >> 2.37.2 > > > -- (
Ludovic Courtès <ludo <at> gnu.org>
to control <at> debbugs.gnu.org
.
(Mon, 26 Sep 2022 20:55:02 GMT) Full text and rfc822 format available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.