summaryrefslogtreecommitdiff
blob: 40371930052f23a3aa43e11e02526b60c3301597 (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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-admin/conky/conky-1.7.1.1-r2.ebuild,v 1.3 2009/12/31 14:00:00 ranger Exp $

EAPI="2"

inherit eutils

DESCRIPTION="An advanced, highly configurable system monitor for X"
HOMEPAGE="http://conky.sourceforge.net/"
SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"

LICENSE="GPL-3 BSD LGPL-2.1 MIT"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~ppc ~ppc64 ~sparc ~x86"
IUSE="alsa apcupsd audacious debug hddtemp imlib lua math moc mpd nano-syntax nvidia +portmon rss thinkpad truetype vim-syntax wifi X"
# currently removed openmp

DEPEND_COMMON="
	X? (
		x11-libs/libX11
		x11-libs/libXdamage
		x11-libs/libXext
		truetype? ( x11-libs/libXft >=media-libs/freetype-2 )
		imlib? ( media-libs/imlib2 )
		nvidia? ( media-video/nvidia-settings )
	)
	alsa? ( media-libs/alsa-lib )
	audacious? ( >=media-sound/audacious-1.5 )
	portmon? ( dev-libs/glib )
	lua? ( >=dev-lang/lua-5.1 )
	rss? ( dev-libs/libxml2 net-misc/curl dev-libs/glib )
	wifi? ( net-wireless/wireless-tools )
	"
#	openmp? ( >=sys-devel/gcc-4.3[openmp] )
RDEPEND="
	${DEPEND_COMMON}
	apcupsd? ( sys-power/apcupsd )
	hddtemp? ( app-admin/hddtemp )
	moc? ( media-sound/moc )
	nano-syntax? ( app-editors/nano )
	vim-syntax? ( || ( app-editors/vim app-editors/gvim ) )
	"
DEPEND="
	${DEPEND_COMMON}
	dev-util/pkgconfig
	"

src_prepare() {
	cp "${FILESDIR}"/conky_no_x11.conf data/
	epatch "${FILESDIR}"/"${P}"-comment.patch
}

src_configure() {
	local myconf
	if use X; then
		myconf="--enable-x11 --enable-double-buffer --enable-xdamage"
		myconf="${myconf} --enable-own-window $(use_enable truetype xft)"
	else
		myconf="--disable-x11 --disable-own-window"
	fi

	econf \
		${myconf} \
		$(use_enable alsa) \
		$(use_enable apcupsd) \
		$(use_enable audacious) \
		--disable-bmpx \
		$(use_enable debug) \
		$(use_enable hddtemp) \
		$(use_enable imlib imlib2) \
		$(use_enable lua) \
		$(use_enable thinkpad ibm) \
		$(use_enable math) \
		$(use_enable moc) \
		$(use_enable mpd) \
		$(use_enable nvidia) \
		$(use_enable rss) \
		$(use_enable wifi wlan) \
		$(use_enable portmon)
#		$(use_enable openmp) \
}

src_install() {
	emake DESTDIR="${D}" install || die "make install failed"
	dodoc ChangeLog AUTHORS TODO || die "dodoc failed"
	dohtml doc/docs.html doc/config_settings.html doc/variables.html \
		|| die "dohtml failed"

	if use vim-syntax; then
		insinto /usr/share/vim/vimfiles/ftdetect
		doins "${S}"/extras/vim/ftdetect/conkyrc.vim || die "doins failed"

		insinto /usr/share/vim/vimfiles/syntax
		doins "${S}"/extras/vim/syntax/conkyrc.vim|| die "doins failed"
	fi

	if use nano-syntax; then
		insinto /usr/share/nano/
		doins "${S}"/extras/nano/conky.nanorc|| die "doins failed"
	fi
}

pkg_postinst() {
	elog "You can find a sample configuration file at"
	elog "${ROOT%/}/etc/conky/conky.conf. To customize, copy"
	elog "it to ~/.conkyrc and edit it to your liking."
	elog
	elog "For more info on Conky's new features please look at"
	elog "the Changelog in ${ROOT%/}/usr/share/doc/${PF}"
	elog "There are also pretty html docs available"
	elog "on Conky's site or in ${ROOT%/}/usr/share/doc/${PF}/html"
	elog
	elog "Also see http://www.gentoo.org/doc/en/conky-howto.xml"
	elog
	elog "Vim syntax highlighting for conkyrc now enabled with"
	elog "USE=vim-syntax, for Nano with USE=nano-syntax"
	elog
}