Skip to content

Commit cb62481

Browse files
committed
update to ngspice 44.2
1 parent 264a135 commit cb62481

File tree

2 files changed

+72
-9
lines changed

2 files changed

+72
-9
lines changed

mingw-w64-ngspice/PKGBUILD

Lines changed: 14 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=44.2
88
pkgrel=1
99
pkgdesc="Mixed-level/Mixed-signal circuit simulator based on Spice3f5, Cider1b1, and Xspice (mingw-w64)"
1010
arch=('any')
@@ -24,6 +24,7 @@ depends=(
2424
"${MINGW_PACKAGE_PREFIX}-fftw"
2525
"${MINGW_PACKAGE_PREFIX}-gcc-libs"
2626
"${MINGW_PACKAGE_PREFIX}-omp"
27+
"${MINGW_PACKAGE_PREFIX}-ncurses"
2728
)
2829
makedepends=(
2930
"${MINGW_PACKAGE_PREFIX}-cc"
@@ -32,16 +33,19 @@ makedepends=(
3233
install="${_realname}-${MSYSTEM}.install"
3334
source=(
3435
"https://downloads.sourceforge.net/project/${_realname}/ng-spice-rework/${pkgver}/${_realname}-${pkgver}.tar.gz"
35-
"https://downloads.sourceforge.net/project/${_realname}/ng-spice-rework/${pkgver}/${_realname}-doc-${pkgver}.tar.gz"
36+
"https://downloads.sourceforge.net/project/${_realname}/ng-spice-rework/${pkgver}/${_realname}-doc-${pkgver%%.*}.tar.gz"
3637
"no-explicit-lstdc++.patch"
38+
"curses.patch"
3739
)
38-
sha256sums=('737fe3846ab2333a250dfadf1ed6ebe1860af1d8a5ff5e7803c772cc4256e50a'
39-
'bb971b1553d2ab19a9188f00fa14eb84b24bff6d1fbe0a7e16ffa1147ce6a9a4'
40-
'57f0f6e79faead15b0e1338a32c414b851997edb716467e8c0bc9a10df423582')
40+
sha256sums=('e7dadfb7bd5474fd22409c1e5a67acdec19f77e597df68e17c5549bc1390d7fd'
41+
'6dce369c3001d121404f88a2c5eac1ba01c46d7c70a1034ec53f1ff007ec7321'
42+
'57f0f6e79faead15b0e1338a32c414b851997edb716467e8c0bc9a10df423582'
43+
'ea53179ecfd2d6c00fb83219d286d760f0f96b07138ed81eb5a2e4a883e8601d')
4144

4245
prepare() {
4346
cd "${srcdir}/${_realname}-${pkgver}"
4447
patch -Np1 -i "${srcdir}/no-explicit-lstdc++.patch"
48+
patch -Np1 -i "${srcdir}/curses.patch"
4549
autoreconf -fiv
4650
}
4751

@@ -56,6 +60,7 @@ build() {
5660
--enable-openmp
5761
--enable-xspice
5862
--enable-cider
63+
--without-x
5964
)
6065

6166
# FS#45230, create so lib
@@ -70,7 +75,7 @@ build() {
7075
--host=${MINGW_CHOST} \
7176
"${_common_flags[@]}" \
7277
--with-ngshared
73-
make
78+
make -j
7479

7580
mkdir -p "${srcdir}/build-static-${MSYSTEM}" && cd "${srcdir}/build-static-${MSYSTEM}"
7681

@@ -79,14 +84,14 @@ build() {
7984
../${_realname}-${pkgver}/configure \
8085
"${_common_flags[@]}" \
8186
--with-wingui
82-
make
87+
make -j
8388

8489
mkdir -p "${srcdir}/build-console-${MSYSTEM}" && cd "${srcdir}/build-console-${MSYSTEM}"
8590

8691
LDFLAGS+=" -lgdi32"
8792
../${_realname}-${pkgver}/configure \
88-
"${_common_flags[@]}"
89-
make
93+
"${_common_flags[@]}"
94+
make -j
9095
}
9196

9297
package() {

mingw-w64-ngspice/curses.patch

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
--- ngspice-44.2a/configure.ac 2025-01-11 13:35:18.000000000 +0100
2+
+++ ngspice-44.2b/configure.ac 2025-02-03 17:42:18.995267000 +0100
3+
@@ -1280,6 +1280,40 @@ else
4+
AC_CHECK_LIB([readline], [readline],
5+
[LIBS="$LIBS -lreadline"],
6+
[AC_MSG_ERROR([Couldn't find readline libraries.])])
7+
+
8+
+# Check for curses.h using pkg-config or manual paths
9+
+PKG_CHECK_MODULES_STATIC([NCURSES], [ncursesw], [
10+
+ # If pkg-config found ncursesw, use its flags
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+
+ # Fallback if pkg-config fails
19+
+ AC_MSG_WARN([pkg-config for ncursesw failed. Trying manual detection...])
20+
+
21+
+ # Manually check for ncurses/curses.h and set flags
22+
+ AC_CHECK_HEADER([ncurses/curses.h], [
23+
+ CURSES_CFLAGS="-I/ucrt64/include/ncurses"
24+
+ CURSES_LIBS="-lncursesw"
25+
+ AC_SUBST([CURSES_CFLAGS])
26+
+ AC_SUBST([CURSES_LIBS])
27+
+ AC_DEFINE([HAVE_CURSES_H], [1], [Define if curses.h is available])
28+
+
29+
+ # Force the compiler to use this include path
30+
+ CPPFLAGS="$CPPFLAGS $CURSES_CFLAGS"
31+
+ ], [
32+
+ AC_MSG_ERROR([ncurses/curses.h not found in /ucrt64/include/ncurses. Install ncurses!])
33+
+ ])
34+
+])
35+
+
36+
+# Now check for curses.h using the updated CPPFLAGS
37+
+AC_CHECK_HEADERS([curses.h], [], [
38+
+ AC_MSG_WARN([curses.h not found, but ncurses/curses.h is available.])
39+
+])
40+
+
41+
fi
42+
else
43+
# Especially defined for macOS (Big Sur), with readline installed from Brew
44+
diff --git a/src/xspice/verilog/Makefile.am b/src/xspice/verilog/Makefile.am
45+
index 262d63384..1a298cff0 100644
46+
--- a/src/xspice/verilog/Makefile.am
47+
+++ b/src/xspice/verilog/Makefile.am
48+
@@ -45,7 +45,9 @@
49+
install-exec-hook:
50+
cd $(DESTDIR)$(pkglibdir); \
51+
rm -f ivlng*a libvvp* ; \
52+
- mv ivlngvpi.* ivlng.vpi
53+
+ if [ -f ivlngvpi.* ]; then \
54+
+ mv ivlngvpi.* ivlng.vpi; \
55+
+ fi
56+
57+
uninstall-hook:
58+
rm -f $(DESTDIR)$(pkglibdir)/ivlng.vpi $(DESTDIR)$(pkglibdir)/ivlng.so

0 commit comments

Comments
 (0)