git: 8241f67b4f59 - main - cad/qucs-s: Add NGSPICE and QUCSATOR options

From: Yuri Victorovich <yuri_at_FreeBSD.org>
Date: Sat, 09 Jul 2022 20:23:20 UTC
The branch main has been updated by yuri:

URL: https://cgit.FreeBSD.org/ports/commit/?id=8241f67b4f592d847ec7d99c92d87ff0d479a074

commit 8241f67b4f592d847ec7d99c92d87ff0d479a074
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2022-07-09 20:22:25 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2022-07-09 20:23:18 +0000

    cad/qucs-s: Add NGSPICE and QUCSATOR options
---
 cad/qucs-s/Makefile                  | 19 +++++++++++++------
 cad/qucs-s/files/patch-qucs_main.cpp | 13 +++++++++++++
 2 files changed, 26 insertions(+), 6 deletions(-)

diff --git a/cad/qucs-s/Makefile b/cad/qucs-s/Makefile
index 712c8dcdac25..b55be84a0e8c 100644
--- a/cad/qucs-s/Makefile
+++ b/cad/qucs-s/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	qucs-s
 DISTVERSION=	0.0.24
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	cad
 
 MAINTAINER=	yuri@FreeBSD.org
@@ -9,8 +9,7 @@ COMMENT=	Quite Universal Circuit Simulator: GUI for circuit simulation kernels
 LICENSE=	GPLv2
 LICENSE_FILE=	${WRKSRC}/COPYING
 
-RUN_DEPENDS=	ngspice:cad/ngspice_rework \
-		octave:math/octave
+RUN_DEPENDS=	octave:math/octave
 
 USES=		cmake qt:5
 USE_QT=		core gui printsupport svg widgets buildtools_build linguisttools_build qmake_build
@@ -20,12 +19,20 @@ GH_ACCOUNT=	ra3xdh
 GH_PROJECT=	qucs_s
 
 OPTIONS_GROUP=		BACKENDS
-OPTIONS_GROUP_BACKENDS=	XYCE
+OPTIONS_GROUP_BACKENDS=	NGSPICE XYCE QUCSATOR
+OPTIONS_DEFAULT=	NGSPICE
 
-BACKENDS_DESC=		Additional backends (in addition to ngspice)
+BACKENDS_DESC=		Simulation backends
+
+NGSPICE_DESC=		ngspice mixed-signal circuit simulator
+NGSPICE_RUN_DEPENDS=	ngspice:cad/ngspice_rework
 
 XYCE_DESC=		Xyce electronic simulator
-XYCE_RUN_DEPENDS=	Xyce:cad/xyce
+XYCE_RUN_DEPENDS=	Xyce:cad/xyce \
+			mpich>0:net/mpich # mpich for the mpirun executable
+
+QUCSATOR_DESC=		Circuit simulator of the Qucs project
+QUCSATOR_RUN_DEPENDS=	qucsator:cad/qucsator
 
 post-patch:
 	# first the patch under files/ introduces %%PREFIX%%, and now we fix it here
diff --git a/cad/qucs-s/files/patch-qucs_main.cpp b/cad/qucs-s/files/patch-qucs_main.cpp
index e30cdf8d7d3f..ffe058a7dcb9 100644
--- a/cad/qucs-s/files/patch-qucs_main.cpp
+++ b/cad/qucs-s/files/patch-qucs_main.cpp
@@ -2,6 +2,19 @@
 
 --- qucs/main.cpp.orig	2022-06-30 18:34:40 UTC
 +++ qucs/main.cpp
+@@ -114,10 +114,10 @@ bool loadSettings()
+         if (QucsSettings.Qucsconv.isEmpty())
+             QucsSettings.Qucsconv = QucsSettings.QucsatorDir + QDir::separator() + "qucsconv" + executableSuffix;
+     } else {
+-        QucsSettings.Qucsator = QucsSettings.BinDir + "qucsator" + executableSuffix;
++        QucsSettings.Qucsator = "%%PREFIX%%/bin/qucsator";
+         QucsSettings.QucsatorDir = QucsSettings.BinDir;
+         if (QucsSettings.Qucsconv.isEmpty())
+-            QucsSettings.Qucsconv = QucsSettings.BinDir + "qucsconv" + executableSuffix;
++            QucsSettings.Qucsconv = "%%PREFIX%%/bin/qucsconv";
+     }
+     //if(settings.contains("BinDir"))QucsSettings.BinDir = settings.value("BinDir").toString();
+     //if(settings.contains("LangDir"))QucsSettings.LangDir = settings.value("LangDir").toString();
 @@ -139,13 +139,13 @@ bool loadSettings()
  #ifdef Q_OS_WIN
          QucsSettings.XyceExecutable = "Xyce.exe";