Diff ngspice-27 with a ngspice-27-r1

/usr/portage/sci-electronics/ngspice/ngspice-27-r1.ebuild 2020-02-22 20:09:00.000000000 +0300
3 3

  
4 4
EAPI=6
5 5

  
6
inherit autotools
6
inherit autotools multibuild toolchain-funcs
7 7

  
8 8
DESCRIPTION="The Next Generation Spice (Electronic Circuit Simulator)"
9 9
SRC_URI="mirror://sourceforge/ngspice/${P}.tar.gz
......
12 12
LICENSE="BSD GPL-2"
13 13

  
14 14
SLOT="0"
15
IUSE="X debug doc fftw openmp readline"
15
IUSE="X debug doc examples fftw openmp readline +shared tcl"
16 16
KEYWORDS="~amd64 ~ppc ~sparc ~x86 ~x64-macos"
17 17

  
18
DEPEND="X? ( x11-libs/libICE
19
		x11-libs/libXaw
20
		x11-libs/libXext
21
		x11-libs/libXmu )
22
		fftw? ( sci-libs/fftw:3.0 )"
18
DEPEND="sys-libs/ncurses:0=
19
	X? ( x11-libs/libXaw
20
		x11-libs/libXt
21
		x11-libs/libX11 )
22
	fftw? ( sci-libs/fftw:3.0 )
23
	readline? ( sys-libs/readline:0= )
24
	tcl? ( dev-lang/tcl:0
25
		dev-tcltk/blt )"
23 26
RDEPEND="${DEPEND}
24 27
	X? ( sci-visualization/xgraph )"
25 28

  
......
36 39

  
37 40
PATCHES=(
38 41
	"${FILESDIR}"/${P}-autoconf_fftw3.patch
42
	"${FILESDIR}"/${P}-blt_linkage_workaround.patch
43
	"${FILESDIR}"/${P}-fix_parsing_tcl_commands.patch
39 44
	"${FILESDIR}"/${P}-split_terminfo.patch
40 45
)
41 46

  
47
pkg_setup() {
48
	MULTIBUILD_VARIANTS=( "binaries" )
49
	use shared && MULTIBUILD_VARIANTS+=( "shared" )
50
	use tcl && MULTIBUILD_VARIANTS+=( "tcl" )
51
	use openmp && tc-check-openmp
52
}
53

  
42 54
src_prepare() {
43 55
	default
56

  
57
	if use tcl; then
58
		if use examples; then
59
			find examples/tclspice -type f -iname \*tcl |
60
			while read s
61
			do
62
				sed -i -e 's@../../../src/.libs/libspice.so@libspice.so@g' \
63
					-e 's@package require BLT@package require Tk\npackage require BLT@g' \
64
					-e "s@spice::codemodel \(.*\)/\(.*\).cm@spice::codemodel /usr/$(get_libdir)/ngspice/\2.cm@g" \
65
					"${s}" || die "sed failed"
66
			done
67
		fi
68
	fi
69

  
44 70
	eautoreconf
45 71
}
46 72

  
47 73
src_configure() {
74
	multibuild_copy_sources
75
	multibuild_foreach_variant ngspice_configure
76
}
77

  
78
ngspice_configure() {
79
	pushd "${BUILD_DIR}"
80

  
48 81
	local myconf
49
	if use debug ; then
82
	if use debug; then
50 83
		myconf="--enable-debug \
51 84
			--enable-ftedebug \
52 85
			--enable-cpdebug \
......
64 97
			--disable-pzdebug"
65 98
	fi
66 99
	# As of December 2017, these do not compile
67
	myconf="${myconf}
100
	myconf="${myconf} \
68 101
		--disable-blktmsdebug \
69 102
		--disable-smltmsdebug"
70 103

  
71
	econf \
72
		${myconf} \
104
	myconf="${myconf} \
73 105
		--enable-xspice \
74 106
		--enable-cider \
75
		--enable-ndev \
76 107
		--disable-xgraph \
77 108
		--disable-rpath \
78 109
		$(use_enable openmp) \
79
		$(use_with X x) \
80 110
		$(use_with fftw fftw3) \
81
		$(use_with readline)
111
		$(use_with readline)"
112

  
113
	if [ "${MULTIBUILD_VARIANT}" == "shared" ]; then
114
		myconf="${myconf} \
115
			--with-ngshared"
116
	elif [ "${MULTIBUILD_VARIANT}" == "tcl" ]; then
117
		myconf="${myconf} \
118
			--with-tcl"
119
	else
120
		myconf="${myconf} \
121
			$(use_with X x)"
122
	fi
123

  
124
	econf ${myconf}
125
}
126

  
127
src_compile() {
128
	multibuild_foreach_variant ngspice_compile
129
}
130

  
131
ngspice_compile() {
132
	pushd "${BUILD_DIR}"
133
	default
82 134
}
83 135

  
84 136
src_install() {
137
	multibuild_foreach_variant ngspice_install
138

  
139
	# merge the installations of all variants
140
	for v in "${MULTIBUILD_VARIANTS[@]}" ; do
141
		cp -a "${D}_${v}"/* "${D}" || die "Failed to combine multibuild installations"
142
		rm -rf "${D}_${v}"
143
	done
144

  
145
	use tcl && DOCS+=( README.tcl )
146
	use doc && DOCS+=( "${DISTDIR}"/${P}-manual.pdf )
147

  
85 148
	default
86 149

  
87 150
	# We don't need ngmakeidx to be installed
88 151
	rm -f "${D}"/usr/bin/ngmakeidx
89 152
	rm -f "${D}"/usr/share/man/man1/ngmakeidx.1
90 153

  
91
	use doc && dodoc "${DISTDIR}"/${P}-manual.pdf
154
	if use examples; then
155
		use tcl || rm -rf examples/tclspice
156

  
157
		insinto /usr/share/${PN}
158
		doins -r examples
159
	fi
160
}
161

  
162
ngspice_install() {
163
	pushd "${BUILD_DIR}"
164

  
165
	emake DESTDIR="${D}_${MULTIBUILD_VARIANT}" install
166

  
167
	# Strip shared-library and Tcl-module builds to the bare minimum;
168
	# all the support files will have been handled by the 'binaries' build.
169
	if [ "${MULTIBUILD_VARIANT}" != "binaries" ]; then
170
		rm -rf "${D}_${MULTIBUILD_VARIANT}"/usr/bin{,.debug}
171
		rm -rf "${D}_${MULTIBUILD_VARIANT}"/usr/share
172
		rm -rf "${D}_${MULTIBUILD_VARIANT}"/usr/$(get_libdir)/*.la
173
		rm -rf "${D}_${MULTIBUILD_VARIANT}"/usr/$(get_libdir)/ngspice/*.cm{,.debug}
174
	fi
175
}
176

  
177
src_test() {
178
	if ! use debug; then
179
		multibuild_foreach_variant ngspice_test
180
	else
181
		# https://sourceforge.net/p/ngspice/bugs/353/
182
		ewarn
183
		ewarn "Skipping tests because they are known to fail in debug mode"
184
		ewarn
185
	fi
186
}
187

  
188
ngspice_test() {
189
	pushd "${BUILD_DIR}"
190
	default
92 191
}
Thank you!