summaryrefslogtreecommitdiff
blob: c3784e17a861e100b6845b8d9c87439370500ef5 (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
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sci-mathematics/wxmaxima/wxmaxima-12.09.0.ebuild,v 1.2 2013/04/09 06:40:05 jlec Exp $

EAPI=5

WX_GTK_VER="2.8"

inherit eutils gnome2-utils wxwidgets fdo-mime

MYP=wxMaxima-${PV}

DESCRIPTION="Graphical frontend to Maxima, using the wxWidgets toolkit."
HOMEPAGE="http://wxmaxima.sourceforge.net/"
SRC_URI="mirror://sourceforge/${PN}/${MYP}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~ppc ~x86"

DEPEND="
	dev-libs/libxml2:2
	x11-libs/wxGTK:${WX_GTK_VER}"
RDEPEND="${DEPEND}
	media-fonts/jsmath
	sci-visualization/gnuplot[wxwidgets]
	sci-mathematics/maxima"

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

src_prepare() {
	local i

	# consistent package names
	sed -e "s:\${datadir}/wxMaxima:\${datadir}/${PN}:g" \
		-i Makefile.in data/Makefile.in || die "sed failed"

	sed -e 's:share/wxMaxima:share/wxmaxima:g' \
		-i src/wxMaxima.cpp src/wxMaximaFrame.cpp src/Config.cpp \
		|| die "sed failed"

	# correct gettext behavior
	if [[ -n "${LINGUAS+x}" ]] ; then
		for i in $(cd "${S}"/locales ; echo *.mo) ; do
			if ! has ${i%.mo} ${LINGUAS} ; then
				sed -i \
					-e "/^WXMAXIMA_LINGUAS/s# ${i%.mo}##" \
					-e "/^WXWIN_LINGUAS/s# ${i%.mo}##" \
					locales/Makefile.in || die
			fi
		done
	fi
}

src_configure() {
	econf \
		--enable-printing \
		--with-wx-config=${WX_CONFIG}
}

src_install () {
	default
	doicon -s 128 data/wxmaxima.png
	make_desktop_entry wxmaxima wxMaxima wxmaxima
	dosym /usr/share/${PN}/README /usr/share/doc/${PF}/README
}

pkg_preinst() {
	gnome2_icon_savelist
}

pkg_postinst() {
	gnome2_icon_cache_update
	fdo-mime_desktop_database_update
}

pkg_postrm() {
	gnome2_icon_cache_update
	fdo-mime_desktop_database_update
}