From patchwork Sat Jul 30 06:59:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Artyom V. Poptsov" X-Patchwork-Id: 41058 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 4EF8027BBEA; Sat, 30 Jul 2022 08:01:32 +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=-2.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable 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 76F5127BBE9 for ; Sat, 30 Jul 2022 08:01:31 +0100 (BST) Received: from localhost ([::1]:39340 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oHgTa-0002h3-FX for patchwork@mira.cbaines.net; Sat, 30 Jul 2022 03:01:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43660) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oHgSA-0002g6-Tn for guix-patches@gnu.org; Sat, 30 Jul 2022 03:00:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:44165) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oHgSA-00040Q-Jx for guix-patches@gnu.org; Sat, 30 Jul 2022 03:00:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oHgSA-0003CA-Fz for guix-patches@gnu.org; Sat, 30 Jul 2022 03:00:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#56768] [PATCH] gnu: engineering: Add qucs-s. Resent-From: "Artyom V. Poptsov" Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 30 Jul 2022 07:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56768 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxime Devos Cc: 56768@debbugs.gnu.org Received: via spool by 56768-submit@debbugs.gnu.org id=B56768.165916437712220 (code B ref 56768); Sat, 30 Jul 2022 07:00:02 +0000 Received: (at 56768) by debbugs.gnu.org; 30 Jul 2022 06:59:37 +0000 Received: from localhost ([127.0.0.1]:33914 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oHgRl-0003B1-0a for submit@debbugs.gnu.org; Sat, 30 Jul 2022 02:59:37 -0400 Received: from mail-lf1-f47.google.com ([209.85.167.47]:35806) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oHgRh-0003Am-LQ for 56768@debbugs.gnu.org; Sat, 30 Jul 2022 02:59:35 -0400 Received: by mail-lf1-f47.google.com with SMTP id z25so10174109lfr.2 for <56768@debbugs.gnu.org>; Fri, 29 Jul 2022 23:59:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:from:to:cc; bh=sCmF2redqzea2Vy4JTYfwdCPZOzpFz7kgBoaF3shGOw=; b=jk4ysX6AY+oyqt1RKvG5xC5JSbKaO0WlUAN//7yuPD8vG6+aA07jaeFqt6eyJX8ynh TTAq6Vfa6dH3e0b7WHCJf0st7niMW77In2/Uto8x4LfD4ymRcKCSrf/Y1ca631dRK3FG Go2udoLBHGRiXXyWYRfcXONCV8eTZR6oa5e75g7yURFCXgztAtaStJvg2qIyG+10Q6dV M9+3pWRJmRDb9LpDV9+agyGVbaqKAiAP3d4ktYVOsOyk5BJASdytbmDgIb0/2VKyud9k uocmM6HSk2XUfCMJvFf6BL4kIT/PHWwCyAm4TD+/W/tRy9O8Fq4q3nERA6LTKcv36bB7 Tx7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc; bh=sCmF2redqzea2Vy4JTYfwdCPZOzpFz7kgBoaF3shGOw=; b=PecNQod9Wf11LBlwUXf7N4P5rxF+KO0pJDY2ON5QeJjbHW2OttWcsd94fIQverHlti hSY2sZbGf5EZnbYo4VrjE0CpLPC/VKr2Ai/VL/APPQl/6LAWFAgkxlI3BbGyqkYCrQ0H o+mnrPuBAywIO1XIWdPa4vBkLNIQ8RPJVAEurHgC1gUAHRBJ8qDZWUFxbYq5n9EDcjXd rFKLx7fqKSBFIoRRUiLLNEEUkhaCF0MmMsB6w++evIj7SqTSvv/SCpF3YDG9J4CBr+xv ZDXtqpOX1KQkqtWyl1G3+XQbFlBvkhgTTLH55y48kc4AtxHmKYuho1DK8kfYbfrD3Nra KgBQ== X-Gm-Message-State: AJIora/AeesYtMi6XO/72fqx1sI93wjb3r9Rf4RHf5cNwm2z53K6IJPK K2wPy96D7kYcI9mM0oHUJlnyOunUM7AyZA== X-Google-Smtp-Source: AGRyM1teo1B8sdY65VhO33xBW1ZIXBInnqnWLYEjVFHvyiKiQXMTO5Lfpm5tEdGttQUzH8gicKMUig== X-Received: by 2002:a05:6512:4011:b0:48a:82ca:ed8a with SMTP id br17-20020a056512401100b0048a82caed8amr2486594lfb.190.1659164366652; Fri, 29 Jul 2022 23:59:26 -0700 (PDT) Received: from elephant ([5.164.203.220]) by smtp.gmail.com with ESMTPSA id k1-20020ac257c1000000b0048a9526c7d9sm858582lfo.257.2022.07.29.23.59.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Jul 2022 23:59:26 -0700 (PDT) From: "Artyom V. Poptsov" References: <87ilnlgduf.fsf@gmail.com> <87fsik0wjm.fsf@gmail.com> Date: Sat, 30 Jul 2022 09:59:21 +0300 In-Reply-To: (Maxime Devos's message of "Fri, 29 Jul 2022 18:17:30 +0200") Message-ID: <87v8rfxf06.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Hello Maxime. > 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. > 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 > (*) and makes in some > cases --with-input more usable. That blog post also has en example. Done. > 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? > 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. > 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: --8<---------------cut here---------------start------------->8--- $ cat ~/.config/qucs/qucs_s.conf [General] ... NgspiceExecutable=/gnu/store/jl159ilvjzxd0i45xf2z8llbhvl10w54-ngspice-37/bin/ngspice ... --8<---------------cut here---------------end--------------->8--- 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. Thanks, - Artyom From 9888a6b0169bd3b9f158749f164b2fb1ebd5603a Mon Sep 17 00:00:00 2001 From: "Artyom V. Poptsov" 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(+) 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