Here is an update diff for ngspice 43. It is required to update kicad. There is nothing special I would say. To be honest I don't know how to test it but kicad8 is built with this version and runs fine.
OK? diff --git a/cad/ngspice/Makefile.inc b/cad/ngspice/Makefile.inc index 361bcfad180..e5560fc89f4 100644 --- a/cad/ngspice/Makefile.inc +++ b/cad/ngspice/Makefile.inc @@ -1,4 +1,4 @@ -V ?= 31 +V ?= 43 DISTNAME ?= ngspice-${V} @@ -9,7 +9,21 @@ HOMEPAGE ?= https://ngspice.sourceforge.net/ # BSD PERMIT_PACKAGE ?= Yes +SITES ?= ${SITE_SOURCEFORGE:=ngspice/} + USE_GMAKE ?= yes -CONFIGURE_STYLE ?= gnu -SITES ?= ${SITE_SOURCEFORGE:=ngspice/} +AUTOCONF_VERSION = 2.69 +AUTOMAKE_VERSION = 1.16 + +CONFIGURE_STYLE = autoreconf + +TAR = ${LOCALBASE}/bin/gtar + +BUILD_DEPENDS += archivers/gtar + +CONFIGURE_ARGS += --enable-cider \ + --enable-xspice \ + --with-readline=yes + +CONFIGURE_ARGS += --disable-openmp diff --git a/cad/ngspice/libngspice/Makefile b/cad/ngspice/libngspice/Makefile index 8c9ce525616..c7a5109489a 100644 --- a/cad/ngspice/libngspice/Makefile +++ b/cad/ngspice/libngspice/Makefile @@ -1,18 +1,18 @@ -COMMENT = ngspice shared library, based on Berkeley SPICE +COMMENT = ngspice shared library, based on Berkeley SPICE -PKGNAME = libngspice-${V} -REVISION = 1 +PKGNAME = libngspice-${V} -SHARED_LIBS += ngspice 0.0 # 0.0 +SHARED_LIBS += ngspice 0.0 # 0.0 WANTLIB += m pthread -CONFIGURE_ARGS += --with-ngshared +CONFIGURE_ARGS += --with-ngshared \ + --enable-shared # same tests as cad/ngspice/ngspice, but they assume you've built a binary -NO_TEST = Yes +NO_TEST = Yes post-install: - @rm -r ${PREFIX}/share/ngspice/ + @rm -r ${PREFIX}/{lib,share}/ngspice/ .include <bsd.port.mk> diff --git a/cad/ngspice/libngspice/distinfo b/cad/ngspice/libngspice/distinfo index b1e9757d344..10768caaa9a 100644 --- a/cad/ngspice/libngspice/distinfo +++ b/cad/ngspice/libngspice/distinfo @@ -1,2 +1,2 @@ -SHA256 (ngspice-31.tar.gz) = hF87DJYuR97QUd+8E0w8HkrJJcnwzhyz32Trm52lwoI= -SIZE (ngspice-31.tar.gz) = 7250057 +SHA256 (ngspice-43.tar.gz) = FN1qbwhTHyBRwTrmN5CkVwi9Q/PneIamqEiYwpexNpk= +SIZE (ngspice-43.tar.gz) = 10279606 diff --git a/cad/ngspice/libngspice/patches/patch-configure_ac b/cad/ngspice/libngspice/patches/patch-configure_ac new file mode 100644 index 00000000000..a744ce340de --- /dev/null +++ b/cad/ngspice/libngspice/patches/patch-configure_ac @@ -0,0 +1,82 @@ +Index: configure.ac +--- configure.ac.orig ++++ configure.ac +@@ -820,7 +820,6 @@ fi + # Xft is optional, allows text rotation in plots + + if test "x$no_x" != xyes ; then +- X_CFLAGS="$X_CFLAGS -I/usr/include/freetype2" + AC_CHECK_LIB([Xaw], [main], [X_LIBS="$X_LIBS -lXaw"], + [AC_MSG_ERROR([Couldn't find Xaw library])], [$X_LIBS $X_EXTRA_LIBS]) + AC_CHECK_LIB([Xmu], [main], [X_LIBS="$X_LIBS -lXmu"], +@@ -829,21 +828,9 @@ if test "x$no_x" != xyes ; then + AC_CHECK_LIB([Xext], [XShmAttach], [X_LIBS="$X_LIBS -lXext"], + [AC_MSG_ERROR([Couldn't find Xext library])], [$X_LIBS $X_EXTRA_LIBS]) + X_LIBS="$X_LIBS -lX11" +- AC_CHECK_LIB([Xft], [main], +- [AC_DEFINE([HAVE_LIBXFT], [1], [Have xft routines in libxft])] +- X_LIBS="$X_LIBS -lXft -lfontconfig -lXrender -lfreetype" +- has_xft=yes, +- [has_xft=no], [$X_LIBS $X_EXTRA_LIBS]) ++ PKG_CHECK_MODULES([XFT], [xft], [X_CFLAGS="$X_CFLAGS $XFT_CFLAGS"; X_LIBS="$X_LIBS $XFT_LIBS"], ++ [AC_MSG_ERROR([Couldn't find freetype library])]) + +- if test "x$has_xft" = xyes ; then +- AC_CHECK_LIB([fontconfig], [main], [], +- [AC_MSG_ERROR([Couldn't find fontconfig library])], [$X_LIBS $X_EXTRA_LIBS]) +-# AC_CHECK_LIB([Xrender], [main], [], +-# [AC_MSG_ERROR([Couldn't find Xrender library])], [$X_LIBS $X_EXTRA_LIBS]) +- AC_CHECK_LIB([freetype], [main], [], +- [AC_MSG_ERROR([Couldn't find freetype library])], [$X_LIBS $X_EXTRA_LIBS]) +- fi +- + has_no_x=false + else + AC_DEFINE([X_DISPLAY_MISSING]) +@@ -864,9 +851,27 @@ AM_CONDITIONAL([NO_X], [test "x$has_no_x" = xtrue]) + AM_CONDITIONAL([NO_HELP], [test "x$has_no_help" = xtrue]) + + # Additional libs of hicum group +-AC_CHECK_LIB(stdc++, main, XTRALIBS="$XTRALIBS -lstdc++",,) +-AC_SUBST(XTRALIBS, $XTRALIBS) ++#AC_CHECK_LIB(stdc++, main, XTRALIBS="$XTRALIBS -lstdc++",,) ++#AC_SUBST(XTRALIBS, $XTRALIBS) ++# Determine which C++ standard library to use based on the compiler ++AC_MSG_CHECKING([which C++ standard library to use]) ++case `$CXX --version` in ++ *clang*) ++ AC_CHECK_LIB(c++, main, XTRALIBS="$XTRALIBS -lc++ -pthread",,) ++ AC_SUBST(XTRALIBS, $XTRALIBS) ++ ;; ++ *g++*) ++ AC_CHECK_LIB(stdc++, main, XTRALIBS="$XTRALIBS -lestdc++",,) ++ AC_SUBST(XTRALIBS, $XTRALIBS) ++ ;; ++ *) ++ AC_MSG_ERROR([Unknown C++ compiler]) ++ ;; ++esac + ++#AC_SUBST(XTRALIBS, $XTRALIBS) ++ ++ + LIBS="$LIBS $XTRALIBS" + + # enabling making of the old and outdated applications +@@ -1112,7 +1117,7 @@ if test "x$enable_xspice" = xno; then + XSPICEDLLIBS="" + ;; + * ) +- XSPICEDLLIBS="-ldl" ++ XSPICEDLLIBS="" + ;; + esac + fi +@@ -1135,7 +1140,6 @@ else + ;; + *openbsd* ) + AC_DEFINE([IPC_UNIX_SOCKETS], [1], [Client-Server via socket.]) +- XSPICEDLLIBS="-ldl" + ;; + *solaris* ) + AC_DEFINE([IPC_UNIX_SOCKETS], [1], [Client-Server via socket.]) diff --git a/cad/ngspice/libngspice/pkg/PLIST b/cad/ngspice/libngspice/pkg/PLIST index 5a97a6ea02c..79614cb4d61 100644 --- a/cad/ngspice/libngspice/pkg/PLIST +++ b/cad/ngspice/libngspice/pkg/PLIST @@ -1,130 +1,7 @@ @conflict ngspice-<30p0 include/ngspice/ -include/ngspice/1-f-code.h -include/ngspice/FastNorm3.h -include/ngspice/acdefs.h -include/ngspice/bdrydefs.h -include/ngspice/bool.h -include/ngspice/carddefs.h -include/ngspice/ciderinp.h -include/ngspice/cidersupt.h -include/ngspice/cktdefs.h -include/ngspice/cluster.h -include/ngspice/cm.h -include/ngspice/cmconstants.h -include/ngspice/cmproto.h -include/ngspice/cmtypes.h -include/ngspice/compatmode.h -include/ngspice/complex.h -include/ngspice/config.h -include/ngspice/const.h -include/ngspice/contdefs.h -include/ngspice/cpdefs.h -include/ngspice/cpextern.h -include/ngspice/cpstd.h -include/ngspice/defines.h -include/ngspice/devdefs.h -include/ngspice/dgen.h -include/ngspice/distodef.h -include/ngspice/dllitf.h -include/ngspice/domndefs.h -include/ngspice/dopdefs.h -include/ngspice/dstring.h -include/ngspice/dvec.h -include/ngspice/elctdefs.h -include/ngspice/enh.h -include/ngspice/enhtypes.h -include/ngspice/evt.h -include/ngspice/evtproto.h -include/ngspice/evtshared.h -include/ngspice/evttypes.h -include/ngspice/evtudn.h -include/ngspice/fftext.h -include/ngspice/ftedbgra.h -include/ngspice/ftedebug.h -include/ngspice/ftedefs.h -include/ngspice/ftedev.h -include/ngspice/fteext.h -include/ngspice/fteinp.h -include/ngspice/fteinput.h -include/ngspice/fteoptdefs.h -include/ngspice/fteparse.h -include/ngspice/gendefs.h -include/ngspice/gendev.h -include/ngspice/graph.h -include/ngspice/grid.h -include/ngspice/hash.h -include/ngspice/hlpdefs.h -include/ngspice/iferrmsg.h -include/ngspice/ifsim.h -include/ngspice/inpdefs.h -include/ngspice/inpmacs.h -include/ngspice/inpptree.h -include/ngspice/ipc.h -include/ngspice/ipcproto.h -include/ngspice/ipctiein.h -include/ngspice/jobdefs.h -include/ngspice/lsort.h -include/ngspice/macros.h -include/ngspice/material.h -include/ngspice/matldefs.h -include/ngspice/memory.h -include/ngspice/meshdefs.h -include/ngspice/meshext.h -include/ngspice/methdefs.h -include/ngspice/mif.h -include/ngspice/mifcmdat.h -include/ngspice/mifdefs.h -include/ngspice/mifparse.h -include/ngspice/mifproto.h -include/ngspice/miftypes.h -include/ngspice/missing_math.h -include/ngspice/mobdefs.h -include/ngspice/modldefs.h -include/ngspice/multi_line.h -include/ngspice/ngspice.h -include/ngspice/noisedef.h -include/ngspice/numcards.h -include/ngspice/numconst.h -include/ngspice/numenum.h -include/ngspice/numgen.h -include/ngspice/numglobs.h -include/ngspice/onedev.h -include/ngspice/onemesh.h -include/ngspice/opdefs.h -include/ngspice/optdefs.h -include/ngspice/optndefs.h -include/ngspice/outpdefs.h -include/ngspice/plot.h -include/ngspice/pnode.h -include/ngspice/profile.h -include/ngspice/pssdefs.h -include/ngspice/pzdefs.h -include/ngspice/randnumb.h -include/ngspice/sen2defs.h -include/ngspice/sensdefs.h -include/ngspice/sensgen.h include/ngspice/sharedspice.h -include/ngspice/sim.h -include/ngspice/smpdefs.h -include/ngspice/sperror.h -include/ngspice/spmatrix.h -include/ngspice/stringskip.h -include/ngspice/stringutil.h -include/ngspice/suffix.h -include/ngspice/swec.h -include/ngspice/tclspice.h -include/ngspice/tfdefs.h -include/ngspice/trandefs.h -include/ngspice/trcvdefs.h -include/ngspice/tskdefs.h -include/ngspice/twodev.h -include/ngspice/twomesh.h -include/ngspice/typedefs.h -include/ngspice/wallace.h -include/ngspice/wordlist.h -include/ngspice/wstdio.h -lib/libngspice.a +@static-lib lib/libngspice.a lib/libngspice.la @lib lib/libngspice.so.${LIBngspice_VERSION} lib/pkgconfig/ngspice.pc diff --git a/cad/ngspice/ngspice/Makefile b/cad/ngspice/ngspice/Makefile index 58b44781237..dfa098a3717 100644 --- a/cad/ngspice/ngspice/Makefile +++ b/cad/ngspice/ngspice/Makefile @@ -1,10 +1,9 @@ -COMMENT = circuit simulator, based on Berkeley SPICE +COMMENT = circuit simulator, based on Berkeley SPICE -REVISION = 1 +WANTLIB += ${COMPILER_LIBCXX} ICE SM X11 Xau Xaw Xdmcp Xext Xft +WANTLIB += Xmu Xpm Xrender Xt c curses expat fontconfig freetype +WANTLIB += m readline xcb z -WANTLIB += ICE SM X11 Xau Xaw Xdmcp Xext Xmu Xpm Xt c m xcb - -post-install: - @rm -r ${PREFIX}/include/ngspice +CONFIGURE_ARGS += --with-x .include <bsd.port.mk> diff --git a/cad/ngspice/ngspice/distinfo b/cad/ngspice/ngspice/distinfo index b1e9757d344..10768caaa9a 100644 --- a/cad/ngspice/ngspice/distinfo +++ b/cad/ngspice/ngspice/distinfo @@ -1,2 +1,2 @@ -SHA256 (ngspice-31.tar.gz) = hF87DJYuR97QUd+8E0w8HkrJJcnwzhyz32Trm52lwoI= -SIZE (ngspice-31.tar.gz) = 7250057 +SHA256 (ngspice-43.tar.gz) = FN1qbwhTHyBRwTrmN5CkVwi9Q/PneIamqEiYwpexNpk= +SIZE (ngspice-43.tar.gz) = 10279606 diff --git a/cad/ngspice/ngspice/patches/patch-configure_ac b/cad/ngspice/ngspice/patches/patch-configure_ac new file mode 100644 index 00000000000..a744ce340de --- /dev/null +++ b/cad/ngspice/ngspice/patches/patch-configure_ac @@ -0,0 +1,82 @@ +Index: configure.ac +--- configure.ac.orig ++++ configure.ac +@@ -820,7 +820,6 @@ fi + # Xft is optional, allows text rotation in plots + + if test "x$no_x" != xyes ; then +- X_CFLAGS="$X_CFLAGS -I/usr/include/freetype2" + AC_CHECK_LIB([Xaw], [main], [X_LIBS="$X_LIBS -lXaw"], + [AC_MSG_ERROR([Couldn't find Xaw library])], [$X_LIBS $X_EXTRA_LIBS]) + AC_CHECK_LIB([Xmu], [main], [X_LIBS="$X_LIBS -lXmu"], +@@ -829,21 +828,9 @@ if test "x$no_x" != xyes ; then + AC_CHECK_LIB([Xext], [XShmAttach], [X_LIBS="$X_LIBS -lXext"], + [AC_MSG_ERROR([Couldn't find Xext library])], [$X_LIBS $X_EXTRA_LIBS]) + X_LIBS="$X_LIBS -lX11" +- AC_CHECK_LIB([Xft], [main], +- [AC_DEFINE([HAVE_LIBXFT], [1], [Have xft routines in libxft])] +- X_LIBS="$X_LIBS -lXft -lfontconfig -lXrender -lfreetype" +- has_xft=yes, +- [has_xft=no], [$X_LIBS $X_EXTRA_LIBS]) ++ PKG_CHECK_MODULES([XFT], [xft], [X_CFLAGS="$X_CFLAGS $XFT_CFLAGS"; X_LIBS="$X_LIBS $XFT_LIBS"], ++ [AC_MSG_ERROR([Couldn't find freetype library])]) + +- if test "x$has_xft" = xyes ; then +- AC_CHECK_LIB([fontconfig], [main], [], +- [AC_MSG_ERROR([Couldn't find fontconfig library])], [$X_LIBS $X_EXTRA_LIBS]) +-# AC_CHECK_LIB([Xrender], [main], [], +-# [AC_MSG_ERROR([Couldn't find Xrender library])], [$X_LIBS $X_EXTRA_LIBS]) +- AC_CHECK_LIB([freetype], [main], [], +- [AC_MSG_ERROR([Couldn't find freetype library])], [$X_LIBS $X_EXTRA_LIBS]) +- fi +- + has_no_x=false + else + AC_DEFINE([X_DISPLAY_MISSING]) +@@ -864,9 +851,27 @@ AM_CONDITIONAL([NO_X], [test "x$has_no_x" = xtrue]) + AM_CONDITIONAL([NO_HELP], [test "x$has_no_help" = xtrue]) + + # Additional libs of hicum group +-AC_CHECK_LIB(stdc++, main, XTRALIBS="$XTRALIBS -lstdc++",,) +-AC_SUBST(XTRALIBS, $XTRALIBS) ++#AC_CHECK_LIB(stdc++, main, XTRALIBS="$XTRALIBS -lstdc++",,) ++#AC_SUBST(XTRALIBS, $XTRALIBS) ++# Determine which C++ standard library to use based on the compiler ++AC_MSG_CHECKING([which C++ standard library to use]) ++case `$CXX --version` in ++ *clang*) ++ AC_CHECK_LIB(c++, main, XTRALIBS="$XTRALIBS -lc++ -pthread",,) ++ AC_SUBST(XTRALIBS, $XTRALIBS) ++ ;; ++ *g++*) ++ AC_CHECK_LIB(stdc++, main, XTRALIBS="$XTRALIBS -lestdc++",,) ++ AC_SUBST(XTRALIBS, $XTRALIBS) ++ ;; ++ *) ++ AC_MSG_ERROR([Unknown C++ compiler]) ++ ;; ++esac + ++#AC_SUBST(XTRALIBS, $XTRALIBS) ++ ++ + LIBS="$LIBS $XTRALIBS" + + # enabling making of the old and outdated applications +@@ -1112,7 +1117,7 @@ if test "x$enable_xspice" = xno; then + XSPICEDLLIBS="" + ;; + * ) +- XSPICEDLLIBS="-ldl" ++ XSPICEDLLIBS="" + ;; + esac + fi +@@ -1135,7 +1140,6 @@ else + ;; + *openbsd* ) + AC_DEFINE([IPC_UNIX_SOCKETS], [1], [Client-Server via socket.]) +- XSPICEDLLIBS="-ldl" + ;; + *solaris* ) + AC_DEFINE([IPC_UNIX_SOCKETS], [1], [Client-Server via socket.]) diff --git a/cad/ngspice/ngspice/patches/patch-src_spicelib_analysis_cktsetup_c b/cad/ngspice/ngspice/patches/patch-src_spicelib_analysis_cktsetup_c new file mode 100644 index 00000000000..1c461d1b69f --- /dev/null +++ b/cad/ngspice/ngspice/patches/patch-src_spicelib_analysis_cktsetup_c @@ -0,0 +1,11 @@ +Index: src/spicelib/analysis/cktsetup.c +--- src/spicelib/analysis/cktsetup.c.orig ++++ src/spicelib/analysis/cktsetup.c +@@ -21,7 +21,6 @@ Author: 1985 Thomas L. Quarles + #endif + + #ifdef USE_OMP +-#include <omp.h> + #include "ngspice/cpextern.h" + int nthreads; + #endif diff --git a/cad/ngspice/ngspice/patches/patch-tests_bin_check_sh b/cad/ngspice/ngspice/patches/patch-tests_bin_check_sh deleted file mode 100644 index 1f52147b68e..00000000000 --- a/cad/ngspice/ngspice/patches/patch-tests_bin_check_sh +++ /dev/null @@ -1,14 +0,0 @@ -Index: tests/bin/check.sh ---- tests/bin/check.sh.orig -+++ tests/bin/check.sh -@@ -40,8 +40,8 @@ case $HOST_TYPE in - rm -f $testname.test_tmp $testname.out_tmp - ;; - FreeBSD*|SunOS*|OpenBSD*) -- $SPICE --batch $testdir/$testname.cir >$testname.test &&\ -- sed -e '/^$/d' $testname.test | egrep -v "$FILTER" > $testname.test_tmp &&\ -+ $SPICE --batch $testdir/$testname.cir >$testname.test -+ sed -e '/^$/d' $testname.test | egrep -v "$FILTER" > $testname.test_tmp - sed -e '/^$/d' $testdir/$testname.out | egrep -v "$FILTER" > $testname.out_tmp - if diff -b -w $testname.out_tmp $testname.test_tmp; then - rm $testname.test $testname.test_tmp $testname.out_tmp diff --git a/cad/ngspice/ngspice/pkg/PLIST b/cad/ngspice/ngspice/pkg/PLIST index ce24003f488..1912adcc2c9 100644 --- a/cad/ngspice/ngspice/pkg/PLIST +++ b/cad/ngspice/ngspice/pkg/PLIST @@ -1,8 +1,26 @@ @pkgpath cad/ngspice @bin bin/ngspice +lib/ngspice/ +@bin lib/ngspice/analog.cm +@bin lib/ngspice/digital.cm +@bin lib/ngspice/spice2poly.cm +@bin lib/ngspice/table.cm +@bin lib/ngspice/xtradev.cm +@bin lib/ngspice/xtraevt.cm @man man/man1/ngspice.1 share/ngspice/ share/ngspice/scripts/ +share/ngspice/scripts/ciderinit +share/ngspice/scripts/devaxis +share/ngspice/scripts/devload share/ngspice/scripts/setplot share/ngspice/scripts/spectrum share/ngspice/scripts/spinit +share/ngspice/scripts/src/ +share/ngspice/scripts/src/ngspice/ +share/ngspice/scripts/src/ngspice/cmtypes.h +share/ngspice/scripts/src/ngspice/cosim.h +share/ngspice/scripts/src/ngspice/miftypes.h +share/ngspice/scripts/src/verilator_main.cpp +share/ngspice/scripts/src/verilator_shim.cpp +share/ngspice/scripts/vlnggen