Diff ngspice-27-r1 with a ngspice-31-r1

/usr/portage/sci-electronics/ngspice/ngspice-31-r1.ebuild 2020-02-22 20:09:00.000000000 +0300
1 1
# Copyright 1999-2020 Gentoo Authors
2 2
# Distributed under the terms of the GNU General Public License v2
3 3

  
4
EAPI=6
4
EAPI=7
5 5

  
6
inherit autotools multibuild toolchain-funcs
6
inherit autotools multibuild toolchain-funcs virtualx
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 examples fftw openmp readline +shared tcl"
15
IUSE="X debug deprecated doc examples fftw openmp +readline +shared tcl"
16
RESTRICT="!test? ( test )"
16 17
KEYWORDS="~amd64 ~ppc ~sparc ~x86 ~x64-macos"
17 18

  
18 19
DEPEND="sys-libs/ncurses:0=
......
32 33
	BUGS
33 34
	ChangeLog
34 35
	DEVICES
36
	FAQ
35 37
	NEWS
36 38
	README
39
	README.vdmos
37 40
	Stuarts_Poly_Notes
38 41
)
39 42

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

  
47 43
pkg_setup() {
48 44
	MULTIBUILD_VARIANTS=( "binaries" )
49 45
	use shared && MULTIBUILD_VARIANTS+=( "shared" )
......
56 52

  
57 53
	if use tcl; then
58 54
		if use examples; then
59
			find examples/tclspice -type f -iname \*tcl |
55
			find examples/tclspice -type f -iname \*tcl -or -iname \*.sh |
60 56
			while read s
61 57
			do
62 58
				sed -i -e 's@../../../src/.libs/libspice.so@libspice.so@g' \
......
68 64
	fi
69 65

  
70 66
	eautoreconf
67
	multibuild_copy_sources
71 68
}
72 69

  
73 70
src_configure() {
74
	multibuild_copy_sources
75 71
	multibuild_foreach_variant ngspice_configure
76 72
}
77 73

  
78 74
ngspice_configure() {
79
	pushd "${BUILD_DIR}"
75
	local myeconfargs
76

  
77
	pushd "${BUILD_DIR}" &>/dev/null || die
80 78

  
81
	local myconf
82 79
	if use debug; then
83
		myconf="--enable-debug \
84
			--enable-ftedebug \
85
			--enable-cpdebug \
86
			--enable-sensdebug \
87
			--enable-asdebug \
88
			--enable-stepdebug \
89
			--enable-pzdebug"
80
		myeconfargs=(
81
			--enable-debug
82
			--enable-ftedebug
83
			--enable-cpdebug
84
			--enable-sensdebug
85
			--enable-asdebug
86
			--enable-stepdebug
87
			--enable-pzdebug
88
		)
90 89
	else
91
		myconf="--disable-debug \
92
			--disable-ftedebug \
93
			--disable-cpdebug \
94
			--disable-sensdebug \
95
			--disable-asdebug \
96
			--disable-stepdebug \
97
			--disable-pzdebug"
90
		myeconfargs=(
91
			--disable-debug
92
			--disable-ftedebug
93
			--disable-cpdebug
94
			--disable-sensdebug
95
			--disable-asdebug
96
			--disable-stepdebug
97
			--disable-pzdebug
98
		)
98 99
	fi
100

  
99 101
	# As of December 2017, these do not compile
100
	myconf="${myconf} \
101
		--disable-blktmsdebug \
102
		--disable-smltmsdebug"
103

  
104
	myconf="${myconf} \
105
		--enable-xspice \
106
		--enable-cider \
107
		--disable-xgraph \
108
		--disable-rpath \
109
		$(use_enable openmp) \
110
		$(use_with fftw fftw3) \
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"
102
	myeconfargs+=(
103
		--disable-blktmsdebug
104
		--disable-smltmsdebug
105
	)
106

  
107
	myeconfargs+=(
108
		--enable-xspice
109
		--enable-cider
110
		--disable-rpath
111
		$(use_enable openmp)
112
		$(use_with fftw fftw3)
113
		$(use_with readline)
114
	)
115

  
116
	if [[ "${MULTIBUILD_VARIANT}" == "shared" ]]; then
117
		myeconfargs+=( --with-ngshared )
118
	elif [[ "${MULTIBUILD_VARIANT}" == "tcl" ]]; then
119
		myeconfargs+=( --with-tcl="${EPREFIX}/usr/$(get_libdir)" )
119 120
	else
120
		myconf="${myconf} \
121
			$(use_with X x)"
121
		myeconfargs+=(
122
			$(use_enable deprecated oldapps)
123
			$(use_with X x)
124
		)
122 125
	fi
123 126

  
124
	econf ${myconf}
127
	econf "${myeconfargs[@]}"
128

  
129
	popd &>/dev/null || die
125 130
}
126 131

  
127 132
src_compile() {
......
129 134
}
130 135

  
131 136
ngspice_compile() {
132
	pushd "${BUILD_DIR}"
137
	pushd "${BUILD_DIR}" &>/dev/null || die
133 138
	default
139
	popd &>/dev/null || die
134 140
}
135 141

  
136 142
src_install() {
137 143
	multibuild_foreach_variant ngspice_install
138 144

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

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

  
148 156
	default
149 157

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

  
154 158
	if use examples; then
155
		use tcl || rm -rf examples/tclspice
159
		if ! use tcl; then
160
			rm -rf examples/tclspice || die
161
		fi
156 162

  
157 163
		insinto /usr/share/${PN}
158 164
		doins -r examples
......
160 166
}
161 167

  
162 168
ngspice_install() {
163
	pushd "${BUILD_DIR}"
169
	pushd "${BUILD_DIR}" &>/dev/null || die
164 170

  
165
	emake DESTDIR="${D}_${MULTIBUILD_VARIANT}" install
171
	emake DESTDIR="${ED}/tmp/${MULTIBUILD_VARIANT}" install
166 172

  
167 173
	# Strip shared-library and Tcl-module builds to the bare minimum;
168 174
	# 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}
175
	if [[ "${MULTIBUILD_VARIANT}" != "binaries" ]]; then
176
		rm -rf "${ED}/tmp/${MULTIBUILD_VARIANT}"/usr/bin{,.debug} || die
177
		rm -rf "${ED}/tmp/${MULTIBUILD_VARIANT}"/usr/share || die
178
		rm -rf "${ED}/tmp/${MULTIBUILD_VARIANT}"/usr/$(get_libdir)/*.la || die
179
		rm -rf "${ED}/tmp/${MULTIBUILD_VARIANT}"/usr/$(get_libdir)/ngspice/*.cm{,.debug} || die
174 180
	fi
181

  
182
	popd &>/dev/null || die
175 183
}
176 184

  
177 185
src_test() {
178 186
	if ! use debug; then
179
		multibuild_foreach_variant ngspice_test
187
		# tests can be only executed for the binaries variant
188
		pushd "${WORKDIR}/${P}-binaries" &>/dev/null || die
189
		virtx default
190
		popd &>/dev/null || die
180 191
	else
181 192
		# https://sourceforge.net/p/ngspice/bugs/353/
182 193
		ewarn
......
184 195
		ewarn
185 196
	fi
186 197
}
187

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