mirror of
https://https.git.savannah.gnu.org/git/guix.git/
synced 2025-07-12 01:50:46 +02:00
* gnu/packages/engineering.scm (qucs-s): Update to 24.4.1. Apply patch. [build-system]: Switch to qt-build-system. [arguments] <qtbase, configure-flags>: New arguments. <phases>: Replace patch phase with adjust-default-settings one. [native-inputs]: Replace qttools-5 with qttools. [inputs]: Replace qtbase-5 with qtbase, qtcharts-5 with qtcharts and qtsvg-5 with qtsvg. Add qtwayland. * gnu/packages/patches/qucs-s-qucsator-rf-search.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. Change-Id: I2afc90fa9f69935301819d8ad4e912a076205c30
163 lines
6.8 KiB
Diff
163 lines
6.8 KiB
Diff
From eb3aad2452ea6a69c22e25182fdaf5b98549758f Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Muhammet=20=C5=9E=C3=BCkr=C3=BC=20Demir?=
|
|
<41967334+dsm@users.noreply.github.com>
|
|
Date: Sat, 7 Dec 2024 20:08:02 +0300
|
|
Subject: [PATCH] fix ngspice and qucsator_rf path search.
|
|
|
|
---
|
|
qucs/main.cpp | 8 +++---
|
|
qucs/qucs.cpp | 75 ++++++++++++++++++++++++++++++++-------------------
|
|
2 files changed, 52 insertions(+), 31 deletions(-)
|
|
|
|
diff --git a/qucs/main.cpp b/qucs/main.cpp
|
|
index 287cd5b83..a015a7687 100644
|
|
--- a/qucs/main.cpp
|
|
+++ b/qucs/main.cpp
|
|
@@ -106,12 +106,12 @@ bool loadSettings()
|
|
QFileInfo inf(QucsSettings.Qucsator);
|
|
QucsSettings.QucsatorDir = inf.canonicalPath() + QDir::separator();
|
|
if (QucsSettings.Qucsconv.isEmpty())
|
|
- QucsSettings.Qucsconv = QucsSettings.QucsatorDir + QDir::separator() + "qucsconv_rf" + executableSuffix;
|
|
+ QucsSettings.Qucsconv = QStandardPaths::findExecutable("qucsconv_rf",{QucsSettings.QucsatorDir});
|
|
} else {
|
|
- QucsSettings.Qucsator = QucsSettings.BinDir + "qucsator_rf" + executableSuffix;
|
|
+ QucsSettings.Qucsator = QStandardPaths::findExecutable("qucsator_rf",{QucsSettings.BinDir});
|
|
QucsSettings.QucsatorDir = QucsSettings.BinDir;
|
|
if (QucsSettings.Qucsconv.isEmpty())
|
|
- QucsSettings.Qucsconv = QucsSettings.BinDir + "qucsconv_rf" + executableSuffix;
|
|
+ QucsSettings.Qucsconv = QStandardPaths::findExecutable("qucsconv_rf",{QucsSettings.BinDir});
|
|
}
|
|
|
|
QucsSettings.AdmsXmlBinDir.setPath(_settings::Get().item<QString>("AdmsXmlBinDir"));
|
|
@@ -798,7 +798,7 @@ int main(int argc, char *argv[])
|
|
QucsDir.cdUp();
|
|
#endif
|
|
|
|
- QucsSettings.BinDir = QucsDir.absolutePath() + "/bin/";
|
|
+ QucsSettings.BinDir = QucsApplicationPath.contains("bin") ? QucsApplicationPath : QucsDir.absoluteFilePath("bin");
|
|
QucsSettings.LangDir = QucsDir.canonicalPath() + "/share/" QUCS_NAME "/lang/";
|
|
|
|
QucsSettings.LibDir = QucsDir.canonicalPath() + "/share/" QUCS_NAME "/library/";
|
|
diff --git a/qucs/qucs.cpp b/qucs/qucs.cpp
|
|
index 07d0eb4f4..e78479b53 100644
|
|
--- a/qucs/qucs.cpp
|
|
+++ b/qucs/qucs.cpp
|
|
@@ -156,8 +156,8 @@ QucsApp::QucsApp()
|
|
|
|
select->setChecked(true); // switch on the 'select' action
|
|
switchSchematicDoc(true); // "untitled" document is schematic
|
|
-
|
|
- lastExportFilename = QDir::homePath() + QDir::separator() + "export.png";
|
|
+ QDir homeDir = QDir::homePath();
|
|
+ lastExportFilename = homeDir.absoluteFilePath("export.png");
|
|
|
|
// load documents given as command line arguments
|
|
for(int z=1; z<qApp->arguments().size(); z++) {
|
|
@@ -172,42 +172,54 @@ QucsApp::QucsApp()
|
|
}
|
|
}
|
|
|
|
+ QDir QucsBinDir(QucsSettings.BinDir);
|
|
if (QucsSettings.firstRun) { // try to find Ngspice
|
|
+ QString ngspice_exe_name = "ngspice";
|
|
#ifdef Q_OS_WIN
|
|
- QString ngspice_exe1 = QucsSettings.BinDir + QDir::separator() + "ngspice_con.exe";
|
|
- QString ngspice_exe2 = "C:\\Spice64\\bin\\ngspice_con.exe";
|
|
- QString qucsator_exe = QucsSettings.BinDir + QDir::separator() + "qucsator_rf.exe";
|
|
-#else
|
|
- QString ngspice_exe1 = QucsSettings.BinDir + QDir::separator() + "ngspice";
|
|
- QString qucsator_exe = QucsSettings.BinDir + QDir::separator() + "qucsator_rf";
|
|
+ ngspice_exe_name+="_con";
|
|
#endif
|
|
+ /* search own path */
|
|
+ QString ngspice_exe1 = QStandardPaths::findExecutable(ngspice_exe_name,{QucsBinDir.absolutePath()});
|
|
+ /* search system path */
|
|
+ QString ngspice_exe2 = QStandardPaths::findExecutable(ngspice_exe_name);
|
|
+
|
|
+ /* search own path */
|
|
+ QString qucsator_exe1 = QStandardPaths::findExecutable("qucsator_rf",{QucsBinDir.absolutePath()});
|
|
+ /* search system path */
|
|
+ QString qucsator_exe2 = QStandardPaths::findExecutable("qucsator_rf");
|
|
+
|
|
QString ngspice_exe;
|
|
bool ngspice_found = false;
|
|
- if (QFile::exists(ngspice_exe1)) {
|
|
+ if(!ngspice_exe1.isEmpty()){
|
|
ngspice_found = true;
|
|
ngspice_exe = ngspice_exe1;
|
|
+ }else if(!ngspice_exe2.isEmpty()){
|
|
+ ngspice_found = true;
|
|
+ ngspice_exe = ngspice_exe2;
|
|
}
|
|
+
|
|
+ QString qucsator_exe;
|
|
bool qucsator_found = false;
|
|
- if (QFile::exists(qucsator_exe)) {
|
|
+ if(!qucsator_exe1.isEmpty()){
|
|
qucsator_found = true;
|
|
- QucsSettings.Qucsator = qucsator_exe;
|
|
- }
|
|
-#ifdef Q_OS_WIN
|
|
- if (!ngspice_found && QFile::exists(ngspice_exe2)) {
|
|
- ngspice_found = true;
|
|
- ngspice_exe = ngspice_exe2;
|
|
+ qucsator_exe = qucsator_exe1;
|
|
+ }else if(!qucsator_exe2.isEmpty()){
|
|
+ qucsator_found = true;
|
|
+ qucsator_exe = qucsator_exe2;
|
|
}
|
|
-#endif
|
|
- ngspice_exe = QDir::toNativeSeparators(ngspice_exe);
|
|
+
|
|
QString info_string;
|
|
if (ngspice_found) {
|
|
- QucsSettings.DefaultSimulator = spicecompat::simNgspice;
|
|
+ QucsSettings.DefaultSimulator = spicecompat::simNgspice;
|
|
QucsSettings.NgspiceExecutable = ngspice_exe;
|
|
info_string += tr("Ngspice found at: ") + ngspice_exe + "\n";
|
|
}
|
|
- if (qucsator_found) {
|
|
+
|
|
+ if(qucsator_found){
|
|
+ QucsSettings.Qucsator = qucsator_exe;
|
|
info_string += tr("QucsatorRF found at: ") + qucsator_exe + "\n";
|
|
}
|
|
+
|
|
info_string += tr("\nYou can specify another location later"
|
|
" using Simulation->Simulators Setings\n");
|
|
if (!ngspice_found && qucsator_found) {
|
|
@@ -220,18 +232,27 @@ QucsApp::QucsApp()
|
|
QMessageBox::information(nullptr,tr("Set simulator"), info_string);
|
|
fillSimulatorsComboBox();
|
|
} else {
|
|
+#ifdef Q_OS_WIN
|
|
+ QucsSettings.NgspiceExecutable = "ngspice_con.exe";
|
|
+ QucsSettings.Qucsator = "qucsator_rf.exe";
|
|
+#else
|
|
+ QucsSettings.NgspiceExecutable = "ngspice";
|
|
+ QucsSettings.Qucsator = "qucsator_rf";
|
|
+#endif
|
|
QMessageBox::information(this,tr("Qucs"),tr("No simulators found automatically. Please specify simulators"
|
|
" in the next dialog window."));
|
|
slotSimSettings();
|
|
}
|
|
QucsSettings.firstRun = false;
|
|
- } else if (!QFile::exists(QucsSettings.Qucsator)) {
|
|
- QucsSettings.Qucsator = QucsSettings.BinDir + QDir::separator() + "qucsator_rf";
|
|
-#ifdef Q_OS_WIN
|
|
- QucsSettings.Qucsator += ".exe";
|
|
-#endif
|
|
- QMessageBox::information(this, "Qucs",
|
|
- tr("QucsatorRF found at: ") + QucsSettings.Qucsator + "\n");
|
|
+ } else {
|
|
+ if (!QucsSettings.Qucsator.contains("qucsator_rf")) {
|
|
+ QucsSettings.Qucsator = QStandardPaths::findExecutable("qucsator_rf",{QucsBinDir.absolutePath()});
|
|
+
|
|
+ if(!QucsSettings.Qucsator.isEmpty()){
|
|
+ QMessageBox::information(this, "Qucs",
|
|
+ tr("QucsatorRF found at: ") + QucsSettings.Qucsator + "\n");
|
|
+ }
|
|
+ }
|
|
}
|
|
|
|
// fillLibrariesTreeView();
|