[PATCH] gnu: engineering: Add qucs-s.

  • Open
  • quality assurance status badge
Details
3 participants
  • Maxime Devos
  • Jean Pierre De Jesus DIAZ
  • Artyom V. Poptsov
Owner
unassigned
Submitted by
Artyom V. Poptsov
Severity
normal
A
A
Artyom V. Poptsov wrote on 25 Jul 2022 22:02
(address . guix-patches@gnu.org)
87ilnlgduf.fsf@gmail.com
Hello,

this patch adds "Qucs-S", a GUI for different circuit simulation
kernels:

Currently the package supports only Ngspice simulation kernel, as it is
recommended by the authors and it is readily available in Guix; but in
the future other kernels can be added, namely Xyce (which is in the Guix
too.)
From ddc382ec3552c565df1694cf80f0481d0cb55492 Mon Sep 17 00:00:00 2001
From: "Artyom V. Poptsov" <poptsov.artyom@gmail.com>
Date: Mon, 25 Jul 2022 22:57:14 +0300
Subject: [PATCH] gnu: Add qucs-s.

* gnu/packages/engineering.scm (qucs-s): New variable.
---
gnu/packages/engineering.scm | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)

Toggle diff (46 lines)
diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
index 6eefd14d7e..141dc613ae 100644
--- a/gnu/packages/engineering.scm
+++ b/gnu/packages/engineering.scm
@@ -3757,3 +3757,39 @@ (define-public candle
@item Visualizing G-code files.
@end itemize")
(license license:gpl3+))))
+
+(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 cmake-build-system)
+ (native-inputs (list qttools))
+ (inputs (list qtbase-5 qtscript qtsvg))
+ (propagated-inputs (list ngspice))
+ (arguments
+ (list #:tests? #f)) ;no tests
+ (synopsis "GUI for different circuit simulation kernels")
+ (description
+ "@code{Qucs-S} provides a fancy 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+)))
--
2.34.1
Thanks,

- Artyom

--
Artyom "avp" Poptsov <poptsov.artyom@gmail.com>
CADR Hackerspace co-founder: https://cadrspace.ru/
GPG: D0C2 EAC1 3310 822D 98DE B57C E9C5 A2D9 0898 A02F
-----BEGIN PGP SIGNATURE-----

iQFNBAEBCgA3FiEE0MLqwTMQgi2Y3rV86cWi2QiYoC8FAmLe9ugZHHBvcHRzb3Yu
YXJ0eW9tQGdtYWlsLmNvbQAKCRDpxaLZCJigL7UsB/9FZauy4djcku0xECh0OqtP
p3uLHm6yDqx5ehe4gY8OAmW2mKioqNhbn2xg802fjYtcLmjuiEGaGXW7TvVgtGGy
Dq4mAPwq4WgR3yhRrc9p92vmefl/VZuqzaUdLdxiK9p2A32x6sgGTecS2iKqZPa5
+4atrumw5zLOzdBg766Cxo2+W4QOSajWyf3JFZmL3tM1de3OW5BOUu66xkK6mdD8
9SQxs5y2XZLx57r1FKfGzzRcLL5Qf1n27FIYaBGRmv7xFAszdemuyvvTdozVxxbs
PCLo/CY8XCC5/QlVkKaL8zQj9FwzphuGPYLap5MhbfoLXxYLAvZEAErfGGBGPJj9
=+FMh
-----END PGP SIGNATURE-----

M
M
Maxime Devos wrote on 26 Jul 2022 20:07
e339362b-d8ff-e364-380d-c54cb51082a0@telenet.be
Toggle quote (1 lines)
> this patch adds "Qucs-S", a GUI for different circuit simulation
Often GUIs have problems with finding icons, could you check whether qucs-s works in a pure environment?
Toggle quote (1 lines)
> +    (propagated-inputs (list ngspice))
Propagation is not very robust (e.g. if run directly from the store with
$(guix build qucs-s)/bin/the-binary), would it be possible to not
propagate this? E.g., if you are propagating it because of not finding a
binary, you could use substitute* to insert an appropriate absolute file
name.
Greetings,
Maxime.
Attachment: OpenPGP_signature
A
A
Artyom V. Poptsov wrote on 29 Jul 2022 17:26
(name . Maxime Devos)(address . maximedevos@telenet.be)(address . 56768@debbugs.gnu.org)
87fsik0wjm.fsf@gmail.com
Hello Maxime,

thanks you for the patch review!

Toggle quote (3 lines)
> Often GUIs have problems with finding icons, could you check whether
> qucs-s works in a pure environment?

I tried to run Qucs-S installed through Guix, like the follows:

Toggle snippet (5 lines)
guix shell -D guix
./pre-inst-env guix shell -D --pure qucs-s
qucs-s

And all the icons seem to be fine

Although it can be that I don't fully understand what you mean by "pure
environment" in that case.

Toggle quote (5 lines)
> Propagation is not very robust (e.g. if run directly from the store with $(guix
> build qucs-s)/bin/the-binary), would it be possible to not propagate this? E.g.,
> if you are propagating it because of not finding a binary, you could use
> substitute* to insert an appropriate absolute file name.

Okay, that's a good point. I checked the sources for the places where
Qucs-S uses executable paths and added substitutions for that.

I kept NGSpice in "propagated-inputs" because Qucs-S requires it to do
the simulations in runtime.

Also I've added GNU Octave to the "propagated-inputs" and substituted
the path to Octave too.

I tried to run simulations from the examples provided with the Qucs-S
and it seems to me that Qucs-S mostly works as it should.

I should note here that I'm not very good at electronics and such
simulations yet, so you should take what I said above with a grain of
salt indeed. ;-)

Please check the updated patch.
From a4d83e1d5652654db4b6de7bc272ec4a0bfb114f Mon Sep 17 00:00:00 2001
From: "Artyom V. Poptsov" <poptsov.artyom@gmail.com>
Date: Mon, 25 Jul 2022 22:57:14 +0300
Subject: [PATCH] gnu: Add qucs-s.

* gnu/packages/engineering.scm (qucs-s): New variable.
---
gnu/packages/engineering.scm | 54 ++++++++++++++++++++++++++++++++++--
1 file changed, 52 insertions(+), 2 deletions(-)

Toggle diff (71 lines)
diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
index 6eefd14d7e..95c6c012a3 100644
--- a/gnu/packages/engineering.scm
+++ b/gnu/packages/engineering.scm
@@ -3470,8 +3470,7 @@ (define-public libnest2d-for-cura
(build-system cmake-build-system)
(inputs
(list boost clipper nlopt))
- (arguments
- `(#:tests? #f
+ (arguments `(#:tests? #f
#:phases
(modify-phases %standard-phases
(add-before 'configure 'fix-clipper-detection
@@ -3757,3 +3756,54 @@ (define-public candle
@item Visualizing G-code files.
@end itemize")
(license license:gpl3+))))
+
+(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 cmake-build-system)
+ (native-inputs (list qttools))
+ (inputs (list qtbase-5 qtscript qtsvg))
+ (propagated-inputs (list 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"
+ (("QucsSettings.NgspiceExecutable = ngsp_exe")
+ (string-append "QucsSettings.NgspiceExecutable = \""
+ (assoc-ref inputs "ngspice")
+ "/bin/ngspice"
+ "\""))
+ (("QucsSettings.OctaveExecutable = \"octave\" + QString(executableSuffix)")
+ (string-append "QucsSettings.OctaveExecutable = \""
+ (assoc-ref inputs "octave")
+ "/bin/octave"
+ "\""))))))))
+ (synopsis "GUI for different circuit simulation kernels")
+ (description
+ "@code{Qucs-S} provides a fancy 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+)))
--
2.34.1
Thanks,

- Artyom

--
Artyom "avp" Poptsov <poptsov.artyom@gmail.com>
CADR Hackerspace co-founder: https://cadrspace.ru/
GPG: D0C2 EAC1 3310 822D 98DE B57C E9C5 A2D9 0898 A02F
-----BEGIN PGP SIGNATURE-----

iQFNBAEBCgA3FiEE0MLqwTMQgi2Y3rV86cWi2QiYoC8FAmLj/D0ZHHBvcHRzb3Yu
YXJ0eW9tQGdtYWlsLmNvbQAKCRDpxaLZCJigL7UbB/94vpM3g1NbV0A+f9cNHqp9
F2fcTbbSVUWHpj99bQ04UX8nctC3QGTLj9iKG5V+pgbO762dY/P9ZAGgcG2eCsyO
lG/WcWuwKrk+3b7D8c1Xf7Ojs5HwVwSo39LnuOhhE+aQYTk09JThatqR8dfzoypP
+fQpRG0Ydajlk2JX/OA4kRkTj8fb88ofcJxThsOSc+zE9FV220MgZ28wr4YaptQh
J8UWn3eAzU0jEoCDKf8MQ3SMG9c8QZEvUBw9ZHdCiu5gFu+PdHfpOULDz3PX7xE0
eTlI5L37pEqNM/zHtOX/KOqDQkt/i/fAz83PWtHgOPsJR34UEdoZTU/8t3foZsSi
=vPmF
-----END PGP SIGNATURE-----

M
M
Maxime Devos wrote on 29 Jul 2022 18:17
(name . Artyom V. Poptsov)(address . poptsov.artyom@gmail.com)(address . 56768@debbugs.gnu.org)
a06ecddf-d0d6-487b-f7da-aa84a2e63f33@telenet.be
On 29-07-2022 17:26, Artyom V. Poptsov wrote:
Toggle quote (18 lines)
> Hello Maxime,
>
> thanks you for the patch review!
>
>> Often GUIs have problems with finding icons, could you check whether
>> qucs-s works in a pure environment?
> I tried to run Qucs-S installed through Guix, like the follows:
>
> --8<---------------cut here---------------start------------->8---
> guix shell -D guix
> ./pre-inst-env guix shell -D --pure qucs-s
> qucs-s
> --8<---------------cut here---------------end--------------->8---
>
> And all the icons seem to be fine
>
> Although it can be that I don't fully understand what you mean by "pure
> environment" in that case.
That's what I meant, thanks.  I guess the icons issue is GTK-specific
and doesn't happen for Qt.
Toggle quote (6 lines)
>> Propagation is not very robust (e.g. if run directly from the store with $(guix
>> build qucs-s)/bin/the-binary), would it be possible to not propagate this? E.g.,
>> if you are propagating it because of not finding a binary, you could use
>> substitute* to insert an appropriate absolute file name.
> Okay, that's a good point. I checked the sources for the places where
> Qucs-S uses executable paths and added substitutions for that.
These substitutions look fine ...
Toggle quote (12 lines)
> + (("QucsSettings.NgspiceExecutable = ngsp_exe")
> +                      (string-append "QucsSettings.NgspiceExecutable
> = \""
> +                                     (assoc-ref inputs "ngspice")
> +                                     "/bin/ngspice"
> +                                     "\""))
> +                     (("QucsSettings.OctaveExecutable = \"octave\" +
> QString(executableSuffix)")
> +                      (string-append "QucsSettings.OctaveExecutable = \""
> +                                     (assoc-ref inputs "octave")
> +                                     "/bin/octave"
> +                                     "\""))))))))
... but they can be improved, by replacing the assoc-ref with
search-input-file: (search-input-file inputs "/bin/ngspice"). That way,
it doesn't depend on the package name anymore, which is preferred by
cases --with-input more usable. That blog post also has en example.
(*) Don't follow the first 'hello' example though -- it showcases
possibilities, not what should be done, and interferes with --with-input.
Toggle quote (5 lines)
> I kept NGSpice in "propagated-inputs" because Qucs-S requires it to do
> the simulations in runtime.
>
> Also I've added GNU Octave to the "propagated-inputs" and substituted
> the path to Octave too.
By that logic, since qtbase and qtsvg are used at runtime too, they
should be propagated as well, but ...
Toggle quote (2 lines)
> I tried to run simulations from the examples provided with the Qucs-S
> and it seems to me that Qucs-S mostly works as it should.
... as you have observed, things work even when they aren't propagated
(at least for qtbase etc., ngspice and octave have not yet been tested).
Less experimentally, the propagated- in propagated-inputs means only
that: propagation -- the dependencies are still installed even if they
aren't propagated, because the substitute* inserts a reference so the GC
knows to not delete it, the only difference is that the dependency isn't
automatically put in the profile when not propagating.
In theory, the propagation shouldn't be required because you added a
'substitute*', so in principle qucs-s should know where to find it.
Also, I noticed these substitutions modify configuration, could you
verify they aren't saved in wherever qucs-s' configuration file is
located? Because if they are, then even after an update of octave etc.
it would seem that qucs-s would still use the old octave.
Greetings,
Maxime.
Attachment: OpenPGP_signature
A
A
Artyom V. Poptsov wrote on 30 Jul 2022 08:59
(name . Maxime Devos)(address . maximedevos@telenet.be)(address . 56768@debbugs.gnu.org)
87v8rfxf06.fsf@gmail.com
Hello Maxime.

