summaryrefslogtreecommitdiff
blob: 4d2fa874485409ae2c2c42552c5e2eb9cd883bb6 (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
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-editors/mp/mp-5.2.0.ebuild,v 1.2 2011/06/16 18:47:45 jer Exp $

EAPI="3"

inherit eutils toolchain-funcs

DESCRIPTION="Minimum Profit: A text editor for programmers"
HOMEPAGE="http://www.triptico.com/software/mp.html"
SRC_URI="http://www.triptico.com/download/${P}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-interix ~ppc-macos ~sparc-solaris ~x86-solaris"
IUSE="gtk iconv kde ncurses nls pcre qt4"

RDEPEND="
	ncurses? ( sys-libs/ncurses )
	gtk? ( x11-libs/gtk+:2 >=x11-libs/pango-1.8.0 )
	!gtk? ( sys-libs/ncurses )
	nls? ( sys-devel/gettext )
	pcre? ( dev-libs/libpcre )
	iconv? ( virtual/libiconv )
	app-text/grutatxt"
DEPEND="${RDEPEND}
	app-text/grutatxt
	dev-util/pkgconfig
	dev-lang/perl"

src_prepare() {
	epatch "${FILESDIR}"/${PN}-5.1.1-prll.patch \
		"${FILESDIR}"/${PN}-5.2.0-make.patch
}

src_configure() {
	local myconf="--prefix=${EPREFIX}/usr --without-win32"

	if use gtk; then
		! use ncurses && myconf="${myconf} --without-curses"
	else
		myconf="${myconf} --without-gtk2"
	fi

	use iconv || myconf="${myconf} --without-iconv"

	use kde || myconf="${myconf} --without-kde4"

	use nls || myconfig="${myconf} --without-gettext"

	myconf="${myconf} $(use_with pcre)"
	use pcre || myconf="${myconf} --with-included-regex"

	use qt4 || myconf="${myconf} --without-qt4"

	tc-export CC
	sh config.sh ${myconf} || die "Configure failed"

	for i in "${S}" "${S}"/mpsl "${S}"/mpdm;do
		echo ${CFLAGS} >> $i/config.cflags
		echo ${CFLAGS} >> $i/config.ldflags
		echo ${LDFLAGS} >> $i/config.ldflags
	done
}

src_install() {
	dodir /usr/bin
	sh config.sh --prefix="${EPREFIX}/usr"
	emake -j1 DESTDIR="${D}" install || die "Install Failed"
#	use gtk && dosym mp-5 /usr/bin/gmp
}

pkg_postinst() {
	if use gtk ; then
		einfo
		einfo "mp-5 is symlinked to gmp! Use"
		einfo "$ DISPLAY=\"\" mp-5"
		einfo "to use text mode!"
		einfo
	fi
}