summaryrefslogtreecommitdiff
blob: 8480ac47bc91eb6f8935d02aa95c4fc92f0f1111 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# 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)
}

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
}