Toggle quote (3 lines)
> That's what I meant, thanks.  I guess the icons issue is GTK-specific
> and doesn't happen for Qt.

Yes, Qt allows the application resources (like icons) to be put into the
application binary on the build time, and that's how it's done usually.

Toggle quote (7 lines)
> These substitutions look fine ... ... ... but they can be improved, by
> replacing the assoc-ref with search-input-file: (search-input-file
> inputs "/bin/ngspice"). That way, it doesn't depend on the package
> name anymore, which is preferred by
> <https://guix.gnu.org/blog/2021/the-big-change/> (*) and makes in some
> cases --with-input more usable. That blog post also has en example.

Done.

Toggle quote (9 lines)
> By that logic, since qtbase and qtsvg are used at runtime too, they
> should be propagated as well, but ...
> > I tried to run simulations from the examples provided with the
> > Qucs-S and it seems to me that Qucs-S mostly works as it should.

> ... as you have observed, things work even when they aren't propagated
> (at least for qtbase etc., ngspice and octave have not yet been
> tested).

I usually put into "propagated-inputs" packages that provide some binary
that the current package use in the runtime.

So do you mean that I should rely only on "inputs" package property, and
the inputs will be propagated anyway if they're in use by the package?

Toggle quote (3 lines)
> In theory, the propagation shouldn't be required because you added a
> 'substitute*', so in principle qucs-s should know where to find it.

Following your logic I moved NGSpice and Octave from "propagated-inputs"
to "inputs" as they substituted in the sources.

Toggle quote (5 lines)
> Also, I noticed these substitutions modify configuration, could you
> verify they aren't saved in wherever qucs-s' configuration file is
> located? Because if they are, then even after an update of octave etc.
> it would seem that qucs-s would still use the old octave.

Good catch. In my previous patch I substituted NGSpice and Octave in the
part of code that is executed only when no configuration is provided, so
the current binary versions used by default. However after the first run
Qucs-S stores the paths to the configuration file:

Toggle snippet (5 lines)
$ cat ~/.config/qucs/qucs_s.conf [General] ...
NgspiceExecutable=/gnu/store/jl159ilvjzxd0i45xf2z8llbhvl10w54-ngspice-37/bin/ngspice
...

So the next time Qucs-S run it gets the paths from the configuration
file.

I changed the substitutions so Qucs-S will ignore the paths to Octave
and NGSpice from the configuration and will always use the paths
provided by Guix. Also any custom paths to Octave and NGSpice will be
overwritten in the config when the application exits.

That is sub-optimal in my view as we're messing up with the application
configuration logic and if a user wants to change those paths he or she
will be able to remove the config and set the paths in the startup
configuration dialogue, but the settings will have no effect; that will
be a bit confusing.

