summaryrefslogtreecommitdiff
blob: 7cfff2e666998828a65f9431914040dd31e29c5e (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
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sci-electronics/gspiceui/gspiceui-1.1.0.ebuild,v 1.1 2015/07/04 07:09:07 tomjbe Exp $

EAPI="5"

WX_GTK_VER="3.0"
inherit eutils wxwidgets

MY_P="${PN}-v${PV}0"

DESCRIPTION="GUI frontend for Ngspice and Gnucap"
HOMEPAGE="http://www.geda.seul.org/tools/gspiceui/"
SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.gz"

LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="examples schematics waveform"

DEPEND="x11-libs/wxGTK:3.0[X]
	sci-electronics/electronics-menu"
RDEPEND="${DEPEND}
	|| ( sci-electronics/ngspice sci-electronics/gnucap )
	waveform? ( sci-electronics/gwave )
	schematics? ( sci-electronics/geda )"

S="${WORKDIR}/${MY_P}"

src_prepare() {
	# Use Gentoo LDFLAGS and CXXFLAGS
	epatch "${FILESDIR}/${P}-flags.patch"

	# Adjusting the doc path at src/main/HelpTasks.cpp
	sed -i -e \
		"s:/share/gspiceui/html/User-Manual.html:/share/doc/${PF}/html/User-Manual.html:g" \
		src/main/HelpTasks.cpp || die

	# Adjusting call to gwave program
	sed -i -e "s/gwave2/gwave/g" src/TypeDefs.hpp || die
}

src_install() {
	dobin bin/gspiceui
	dodoc ChangeLog ReadMe ToDo release-notes-v1.1.00.txt
	doman gspiceui.1
	newicon src/icons/gspiceui-48x48.xpm gspiceui.xpm

	dohtml html/*.html html/*.jpg html/*.png

	# installing examples and according model and symbol files
	if use examples ; then
		insinto /usr/share/doc/${PF}/sch
		doins -r sch/*
		insinto /usr/share/doc/${PF}/lib
		doins -r lib/*
	fi

	make_desktop_entry gspiceui "GNU Spice GUI" gspiceui "Electronics"
}

pkg_postinst() {
	if use examples ; then
		elog "If you want to use the examples, copy and extract from"
		elog "/usr/share/doc/${PF} the sch and lib directory"
		elog "side by side to your home directory to be able"
		elog "to generate the netlists as normal user."
	fi
}