public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: sci-electronics/ngspice/, sci-electronics/ngspice/files/
@ 2017-12-27 12:01 Marek Szuba
  0 siblings, 0 replies; 2+ messages in thread
From: Marek Szuba @ 2017-12-27 12:01 UTC (permalink / raw
  To: gentoo-commits

commit:     c81f0b34a260766f971f20c2207f8d834a4a6a40
Author:     Marek Szuba <marecki <AT> gentoo <DOT> org>
AuthorDate: Wed Dec 27 11:30:21 2017 +0000
Commit:     Marek Szuba <marecki <AT> gentoo <DOT> org>
CommitDate: Wed Dec 27 12:01:46 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c81f0b34

sci-electronics/ngspice: bump to version 27 and EAPI 6

Major changes:
 * there is now a proper optional dependency on sci-libs/fftw,
   controlled by USE=fftw;
 * enabled OpenMP support, controlled by USE=openmp;
 * SENSdebug compiles again so it is now included in USE=debug;
 * the manual is only installed if USE=doc is set;
 * tests can now be run properly. At present two of them ("empty" and
   "resume", both in regression/misc/) fail, however it is only because
   of excessive output from the executable so it should be easy to fix.

Package-Manager: Portage-2.3.13, Repoman-2.3.3

 sci-electronics/ngspice/Manifest                   |  2 +
 .../ngspice/files/ngspice-27-autoconf_fftw3.patch  | 26 ++++++
 .../ngspice/files/ngspice-27-split_terminfo.patch  | 20 +++++
 sci-electronics/ngspice/ngspice-27.ebuild          | 99 ++++++++++++++++++++++
 4 files changed, 147 insertions(+)

diff --git a/sci-electronics/ngspice/Manifest b/sci-electronics/ngspice/Manifest
index 65f631c0fa4..15963ee80df 100644
--- a/sci-electronics/ngspice/Manifest
+++ b/sci-electronics/ngspice/Manifest
@@ -1,2 +1,4 @@
 DIST ngspice-26-manual.pdf 2141771 BLAKE2B 16956c46640de4696f7197997b170a2b1aad9b2f9fbe299b801de100d8aaca949b5be6f259e353a168ae90d992d91ff65e8a819b49fdf509fae98ec7dfa610d7 SHA512 1c160aeef61d8091a6d788677bcf7ea682393cc886d5d535f87bb800cdae4f095cbf1e833babadea481956b904b4bdb688cc18b80d9d6a29cab33a54275abab1
 DIST ngspice-26.tar.gz 6925987 BLAKE2B 8f8e54000234ea3896a55863df99b6ce83ad322e3049845e0a817635ebfebdc8398e6fa4831727c4798a8d9dce1b1c2a01354505e48dc0b2db9e9036aa2ae5aa SHA512 eb6a81df90de803c9f7544e8d0de7cc413aac169f69d1dec5cc6d2e667b66d42aede7f14c75bcdd10288be0c2ac07863fd4028b9fe59f2f515d680c2ffa41cab
+DIST ngspice-27-manual.pdf 3117788 BLAKE2B 6e271abc50b0139c4776844ea31176d231e68c70ce34d0daec48aefc5ef5a9eac90a77f3141081f38c6ac8d42bb95ec061bf1d43bfd3a4fb13e4822c2eff4f57 SHA512 ed87764715917e2cd832c49e911a2908dba9907f9f01c933cb7f97a92c7f9ff345bc26a2f0561dd34b2eede6874b6a67b4864abf3dcff127bd0306e778e997b5
+DIST ngspice-27.tar.gz 7372998 BLAKE2B ce8590518fa4eb4292c73c4eaefdd9d0da19bca8120b51daae954a5b9d86f51912d2dccb5a827480caadce8321373d96f045226db4986a78bcc9170f2e46f9a5 SHA512 1714f95ab5716c228a0b39395a742e8b9a823e0e6f7e08625d089541ea786df5fd7b9d2982bcec8431e27ac6ba7603ecc507f9cfcb0a6aacd53f5633f52bd2ea

diff --git a/sci-electronics/ngspice/files/ngspice-27-autoconf_fftw3.patch b/sci-electronics/ngspice/files/ngspice-27-autoconf_fftw3.patch
new file mode 100644
index 00000000000..d490938d209
--- /dev/null
+++ b/sci-electronics/ngspice/files/ngspice-27-autoconf_fftw3.patch
@@ -0,0 +1,26 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -191,6 +191,10 @@
+ AC_ARG_WITH([ngshared],
+     [AS_HELP_STRING([--with-ngshared], [Compiles ngspice as shared library (dll)])])
+ 
++# --with-fftw3: Use fftw3 for Fourier transforms.  Default is "yes".
++AC_ARG_WITH([fftw3],
++    [AS_HELP_STRING([--with-fftw3[=yes/no]], [Use fftw3 for Fourier transforms. Default=yes.])])
++
+ # readline and editline cannot both be enabled
+ if test "x$with_editline" = xyes; then
+     if test "x$with_readline" = xyes; then
+@@ -726,10 +730,12 @@
+ # Look for math library:
+ AC_CHECK_LIB([m], [sqrt])
+ AC_CHECK_HEADERS([float.h limits.h values.h ieeefp.h])
++if test "x$with_fftw3" = xyes; then
+ AC_CHECK_HEADERS([fftw3.h])
+ AC_CHECK_LIB([fftw3], [fftw_plan_dft_1d],
+         [AC_DEFINE([HAVE_LIBFFTW3], [], [Have fft routines in libfftw3])
+          LIBS="$LIBS -lfftw3"])
++fi
+ 
+ # Check for a few mathematical functions:
+ AC_CHECK_FUNCS([erfc logb scalb scalbn asinh acosh atanh finite])

diff --git a/sci-electronics/ngspice/files/ngspice-27-split_terminfo.patch b/sci-electronics/ngspice/files/ngspice-27-split_terminfo.patch
new file mode 100644
index 00000000000..09f5ee29a3c
--- /dev/null
+++ b/sci-electronics/ngspice/files/ngspice-27-split_terminfo.patch
@@ -0,0 +1,20 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -1016,7 +1016,7 @@
+         AC_CHECK_HEADERS([readline/readline.h readline/history.h],
+             [AC_DEFINE([HAVE_GNUREADLINE], [], [Define if we have GNU readline])],
+             [AC_MSG_ERROR([Couldn't find GNU readline headers.])])
+-        AC_SEARCH_LIBS([tputs], [ncurses termcap],
++        AC_SEARCH_LIBS([tputs], [ncurses termcap tinfo],
+             [AC_DEFINE([HAVE_TERMCAP], [], [Define if we have ncurses or termcap])],
+             [AC_MSG_ERROR([Found neither ncurses or termcap])])
+         AC_CHECK_LIB([readline], [readline],
+@@ -1036,7 +1036,7 @@
+     AC_CHECK_HEADERS([editline/readline.h],
+         [AC_DEFINE([HAVE_BSDEDITLINE], [1], [Define to enable BSD editline])],
+         [AC_MSG_ERROR([Couldn't find BSD editline headers.])])
+-    AC_SEARCH_LIBS([tputs], [ncurses termcap],
++    AC_SEARCH_LIBS([tputs], [ncurses termcap tinfo],
+         [AC_DEFINE([HAVE_TERMCAP], [], [Define if we have ncurses or termcap])],
+         [AC_MSG_ERROR([Found neither ncurses or termcap])])
+     AC_CHECK_LIB([edit], [readline],

diff --git a/sci-electronics/ngspice/ngspice-27.ebuild b/sci-electronics/ngspice/ngspice-27.ebuild
new file mode 100644
index 00000000000..c4b3ec1f76c
--- /dev/null
+++ b/sci-electronics/ngspice/ngspice-27.ebuild
@@ -0,0 +1,99 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools
+
+DESCRIPTION="The Next Generation Spice (Electronic Circuit Simulator)"
+SRC_URI="mirror://sourceforge/ngspice/${P}.tar.gz
+	doc? ( mirror://sourceforge/ngspice/${P}-manual.pdf )"
+HOMEPAGE="http://ngspice.sourceforge.net"
+LICENSE="BSD GPL-2"
+
+SLOT="0"
+IUSE="X debug doc fftw openmp readline"
+KEYWORDS="~amd64 ~ppc ~sparc ~x86 ~x64-macos"
+
+DEPEND="X? ( x11-libs/libICE
+		x11-libs/libXaw
+		x11-libs/libXext
+		x11-libs/libXmu )
+		fftw? ( sci-libs/fftw:3.0 )"
+RDEPEND="${DEPEND}
+	X? ( sci-visualization/xgraph )"
+
+DOCS=(
+	ANALYSES
+	AUTHORS
+	BUGS
+	ChangeLog
+	DEVICES
+	NEWS
+	README
+	Stuarts_Poly_Notes
+)
+
+PATCHES=(
+	"${FILESDIR}"/${P}-autoconf_fftw3.patch
+	"${FILESDIR}"/${P}-split_terminfo.patch
+)
+
+src_prepare() {
+	default
+	eautoreconf
+}
+
+src_configure() {
+	local myconf
+	if use debug ; then
+		myconf="--enable-debug \
+			--enable-ftedebug \
+			--enable-cpdebug \
+			--enable-sensdebug \
+			--enable-asdebug \
+			--enable-stepdebug \
+			--enable-pzdebug"
+	else
+		myconf="--disable-debug \
+			--disable-ftedebug \
+			--disable-cpdebug \
+			--disable-sensdebug \
+			--disable-asdebug \
+			--disable-stepdebug \
+			--disable-pzdebug"
+	fi
+	# As of December 2017, these do not compile
+	myconf="${myconf}
+		--disable-blktmsdebug \
+		--disable-smltmsdebug"
+
+	econf \
+		${myconf} \
+		--enable-xspice \
+		--enable-cider \
+		--enable-ndev \
+		--disable-xgraph \
+		--disable-dependency-tracking \
+		--disable-rpath \
+		$(use_enable openmp) \
+		$(use_with X x) \
+		$(use_with fftw fftw3) \
+		$(use_with readline)
+}
+
+# These will need to be looked at some day:
+# --enable-adms
+# --enable-nodelimiting
+# --enable-predictor
+# --enable-newtrunc
+
+src_install() {
+	default
+
+	# We don't need ngmakeidx to be installed
+	rm -f "${D}"/usr/bin/ngmakeidx
+	rm -f "${D}"/usr/share/man/man1/ngmakeidx.1
+
+	use doc && dodoc "${DISTDIR}"/${P}-manual.pdf
+}


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sci-electronics/ngspice/, sci-electronics/ngspice/files/
@ 2017-12-28 13:26 Marek Szuba
  0 siblings, 0 replies; 2+ messages in thread
From: Marek Szuba @ 2017-12-28 13:26 UTC (permalink / raw
  To: gentoo-commits

commit:     5e3a68ac72fd7e3da395fc9a055295e18c091fea
Author:     Marek Szuba <marecki <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 28 13:23:24 2017 +0000
Commit:     Marek Szuba <marecki <AT> gentoo <DOT> org>
CommitDate: Thu Dec 28 13:26:18 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5e3a68ac

sci-electronics/ngspice: support building shared libs and the Tcl module

Also a few dependency fixes + restrict tests again.

Submitted-by: Fabio Rossi <rossi.f <AT> inwind.it>
Closes: https://bugs.gentoo.org/632140
Package-Manager: Portage-2.3.13, Repoman-2.3.3

 .../files/ngspice-27-blt_linkage_workaround.patch  |  12 ++
 .../ngspice-27-fix_parsing_tcl_commands.patch      |  16 ++
 sci-electronics/ngspice/metadata.xml               |   3 +
 sci-electronics/ngspice/ngspice-27-r1.ebuild       | 189 +++++++++++++++++++++
 4 files changed, 220 insertions(+)

diff --git a/sci-electronics/ngspice/files/ngspice-27-blt_linkage_workaround.patch b/sci-electronics/ngspice/files/ngspice-27-blt_linkage_workaround.patch
new file mode 100644
index 00000000000..53415c748d6
--- /dev/null
+++ b/sci-electronics/ngspice/files/ngspice-27-blt_linkage_workaround.patch
@@ -0,0 +1,12 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -461,6 +461,9 @@
+         AC_MSG_ERROR([Couldn't find BLT])
+     fi
+     rm -f conftest.tcl
++
++    AC_SEARCH_LIBS([Blt_GetVector], [BLT BLT24 BLT25],,
++        [AC_MSG_ERROR([Couldnt find BLT library.])])
+     
+     AC_CHECK_LIB([pthread], [pthread_create])
+     

diff --git a/sci-electronics/ngspice/files/ngspice-27-fix_parsing_tcl_commands.patch b/sci-electronics/ngspice/files/ngspice-27-fix_parsing_tcl_commands.patch
new file mode 100644
index 00000000000..bad336590df
--- /dev/null
+++ b/sci-electronics/ngspice/files/ngspice-27-fix_parsing_tcl_commands.patch
@@ -0,0 +1,16 @@
+--- a/src/tclspice.c
++++ b/src/tclspice.c
+@@ -828,10 +828,9 @@
+     int i;
+     NG_IGNORE(clientData);
+     save_interp();
+-    /* Looks backwards through the first command and strips the :: part */
+-    for (i = strlen(argv[0])-1; i > 0; i--)
+-        if (argv[0][i] == *":")
+-            argv[0] += i + 1;
++    char *prefix = strstr(argv[0], "spice::");
++    if (prefix)
++        argv[0] = prefix + 7;
+     return _run(argc, (char **)argv);
+ }
+ 

diff --git a/sci-electronics/ngspice/metadata.xml b/sci-electronics/ngspice/metadata.xml
index 54267123c56..ed47ec5f170 100644
--- a/sci-electronics/ngspice/metadata.xml
+++ b/sci-electronics/ngspice/metadata.xml
@@ -9,6 +9,9 @@
 		Ngspice is a mixed-level/mixed-signal circuit simulator. Its code is based on
 		three open source software packages: Spice3f5, Cider1b1 and Xspice.
 	</longdescription>
+	<use>
+		<flag name="shared">Build ngspice as a shared library</flag>
+	</use>
 	<upstream>
 		<remote-id type="sourceforge">ngspice</remote-id>
 	</upstream>

diff --git a/sci-electronics/ngspice/ngspice-27-r1.ebuild b/sci-electronics/ngspice/ngspice-27-r1.ebuild
new file mode 100644
index 00000000000..372ba4f94d7
--- /dev/null
+++ b/sci-electronics/ngspice/ngspice-27-r1.ebuild
@@ -0,0 +1,189 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools multibuild toolchain-funcs
+
+DESCRIPTION="The Next Generation Spice (Electronic Circuit Simulator)"
+SRC_URI="mirror://sourceforge/ngspice/${P}.tar.gz
+	doc? ( mirror://sourceforge/ngspice/${P}-manual.pdf )"
+HOMEPAGE="http://ngspice.sourceforge.net"
+LICENSE="BSD GPL-2"
+
+SLOT="0"
+IUSE="X debug doc examples fftw openmp readline shared tcl"
+KEYWORDS="~amd64 ~ppc ~sparc ~x86 ~x64-macos"
+
+# See bug #642460
+RESTRICT="test"
+
+DEPEND="sys-libs/ncurses:0=
+	X? ( x11-libs/libXaw
+		x11-libs/libXt
+		x11-libs/libX11 )
+	fftw? ( sci-libs/fftw:3.0 )
+	readline? ( sys-libs/readline:0= )
+	tcl? ( dev-lang/tcl:0
+		dev-tcltk/blt )"
+RDEPEND="${DEPEND}
+	X? ( sci-visualization/xgraph )"
+
+DOCS=(
+	ANALYSES
+	AUTHORS
+	BUGS
+	ChangeLog
+	DEVICES
+	NEWS
+	README
+	Stuarts_Poly_Notes
+)
+
+PATCHES=(
+	"${FILESDIR}"/${P}-autoconf_fftw3.patch
+	"${FILESDIR}"/${P}-blt_linkage_workaround.patch
+	"${FILESDIR}"/${P}-fix_parsing_tcl_commands.patch
+	"${FILESDIR}"/${P}-split_terminfo.patch
+)
+
+pkg_setup() {
+	MULTIBUILD_VARIANTS=( "binaries" )
+	use shared && MULTIBUILD_VARIANTS+=( "shared" )
+	use tcl && MULTIBUILD_VARIANTS+=( "tcl" )
+	use openmp && tc-check-openmp
+}
+
+src_prepare() {
+	default
+
+	if use tcl; then
+		if use examples; then
+			find examples/tclspice -type f -iname \*tcl |
+			while read s
+			do
+				sed -i -e 's@../../../src/.libs/libspice.so@libspice.so@g' \
+					-e 's@package require BLT@package require Tk\npackage require BLT@g' \
+					-e "s@spice::codemodel \(.*\)/\(.*\).cm@spice::codemodel /usr/$(get_libdir)/ngspice/\2.cm@g" \
+					"${s}" || die "sed failed"
+			done
+		fi
+	fi
+
+	eautoreconf
+}
+
+src_configure() {
+	multibuild_copy_sources
+	multibuild_foreach_variant ngspice_configure
+}
+
+ngspice_configure() {
+	pushd "${BUILD_DIR}"
+
+	local myconf
+	if use debug; then
+		myconf="--enable-debug \
+			--enable-ftedebug \
+			--enable-cpdebug \
+			--enable-sensdebug \
+			--enable-asdebug \
+			--enable-stepdebug \
+			--enable-pzdebug"
+	else
+		myconf="--disable-debug \
+			--disable-ftedebug \
+			--disable-cpdebug \
+			--disable-sensdebug \
+			--disable-asdebug \
+			--disable-stepdebug \
+			--disable-pzdebug"
+	fi
+	# As of December 2017, these do not compile
+	myconf="${myconf} \
+		--disable-blktmsdebug \
+		--disable-smltmsdebug"
+
+	myconf="${myconf} \
+		--enable-xspice \
+		--enable-cider \
+		--enable-ndev \
+		--disable-xgraph \
+		--disable-dependency-tracking \
+		--disable-rpath \
+		$(use_enable openmp) \
+		$(use_with fftw fftw3) \
+		$(use_with readline)"
+
+	if [ "${MULTIBUILD_VARIANT}" == "shared" ]; then
+		myconf="${myconf} \
+			--with-ngshared"
+	elif [ "${MULTIBUILD_VARIANT}" == "tcl" ]; then
+		myconf="${myconf} \
+			--with-tcl"
+	else
+		myconf="${myconf} \
+			$(use_with X x)"
+	fi
+
+	econf ${myconf}
+}
+
+src_compile() {
+	multibuild_foreach_variant ngspice_compile
+}
+
+ngspice_compile() {
+	pushd "${BUILD_DIR}"
+	default
+}
+
+src_install() {
+	multibuild_foreach_variant ngspice_install
+
+	# merge the installations of all variants
+	for v in "${MULTIBUILD_VARIANTS[@]}" ; do
+		cp -a "${D}_${v}"/* "${D}" || die "Failed to combine multibuild installations"
+		rm -rf "${D}_${v}"
+	done
+
+	use tcl && DOCS+=( README.tcl )
+	use doc && DOCS+=( "${DISTDIR}"/${P}-manual.pdf )
+
+	default
+
+	# We don't need ngmakeidx to be installed
+	rm -f "${D}"/usr/bin/ngmakeidx
+	rm -f "${D}"/usr/share/man/man1/ngmakeidx.1
+
+	if use examples; then
+		use tcl || rm -rf examples/tclspice
+
+		insinto /usr/share/${PN}
+		doins -r examples
+	fi
+}
+
+ngspice_install() {
+	pushd "${BUILD_DIR}"
+
+	emake DESTDIR="${D}_${MULTIBUILD_VARIANT}" install
+
+	# Strip shared-library and Tcl-module builds to the bare minimum;
+	# all the support files will have been handled by the 'binaries' build.
+	if [ "${MULTIBUILD_VARIANT}" != "binaries" ]; then
+		rm -rf "${D}_${MULTIBUILD_VARIANT}"/usr/bin{,.debug}
+		rm -rf "${D}_${MULTIBUILD_VARIANT}"/usr/share
+		rm -rf "${D}_${MULTIBUILD_VARIANT}"/usr/$(get_libdir)/*.la
+		rm -rf "${D}_${MULTIBUILD_VARIANT}"/usr/$(get_libdir)/ngspice/*.cm{,.debug}
+	fi
+}
+
+src_test() {
+	multibuild_foreach_variant ngspice_test
+}
+
+ngspice_test() {
+	pushd "${BUILD_DIR}"
+	default
+}


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-12-28 13:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-28 13:26 [gentoo-commits] repo/gentoo:master commit in: sci-electronics/ngspice/, sci-electronics/ngspice/files/ Marek Szuba
  -- strict thread matches above, loose matches on Subject: below --
2017-12-27 12:01 Marek Szuba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox