Skip to content

Commit d9d6d69

Browse files
KreijstalMehdiChinoune
authored andcommitted
update to ngspice 45.2 (msys2#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
1 parent dde8827 commit d9d6d69

File tree

4 files changed

+157
-9
lines changed

4 files changed

+157
-9
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
From f37a14fd0fcc1000624e78a463c439b778e772b5 Mon Sep 17 00:00:00 2001
2+
From: kreijstal <[email protected]>
3+
Date: Tue, 9 Sep 2025 07:50:51 +0200
4+
Subject: [PATCH] Remove illegal specialization for compilation on clang on
5+
windows
6+
7+
---
8+
src/include/cppduals/duals/dual | 9 ++-------
9+
1 file changed, 2 insertions(+), 7 deletions(-)
10+
11+
diff --git a/src/include/cppduals/duals/dual b/src/include/cppduals/duals/dual
12+
index 4cb227e84..25529445d 100644
13+
--- a/src/include/cppduals/duals/dual
14+
+++ b/src/include/cppduals/duals/dual
15+
@@ -485,9 +485,6 @@ struct is_arithmetic<duals::dual<T>> : is_arithmetic<T> {};
16+
17+
#endif // CPPDUALS_ENABLE_IS_ARITHMETIC
18+
19+
-/// Duals are compound types.
20+
-template <class T>
21+
-struct is_compound<duals::dual<T>> : true_type {};
22+
23+
// Modification of std::numeric_limits<> per
24+
// C++03 17.4.3.1/1, and C++11 18.3.2.3/1.
25+
@@ -693,14 +690,12 @@ template <class T> std::complex<T> dpart(const std::complex<dual<T>> & x)
26+
27+
/// Get a non-dual's real part.
28+
template <class T,
29+
- CPPDUALS_ENABLE_IF((std::is_arithmetic<T>::value &&
30+
- !std::is_compound<T>::value) || is_complex<T>::value)>
31+
+ CPPDUALS_ENABLE_IF(std::is_arithmetic<T>::value || is_complex<T>::value)>
32+
T rpart(const T & x) { return x; }
33+
34+
/// Get a non-dual's dual part := zero.
35+
template <class T,
36+
- CPPDUALS_ENABLE_IF((std::is_arithmetic<T>::value &&
37+
- !std::is_compound<T>::value) || is_complex<T>::value)>
38+
+ CPPDUALS_ENABLE_IF(std::is_arithmetic<T>::value || is_complex<T>::value)>
39+
T dpart(const T & ) { return T(0); }
40+
41+
#ifndef PARSED_BY_DOXYGEN
42+
diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c
43+
index 71a3bdeaf..3ab9228da 100644
44+
--- a/src/frontend/inpcom.c
45+
+++ b/src/frontend/inpcom.c
46+
@@ -33,6 +33,7 @@ Author: 1985 Wayne A. Christopher
47+
48+
#include <limits.h>
49+
#include <stdlib.h>
50+
+#include <errno.h>
51+
52+
#include <sys/stat.h>
53+
#include <sys/types.h>
54+
--
55+
2.51.0
56+
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
diff --git a/configure.ac b/configure.ac
2+
index f97a93ea6..232fa7ac1 100644
3+
--- a/configure.ac
4+
+++ b/configure.ac
5+
@@ -1280,6 +1280,20 @@ else
6+
AC_CHECK_LIB([readline], [readline],
7+
[LIBS="$LIBS -lreadline"],
8+
[AC_MSG_ERROR([Couldn't find readline libraries.])])
9+
+
10+
+PKG_CHECK_MODULES_STATIC([NCURSES], [ncursesw], [
11+
+ AC_SUBST([CURSES_CFLAGS], ["$NCURSES_CFLAGS"])
12+
+ AC_SUBST([CURSES_LIBS], ["$NCURSES_LIBS"])
13+
+ AC_DEFINE([HAVE_CURSES_H], [1], [Define if curses.h is available])
14+
+
15+
+ # Force the compiler to use the ncursesw include path for all subsequent checks
16+
+ CPPFLAGS="$CPPFLAGS $NCURSES_CFLAGS"
17+
+])
18+
+
19+
+AC_CHECK_HEADERS([curses.h], [], [
20+
+ AC_MSG_WARN([curses.h not found, but ncurses/curses.h is available.])
21+
+])
22+
+
23+
fi
24+
else
25+
# Especially defined for macOS (Big Sur), with readline installed from Brew
26+
diff --git a/src/xspice/verilog/Makefile.am b/src/xspice/verilog/Makefile.am
27+
index 262d63384..1a298cff0 100644
28+
--- a/src/xspice/verilog/Makefile.am
29+
+++ b/src/xspice/verilog/Makefile.am
30+
@@ -45,7 +45,9 @@
31+
install-exec-hook:
32+
cd $(DESTDIR)$(pkglibdir); \
33+
rm -f ivlng*a libvvp* ; \
34+
- mv ivlngvpi.* ivlng.vpi
35+
+ if [ -f ivlngvpi.* ]; then \
36+
+ mv ivlngvpi.* ivlng.vpi; \
37+
+ fi
38+
39+
uninstall-hook:
40+
rm -f $(DESTDIR)$(pkglibdir)/ivlng.vpi $(DESTDIR)$(pkglibdir)/ivlng.so

mingw-w64-ngspice/PKGBUILD

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
_realname=ngspice
55
pkgbase=mingw-w64-${_realname}
66
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
7-
pkgver=42
7+
pkgver=45.2
88
pkgrel=1
99
pkgdesc="Mixed-level/Mixed-signal circuit simulator based on Spice3f5, Cider1b1, and Xspice (mingw-w64)"
1010
arch=('any')
@@ -24,24 +24,34 @@ depends=(
2424
"${MINGW_PACKAGE_PREFIX}-fftw"
2525
"${MINGW_PACKAGE_PREFIX}-cc-libs"
2626
"${MINGW_PACKAGE_PREFIX}-omp"
27+
"${MINGW_PACKAGE_PREFIX}-readline"
2728
)
2829
makedepends=(
2930
"${MINGW_PACKAGE_PREFIX}-cc"
31+
"${MINGW_PACKAGE_PREFIX}-ncurses"
3032
"${MINGW_PACKAGE_PREFIX}-autotools"
3133
)
3234
install="${_realname}-${MSYSTEM}.install"
3335
source=(
3436
"https://downloads.sourceforge.net/project/${_realname}/ng-spice-rework/${pkgver}/${_realname}-${pkgver}.tar.gz"
3537
"https://downloads.sourceforge.net/project/${_realname}/ng-spice-rework/${pkgver}/${_realname}-doc-${pkgver}.tar.gz"
3638
"no-explicit-lstdc++.patch"
39+
"0001-Remove-illegal-specialization-for-compilation-on-cla.patch"
40+
"0002-curses.patch"
41+
3742
)
38-
sha256sums=('737fe3846ab2333a250dfadf1ed6ebe1860af1d8a5ff5e7803c772cc4256e50a'
39-
'bb971b1553d2ab19a9188f00fa14eb84b24bff6d1fbe0a7e16ffa1147ce6a9a4'
40-
'57f0f6e79faead15b0e1338a32c414b851997edb716467e8c0bc9a10df423582')
43+
sha256sums=('ba8345f4c3774714c10f33d7da850d361cec7d14b3a295d0dc9fd96f7423812d'
44+
'f4c056b3a3617b001e0fa85ffef7eb3797a7b5e3b0a8d18fc4a29707042a9fa7'
45+
'57f0f6e79faead15b0e1338a32c414b851997edb716467e8c0bc9a10df423582'
46+
'e04db285506f2f3b0e07794f2c5127bcf6427eabef3686f6c6298dcc526b12a6'
47+
'6cf7f34df2d829008b6cc14dfcce70c0426f340fa9bcae93613f71c8c97aa2f5')
4148

4249
prepare() {
4350
cd "${srcdir}/${_realname}-${pkgver}"
4451
patch -Np1 -i "${srcdir}/no-explicit-lstdc++.patch"
52+
patch -Np1 -i "${srcdir}/0001-Remove-illegal-specialization-for-compilation-on-cla.patch"
53+
patch -Np1 -i "${srcdir}/0002-curses.patch"
54+
4555
autoreconf -fiv
4656
}
4757

@@ -56,21 +66,23 @@ build() {
5666
--enable-openmp
5767
--enable-xspice
5868
--enable-cider
69+
--enable-osdi
70+
--without-x
5971
)
6072

6173
# FS#45230, create so lib
6274
# shared lib sets flags and modifies headers, needs dedicated pass
6375
# adding --with-readline disables libngspice-0.dll
6476
if [[ ${MINGW_PACKAGE_PREFIX} == *-clang-* ]]; then
65-
LDFLAGS+=" -lomp"
77+
LDFLAGS+=" -lomp --no-undefined"
6678
fi
6779
../${_realname}-${pkgver}/configure \
6880
--prefix=${MINGW_PREFIX} \
6981
--build=${MINGW_CHOST} \
7082
--host=${MINGW_CHOST} \
7183
"${_common_flags[@]}" \
7284
--with-ngshared
73-
make
85+
make
7486

7587
mkdir -p "${srcdir}/build-static-${MSYSTEM}" && cd "${srcdir}/build-static-${MSYSTEM}"
7688

@@ -79,14 +91,14 @@ build() {
7991
../${_realname}-${pkgver}/configure \
8092
"${_common_flags[@]}" \
8193
--with-wingui
82-
make
94+
make
8395

8496
mkdir -p "${srcdir}/build-console-${MSYSTEM}" && cd "${srcdir}/build-console-${MSYSTEM}"
8597

8698
LDFLAGS+=" -lgdi32"
8799
../${_realname}-${pkgver}/configure \
88-
"${_common_flags[@]}"
89-
make
100+
"${_common_flags[@]}"
101+
make
90102
}
91103

92104
package() {

mingw-w64-ngspice/curses.patch

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
diff --git a/configure.ac b/configure.ac
2+
index f97a93ea6..232fa7ac1 100644
3+
--- a/configure.ac
4+
+++ b/configure.ac
5+
@@ -1280,6 +1280,20 @@ else
6+
AC_CHECK_LIB([readline], [readline],
7+
[LIBS="$LIBS -lreadline"],
8+
[AC_MSG_ERROR([Couldn't find readline libraries.])])
9+
+
10+
+PKG_CHECK_MODULES_STATIC([NCURSES], [ncursesw], [
11+
+ AC_SUBST([CURSES_CFLAGS], ["$NCURSES_CFLAGS"])
12+
+ AC_SUBST([CURSES_LIBS], ["$NCURSES_LIBS"])
13+
+ AC_DEFINE([HAVE_CURSES_H], [1], [Define if curses.h is available])
14+
+
15+
+ # Force the compiler to use the ncursesw include path for all subsequent checks
16+
+ CPPFLAGS="$CPPFLAGS $NCURSES_CFLAGS"
17+
+])
18+
+
19+
+AC_CHECK_HEADERS([curses.h], [], [
20+
+ AC_MSG_WARN([curses.h not found, but ncurses/curses.h is available.])
21+
+])
22+
+
23+
fi
24+
else
25+
# Especially defined for macOS (Big Sur), with readline installed from Brew
26+
diff --git a/src/xspice/verilog/Makefile.am b/src/xspice/verilog/Makefile.am
27+
index 262d63384..1a298cff0 100644
28+
--- a/src/xspice/verilog/Makefile.am
29+
+++ b/src/xspice/verilog/Makefile.am
30+
@@ -45,7 +45,9 @@
31+
install-exec-hook:
32+
cd $(DESTDIR)$(pkglibdir); \
33+
rm -f ivlng*a libvvp* ; \
34+
- mv ivlngvpi.* ivlng.vpi
35+
+ if [ -f ivlngvpi.* ]; then \
36+
+ mv ivlngvpi.* ivlng.vpi; \
37+
+ fi
38+
39+
uninstall-hook:
40+
rm -f $(DESTDIR)$(pkglibdir)/ivlng.vpi $(DESTDIR)$(pkglibdir)/ivlng.so

0 commit comments

Comments
 (0)