Yet at least Qucs-S will always use the right Octave/NGSpice path from
GNU Guix.

What do you think?

Here's the patch.
From 9888a6b0169bd3b9f158749f164b2fb1ebd5603a Mon Sep 17 00:00:00 2001
From: "Artyom V. Poptsov" <poptsov.artyom@gmail.com>
Date: Mon, 25 Jul 2022 22:57:14 +0300
Subject: [PATCH] gnu: Add qucs-s.

* gnu/packages/engineering.scm (qucs-s): New variable.
---
gnu/packages/engineering.scm | 48 ++++++++++++++++++++++++++++++++++++
1 file changed, 48 insertions(+)

Toggle diff (58 lines)
diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
index 6eefd14d7e..4cd9e2767a 100644
--- a/gnu/packages/engineering.scm
+++ b/gnu/packages/engineering.scm
@@ -3757,3 +3757,51 @@ (define-public candle
@item Visualizing G-code files.
@end itemize")
(license license:gpl3+))))
+
+(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 cmake-build-system)
+ (native-inputs (list qttools))
+ (inputs (list qtbase-5 qtscript qtsvg 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"
+ (("QucsSettings.NgspiceExecutable = .*;")
+ (string-append
+ "QucsSettings.NgspiceExecutable = \""
+ (search-input-file inputs "/bin/ngspice")
+ "\";"))
+ (("QucsSettings.OctaveExecutable = .*;")
+ (string-append
+ "QucsSettings.OctaveExecutable = \""
+ (search-input-file inputs "/bin/octave") "\";"))))))))
+ (synopsis "GUI for different circuit simulation kernels")
+ (description
+ "@code{Qucs-S} provides a fancy 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+)))
--
2.34.1
Thanks,

- Artyom

--
Artyom "avp" Poptsov <poptsov.artyom@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
-----BEGIN PGP SIGNATURE-----

iQFNBAEBCgA3FiEE0MLqwTMQgi2Y3rV86cWi2QiYoC8FAmLk1skZHHBvcHRzb3Yu
YXJ0eW9tQGdtYWlsLmNvbQAKCRDpxaLZCJigLw+QB/4nOMhjV67d90LD0TTRMG2n
YHFZZbt4NTQUr5CeHbWRfntv9VJYL76qHn6LDcRKJU45nb5y04rxzZFwjhr18zjY
aC229fzgs7JEJGWqcibxEEmNp4Hy1i6gRJXtfM+8O4+K+xv04yaysD5aJAYSivEm
gh6kJa6+bEuZfun0gM0EJ6jl8FoGCZq6nXmCZ8yTG/hr5UMR63ASQTgKOL2zBmu1
dJTwMhd2ngUteM9zf8BRcPT4kJX/1LHgavpyVND5GZ9qC90dHreGwnbFMQFZyvOT
nOSaUL3mewkXwkioOKY9erxKNSQBj0Onkrs0HQ8hxOO7yxCw9+be2js5qA5HxLWO
=+B9B
-----END PGP SIGNATURE-----

J
J
Jean Pierre De Jesus DIAZ wrote on 6 Aug 2022 12:15
[PATCH] gnu: engineering: Add qucs-s.
(name . 56768@debbugs.gnu.org)(address . 56768@debbugs.gnu.org)
qOtd5kwWRHyxQdBoWCRYoT7P1Igr72bkwKK5hHCkbQmEV6l84tMY7NGE6uP3vsPQjbBxk8TtooIYP6yO2z1Z4mVVCUSRC-kcwV7Cb-BobKg=@jeandudey.tech
Hello Artyom,

Just a nitpick:

Toggle quote (3 lines)
>+ (description
>+ "@code{Qucs-S} provides a fancy graphical user interface for a number of

@code{Qucs-S} -> @acronym{Qucs-S, Quite universal circuit simulator with SPICE}

Toggle quote (3 lines)
>Yet at least Qucs-S will always use the right Octave/NGSpice path from
>GNU Guix.

If the substitute of the binaries path is only done on the `else' block then
the settings would be respected.

For example, on:


Toggle quote (8 lines)
> if(settings.contains("NgspiceExecutable")) QucsSettings.NgspiceExecutable = settings.value("NgspiceExecutable").toString();
> else {
> QString ngsp_exe = QCoreApplication::applicationDirPath() +
> QDir::separator() + "ngspice" + executableSuffix;
> if (!QFile::exists(ngsp_exe)) ngsp_exe = QString("ngspice") + executableSuffix;
> QucsSettings.NgspiceExecutable = ngsp_exe;
> }

Can be substituted to:

if(settings.contains("NgspiceExecutable")) QucsSettings.NgspiceExecutable = settings.value("NgspiceExecutable").toString();
else {
QString ngsp_exe = "/gnu/store/<substitute* used here>";
if (!QFile::exists(ngsp_exe)) ngsp_exe = QString("ngspice") + executableSuffix;
QucsSettings.NgspiceExecutable = ngsp_exe;
}

Then if `NgspiceExecutable' is present on the configuration that value will be used, otherwise the default
one provided by GNU Guix. Same applies for the other executable files.

Jean-Pierre De Jesus DIAZ
M
M
Maxime Devos wrote on 6 Aug 2022 13:42
(name . Artyom V. Poptsov)(address . poptsov.artyom@gmail.com)(address . 56768@debbugs.gnu.org)
72ecfa9d-33f0-7074-33da-ddde61d99ade@telenet.be
On 30-07-2022 08:59, Artyom V. Poptsov wrote:
Toggle quote (9 lines)
>> ... as you have observed, things work even when they aren't propagated
>> (at least for qtbase etc., ngspice and octave have not yet been
>> tested).
> I usually put into "propagated-inputs" packages that provide some binary
> that the current package use in the runtime.
>
> So do you mean that I should rely only on "inputs" package property, and
> the inputs will be propagated anyway if they're in use by the package?
>
Yes to the first (at least in this case, propagation is sometimes hard
to avoid), no to the second. Propagation happens only for
propagated-inputs; however, if they are 'in use' by the package by
ending up in the references, then the GC won't remove the store items.
The GC and propagation are independent mechanisms.
Toggle quote (5 lines)
> Less experimentally, the propagated- in propagated-inputs means only
> that: propagation -- the dependencies are still installed even if they
> aren't propagated, because the substitute* inserts a reference so the
> GC knows to not delete it, the only difference is that the dependency
> isn't automatically put in the profile when not propagating.
Here, I meant with 'installed' = entry in /gnu/store is downloaded or
built and kept, not 'added to ~/.guix-profile or equivalent' -- the
latter is propagation.
Toggle quote (20 lines)
> So the next time Qucs-S run it gets the paths from the configuration
> file.
>
> I changed the substitutions so Qucs-S will ignore the paths to Octave
> and NGSpice from the configuration and will always use the paths
> provided by Guix. Also any custom paths to Octave and NGSpice will be
> overwritten in the config when the application exits.
>
> That is sub-optimal in my view as we're messing up with the application
> configuration logic and if a user wants to change those paths he or she
> will be able to remove the config and set the paths in the startup
> configuration dialogue, but the settings will have no effect; that will
> be a bit confusing.
>
> Yet at least Qucs-S will always use the right Octave/NGSpice path from
> GNU Guix.
>
> What do you think?
>
> Here's the patch.
It's not ideal that the ngspice cannot be overridden in the
configuration, but OTOH we have --with-input. I think it's acceptable,
though if there are any users that would like to override in the
configuration, we might need to propagate it again and remove the
substitute* -- or better, though more work: patch qucs-s to use the
configuration when explicitly set by the user and don't write
/gnu/store/... inside it automatically, with /gnu/store/... as a
fallback when it is not set.
Greetings,
Maxime.
Attachment: OpenPGP_signature
A
A
Artyom V. Poptsov wrote on 4 Sep 2022 18:00
Re: [PATCH] gnu: engineering: Add qucs-s.
(address . guix-patches@gnu.org)
874jxn3z9i.fsf@gmail.com
Hello,

I rebased my patch to the Guix "master" branch.
From a295af73d7946b5fcfdd50c75556b1ee682ab32c Mon Sep 17 00:00:00 2001
From: "Artyom V. Poptsov" <poptsov.artyom@gmail.com>
Date: Mon, 25 Jul 2022 22:57:14 +0300
Subject: [PATCH] gnu: Add qucs-s.

* gnu/packages/engineering.scm (qucs-s): New variable.
---
gnu/packages/engineering.scm | 48 ++++++++++++++++++++++++++++++++++++
1 file changed, 48 insertions(+)

Toggle diff (58 lines)
diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
index f195179413..5123c4a615 100644
--- a/gnu/packages/engineering.scm
+++ b/gnu/packages/engineering.scm
@@ -3813,3 +3813,51 @@ (define-public rizin
;; GPL-2.0-only, GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.0-or-later,
;; LGPL-2.1-only, LGPL-2.1-or-later, LGPL-3.0-only, MIT, NCSA.
(license license:gpl3+)))
+
+(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 cmake-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"
+ (("QucsSettings.NgspiceExecutable = .*;")
+ (string-append
+ "QucsSettings.NgspiceExecutable = \""
+ (search-input-file inputs "/bin/ngspice")
+ "\";"))
+ (("QucsSettings.OctaveExecutable = .*;")
+ (string-append
+ "QucsSettings.OctaveExecutable = \""
+ (search-input-file inputs "/bin/octave") "\";"))))))))
+ (synopsis "GUI for different circuit simulation kernels")
+ (description
+ "@code{Qucs-S} provides a fancy 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+)))
--
2.34.1
- Artyom

--
Artyom "avp" Poptsov <poptsov.artyom@gmail.com>
CADR Hackerspace co-founder: https://cadrspace.ru/
GPG: D0C2 EAC1 3310 822D 98DE B57C E9C5 A2D9 0898 A02F
-----BEGIN PGP SIGNATURE-----

iQFNBAEBCgA3FiEE0MLqwTMQgi2Y3rV86cWi2QiYoC8FAmMUy7kZHHBvcHRzb3Yu
YXJ0eW9tQGdtYWlsLmNvbQAKCRDpxaLZCJigLwPRB/44Vy/xGfavxSmipS7us02V
PRWXJWeLnmz7zStXrpjYUCJEHun+hh6J2G0rGprBoGm7sEXOJXf2/T4rx76t1f4V
4avd/Ek9IHvWFsARbzka399OL0SpJamVyQRxYF6McGj/NTf+VKnAxntvxwrKWbYA
OCkPDCbsMbPTxt6qtR2xxRr0GpqLYWhszg16cX0EJBgC7FjJQOmDF/WPr/NEmhzW
bAMCAj+DIUdDA3CUs8LQdt15nvHveXEhmBE1L9CI+bHxyTQCZppTP4OljsXoo3vq
QlLmmDdtfhWFV6eYHDhRr7/8MHIwH/0F6FHk5BFAAUteVqxIOJAJ9/yYxE4xrs6u
=u7Tg
-----END PGP SIGNATURE-----

?