summaryrefslogtreecommitdiff
blob: 149fdb5814333f69fa5f895d0c7a7fed24ad8c08 (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-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-libs/libdbusmenu/libdbusmenu-0.5.1.ebuild,v 1.3 2011/11/20 12:41:25 pacho Exp $

EAPI=4

inherit eutils versionator virtualx

MY_MAJOR_VERSION="$(get_version_component_range 1-2)"
if version_is_at_least "${MY_MAJOR_VERSION}.50" ; then
	MY_MAJOR_VERSION="$(get_major_version).$(($(get_version_component_range 2)+1))"
fi

DESCRIPTION="Library to pass menu structure across DBus"
HOMEPAGE="https://launchpad.net/dbusmenu"
SRC_URI="http://launchpad.net/dbusmenu/${MY_MAJOR_VERSION}/${PV}/+download/${P}.tar.gz"

LICENSE="LGPL-3"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="gtk gtk3 +introspection test vala"

RDEPEND="
	dev-libs/glib:2
	dev-libs/dbus-glib
	dev-libs/libxml2:2
	gtk? (
		gtk3? ( x11-libs/gtk+:3 )
		!gtk3? ( x11-libs/gtk+:2 )
	)
"

DEPEND="${RDEPEND}
	introspection? ( >=dev-libs/gobject-introspection-0.6.7 )
	test? (
		dev-libs/json-glib[introspection?]
		dev-util/dbus-test-runner
	)
	vala? ( dev-lang/vala:0.14 )
	app-text/gnome-doc-utils
	dev-util/intltool
	dev-util/pkgconfig
"

REQUIRED_USE="vala? ( introspection )"

src_prepare() {
	# Drop DEPRECATED flags, bug #391103
	sed -i -e 's:-D[A-Z_]*DISABLE_DEPRECATED:$(NULL):g' \
		libdbusmenu-glib/Makefile.am libdbusmenu-glib/Makefile.in \
		libdbusmenu-gtk/Makefile.am libdbusmenu-gtk/Makefile.in \
		tests/Makefile.am tests/Makefile.in \
		configure.ac configure || die
}

src_configure() {
	local gtkconf
	if use gtk3 ; then
		gtkconf=" --with-gtk=3"
	else
		gtkconf=" --with-gtk=2"
	fi

	VALA_API_GEN=$(type -p vapigen-0.14) \
		econf \
		${gtkconf} \
		$(use_enable gtk) \
		$(use_enable gtk dumper) \
		$(use_enable introspection) \
		$(use_enable test tests) \
		$(use_enable vala)
}

src_test() {
	Xemake check || die "testsuite failed"
}

src_install() {
	MAKEOPTS="-j1" default
}