update to ngspice 45.2 (#23283)

* update to ngspice 44.2

* curses not runtime dependent

* ngspice: enable osdi

Enabling osdi, allows for ngspice to simulate pdks like the IHP130pdk, https://github.com/IHP-GmbH/IHP-Open-PDK

* Update ngspice version to 45.2 in PKGBUILD

* Ngspice2osdi (#10)

* test

* ngspice 45.2

* Fix LDFLAGS syntax for clang in PKGBUILD

* Remove illegal specialization for compilation

* Update sha256sum for a package in PKGBUILD
This commit is contained in:
Kreijstal 2025-09-13 09:55:11 +02:00 committed by GitHub
parent b887c4e703
commit f4d44a6f9a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 157 additions and 9 deletions

View File

@ -0,0 +1,56 @@
From f37a14fd0fcc1000624e78a463c439b778e772b5 Mon Sep 17 00:00:00 2001
From: kreijstal <rainb@tfwno.gf>
Date: Tue, 9 Sep 2025 07:50:51 +0200
Subject: [PATCH] Remove illegal specialization for compilation on clang on
windows
---
src/include/cppduals/duals/dual | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/src/include/cppduals/duals/dual b/src/include/cppduals/duals/dual
index 4cb227e84..25529445d 100644
--- a/src/include/cppduals/duals/dual
+++ b/src/include/cppduals/duals/dual
@@ -485,9 +485,6 @@ struct is_arithmetic<duals::dual<T>> : is_arithmetic<T> {};
#endif // CPPDUALS_ENABLE_IS_ARITHMETIC
-/// Duals are compound types.
-template <class T>
-struct is_compound<duals::dual<T>> : true_type {};
// Modification of std::numeric_limits<> per
// C++03 17.4.3.1/1, and C++11 18.3.2.3/1.
@@ -693,14 +690,12 @@ template <class T> std::complex<T> dpart(const std::complex<dual<T>> & x)
/// Get a non-dual's real part.
template <class T,
- CPPDUALS_ENABLE_IF((std::is_arithmetic<T>::value &&
- !std::is_compound<T>::value) || is_complex<T>::value)>
+ CPPDUALS_ENABLE_IF(std::is_arithmetic<T>::value || is_complex<T>::value)>
T rpart(const T & x) { return x; }
/// Get a non-dual's dual part := zero.
template <class T,
- CPPDUALS_ENABLE_IF((std::is_arithmetic<T>::value &&
- !std::is_compound<T>::value) || is_complex<T>::value)>
+ CPPDUALS_ENABLE_IF(std::is_arithmetic<T>::value || is_complex<T>::value)>
T dpart(const T & ) { return T(0); }
#ifndef PARSED_BY_DOXYGEN
diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c
index 71a3bdeaf..3ab9228da 100644
--- a/src/frontend/inpcom.c
+++ b/src/frontend/inpcom.c
@@ -33,6 +33,7 @@ Author: 1985 Wayne A. Christopher
#include <limits.h>
#include <stdlib.h>
+#include <errno.h>
#include <sys/stat.h>
#include <sys/types.h>
--
2.51.0

View File

@ -0,0 +1,40 @@
diff --git a/configure.ac b/configure.ac
index f97a93ea6..232fa7ac1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1280,6 +1280,20 @@ else
AC_CHECK_LIB([readline], [readline],
[LIBS="$LIBS -lreadline"],
[AC_MSG_ERROR([Couldn't find readline libraries.])])
+
+PKG_CHECK_MODULES_STATIC([NCURSES], [ncursesw], [
+ AC_SUBST([CURSES_CFLAGS], ["$NCURSES_CFLAGS"])
+ AC_SUBST([CURSES_LIBS], ["$NCURSES_LIBS"])
+ AC_DEFINE([HAVE_CURSES_H], [1], [Define if curses.h is available])
+
+ # Force the compiler to use the ncursesw include path for all subsequent checks
+ CPPFLAGS="$CPPFLAGS $NCURSES_CFLAGS"
+])
+
+AC_CHECK_HEADERS([curses.h], [], [
+ AC_MSG_WARN([curses.h not found, but ncurses/curses.h is available.])
+])
+
fi
else
# Especially defined for macOS (Big Sur), with readline installed from Brew
diff --git a/src/xspice/verilog/Makefile.am b/src/xspice/verilog/Makefile.am
index 262d63384..1a298cff0 100644
--- a/src/xspice/verilog/Makefile.am
+++ b/src/xspice/verilog/Makefile.am
@@ -45,7 +45,9 @@
install-exec-hook:
cd $(DESTDIR)$(pkglibdir); \
rm -f ivlng*a libvvp* ; \
- mv ivlngvpi.* ivlng.vpi
+ if [ -f ivlngvpi.* ]; then \
+ mv ivlngvpi.* ivlng.vpi; \
+ fi
uninstall-hook:
rm -f $(DESTDIR)$(pkglibdir)/ivlng.vpi $(DESTDIR)$(pkglibdir)/ivlng.so

View File

@ -4,7 +4,7 @@
_realname=ngspice
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=42
pkgver=45.2
pkgrel=1
pkgdesc="Mixed-level/Mixed-signal circuit simulator based on Spice3f5, Cider1b1, and Xspice (mingw-w64)"
arch=('any')
@ -24,9 +24,11 @@ depends=(
"${MINGW_PACKAGE_PREFIX}-fftw"
"${MINGW_PACKAGE_PREFIX}-cc-libs"
"${MINGW_PACKAGE_PREFIX}-omp"
"${MINGW_PACKAGE_PREFIX}-readline"
)
makedepends=(
"${MINGW_PACKAGE_PREFIX}-cc"
"${MINGW_PACKAGE_PREFIX}-ncurses"
"${MINGW_PACKAGE_PREFIX}-autotools"
)
install="${_realname}-${MSYSTEM}.install"
@ -34,14 +36,22 @@ source=(
"https://downloads.sourceforge.net/project/${_realname}/ng-spice-rework/${pkgver}/${_realname}-${pkgver}.tar.gz"
"https://downloads.sourceforge.net/project/${_realname}/ng-spice-rework/${pkgver}/${_realname}-doc-${pkgver}.tar.gz"
"no-explicit-lstdc++.patch"
"0001-Remove-illegal-specialization-for-compilation-on-cla.patch"
"0002-curses.patch"
)
sha256sums=('737fe3846ab2333a250dfadf1ed6ebe1860af1d8a5ff5e7803c772cc4256e50a'
'bb971b1553d2ab19a9188f00fa14eb84b24bff6d1fbe0a7e16ffa1147ce6a9a4'
'57f0f6e79faead15b0e1338a32c414b851997edb716467e8c0bc9a10df423582')
sha256sums=('ba8345f4c3774714c10f33d7da850d361cec7d14b3a295d0dc9fd96f7423812d'
'f4c056b3a3617b001e0fa85ffef7eb3797a7b5e3b0a8d18fc4a29707042a9fa7'
'57f0f6e79faead15b0e1338a32c414b851997edb716467e8c0bc9a10df423582'
'e04db285506f2f3b0e07794f2c5127bcf6427eabef3686f6c6298dcc526b12a6'
'6cf7f34df2d829008b6cc14dfcce70c0426f340fa9bcae93613f71c8c97aa2f5')
prepare() {
cd "${srcdir}/${_realname}-${pkgver}"
patch -Np1 -i "${srcdir}/no-explicit-lstdc++.patch"
patch -Np1 -i "${srcdir}/0001-Remove-illegal-specialization-for-compilation-on-cla.patch"
patch -Np1 -i "${srcdir}/0002-curses.patch"
autoreconf -fiv
}
@ -56,13 +66,15 @@ build() {
--enable-openmp
--enable-xspice
--enable-cider
--enable-osdi
--without-x
)
# FS#45230, create so lib
# shared lib sets flags and modifies headers, needs dedicated pass
# adding --with-readline disables libngspice-0.dll
if [[ ${MINGW_PACKAGE_PREFIX} == *-clang-* ]]; then
LDFLAGS+=" -lomp"
LDFLAGS+=" -lomp --no-undefined"
fi
../${_realname}-${pkgver}/configure \
--prefix=${MINGW_PREFIX} \
@ -70,7 +82,7 @@ build() {
--host=${MINGW_CHOST} \
"${_common_flags[@]}" \
--with-ngshared
make
make
mkdir -p "${srcdir}/build-static-${MSYSTEM}" && cd "${srcdir}/build-static-${MSYSTEM}"
@ -79,14 +91,14 @@ build() {
../${_realname}-${pkgver}/configure \
"${_common_flags[@]}" \
--with-wingui
make
make
mkdir -p "${srcdir}/build-console-${MSYSTEM}" && cd "${srcdir}/build-console-${MSYSTEM}"
LDFLAGS+=" -lgdi32"
../${_realname}-${pkgver}/configure \
"${_common_flags[@]}"
make
"${_common_flags[@]}"
make
}
package() {

View File

@ -0,0 +1,40 @@
diff --git a/configure.ac b/configure.ac
index f97a93ea6..232fa7ac1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1280,6 +1280,20 @@ else
AC_CHECK_LIB([readline], [readline],
[LIBS="$LIBS -lreadline"],
[AC_MSG_ERROR([Couldn't find readline libraries.])])
+
+PKG_CHECK_MODULES_STATIC([NCURSES], [ncursesw], [
+ AC_SUBST([CURSES_CFLAGS], ["$NCURSES_CFLAGS"])
+ AC_SUBST([CURSES_LIBS], ["$NCURSES_LIBS"])
+ AC_DEFINE([HAVE_CURSES_H], [1], [Define if curses.h is available])
+
+ # Force the compiler to use the ncursesw include path for all subsequent checks
+ CPPFLAGS="$CPPFLAGS $NCURSES_CFLAGS"
+])
+
+AC_CHECK_HEADERS([curses.h], [], [
+ AC_MSG_WARN([curses.h not found, but ncurses/curses.h is available.])
+])
+
fi
else
# Especially defined for macOS (Big Sur), with readline installed from Brew
diff --git a/src/xspice/verilog/Makefile.am b/src/xspice/verilog/Makefile.am
index 262d63384..1a298cff0 100644
--- a/src/xspice/verilog/Makefile.am
+++ b/src/xspice/verilog/Makefile.am
@@ -45,7 +45,9 @@
install-exec-hook:
cd $(DESTDIR)$(pkglibdir); \
rm -f ivlng*a libvvp* ; \
- mv ivlngvpi.* ivlng.vpi
+ if [ -f ivlngvpi.* ]; then \
+ mv ivlngvpi.* ivlng.vpi; \
+ fi
uninstall-hook:
rm -f $(DESTDIR)$(pkglibdir)/ivlng.vpi $(DESTDIR)$(pkglibdir)/ivlng.so