From e74e08544f804d04edf2ff46b83f9080d03e03bf Mon Sep 17 00:00:00 2001 From: Mat Boehlke Date: Sun, 29 Aug 2021 17:58:28 -0500 Subject: [PATCH] ngspice: update to 35 Also fixes issue with ngspice binary not being packaged. --- srcpkgs/ngspice/patches/windows-only.patch | 15 --------- srcpkgs/ngspice/template | 38 +++++++++++++++++++--- 2 files changed, 34 insertions(+), 19 deletions(-) delete mode 100644 srcpkgs/ngspice/patches/windows-only.patch diff --git a/srcpkgs/ngspice/patches/windows-only.patch b/srcpkgs/ngspice/patches/windows-only.patch deleted file mode 100644 index 8a9ead11e31f..000000000000 --- a/srcpkgs/ngspice/patches/windows-only.patch +++ /dev/null @@ -1,15 +0,0 @@ -libshlwapi is Windows-only - -diff --git src/xspice/cmpp/Makefile.in src/xspice/cmpp/Makefile.in -index b450e8c..2ea8716 100644 ---- a/src/xspice/cmpp/Makefile.in -+++ b/src/xspice/cmpp/Makefile.in -@@ -753,7 +753,7 @@ ifs_yacc.c : ifs_yacc.y - - @CROSS_COMPILING_TRUE@build/cmpp$(BUILD_EXEEXT) : $(BUILD_CMPP_FILES) - @CROSS_COMPILING_TRUE@ $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) \ --@CROSS_COMPILING_TRUE@ $(AM_CPPFLAGS) $(LDFLAGS_FOR_BUILD) -o $@ $^ -lshlwapi -+@CROSS_COMPILING_TRUE@ $(AM_CPPFLAGS) $(LDFLAGS_FOR_BUILD) -o $@ $^ - - @CROSS_COMPILING_TRUE@distclean-local: - @CROSS_COMPILING_TRUE@ -rm -rf build diff --git a/srcpkgs/ngspice/template b/srcpkgs/ngspice/template index 05beffd8f841..e7d786828310 100644 --- a/srcpkgs/ngspice/template +++ b/srcpkgs/ngspice/template @@ -1,19 +1,49 @@ # Template file for 'ngspice' pkgname=ngspice -version=33 +version=35 revision=1 build_style=gnu-configure -configure_args="--with-readline=yes --with-ngshared --enable-xspice --enable-cider" +configure_args="--enable-xspice --enable-cider" hostmakedepends="bison byacc" makedepends="readline-devel libX11-devel libXaw-devel" +checkdepends="perl" short_desc="Mixed Mode Mixed Level Circuit Simulator based on Spice3F5" maintainer="Toyam Cox " license="BSD-3-Clause" homepage="http://ngspice.sourceforge.net" distfiles="${SOURCEFORGE_SITE}/ngspice/ng-spice-rework/${version}/${pkgname}-${version}.tar.gz" -checksum=b99db66cc1c57c44e9af1ef6ccb1dcbc8ae1df3e35acf570af578f606f8541f1 +checksum=c1b7f5c276db579acb3f0a7afb64afdeb4362289a6cab502d4ca302d6e5279ec -post_install() { +# ngshared binary and shared library can't be built in the same pass +# --ngshared builds the shared library, and readline should only be enabled for the binary +# see: https://github.com/imr/ngspice/commit/b86c85f85bbba6e45dc030af3e853edf8b9cfa3d +do_configure() { + mkdir build + cd build + ../configure --with-readline=yes $configure_args + mkdir ../build-lib + cd ../build-lib + ../configure --with-ngshared $configure_args +} + +do_build() { + make -C build $makejobs + make -C build-lib $makejobs +} + +# Starting with v34, some tests fail with "No compatability mode selected!" +# Solution is to add this line to a .spiceinit file in the home directory, +# see: https://sourceforge.net/p/ngspice/bugs/554/#b513 +do_check() { + export HOME="${PWD}/.home_dir" + install -d "$HOME" + printf 'set ngbehavior=mc\n' > "${HOME}/.spiceinit" + make -C build check +} + +do_install() { + make DESTDIR=${DESTDIR} -C build install + make DESTDIR=${DESTDIR} -C build-lib install vlicense COPYING }