summaryrefslogtreecommitdiff
blob: 498298a62e6b6041f6b59d212e8bdf0e85a7e8a2 (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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI="5"

PYTHON_DEPEND="2:2.7"

inherit cmake-utils python versionator

MY_PN="cairo-dock-plug-ins"
MY_PV=$(get_version_component_range '1-2')
MY_PVL=$(get_version_component_range '1-3')

DESCRIPTION="The official set of plugins for cairo-dock"
HOMEPAGE="http://www.glx-dock.org"
SRC_URI="http://launchpad.net/${MY_PN}/${MY_PV}/${MY_PVL}/+download/${P}.tar.gz"

LICENSE="GPL-3"
SLOT="3"
KEYWORDS="~amd64"
IUSE="alsa disks doncky gmenu gnome kde nwmon scooby webkit xfce"

LANGS="ar cs de el en es et eu fr he hr hu id it ja lt nb nl pl pt_BR pt ru sk sr sv tr uk zh_CN zh_TW"
for lang in ${LANGS}; do
	IUSE+=" linguas_${lang}"
done
unset lang

RDEPEND="
	!x11-plugins/cairo-dock-plugins:2
	dev-libs/atk
	dev-libs/dbus-glib
	dev-libs/glib:2
	dev-libs/libical
	dev-libs/libxml2
	gnome-base/librsvg:2
	media-libs/fontconfig
	media-libs/freetype:2
	media-libs/libexif
	net-libs/libetpan
	net-misc/curl
	sys-apps/dbus
	virtual/glu
	virtual/libintl
	virtual/opengl
	sys-apps/lm_sensors
	sys-power/upower
	x11-libs/cairo
	x11-libs/gdk-pixbuf:2
	x11-libs/gtk+:3
	x11-libs/libxklavier
	x11-libs/libX11
	x11-libs/libXcomposite
	x11-libs/libXinerama
	x11-libs/libXrandr
	x11-libs/libXrender
	x11-libs/libXtst
	x11-libs/libXxf86vm
	x11-libs/pango[X]
	x11-libs/vte:2.90
	=x11-misc/cairo-dock-${MY_PVL}*:3
	alsa? ( media-libs/alsa-lib )
	gmenu? ( gnome-base/gnome-menus )
	kde? (
		kde-base/kdelibs
		dev-qt/qtcore )
	webkit? ( net-libs/webkit-gtk:3 )
	xfce? ( xfce-base/thunar )"

DEPEND="${RDEPEND}
	sys-devel/gettext
	virtual/pkgconfig
	x11-proto/xproto "

S="${WORKDIR}/${PN}-${MY_PVL}"

pkg_setup() {

	python_set_active_version 2
}

src_prepare() {

	# Following adjustments done by removing parts of the CMakeLists until upstream makes these parts configuration switches dependent.

	# Remove forced gcc optimization level

	sed -i -e 's/add_definitions (-O3)//' "${S}/CMakeLists.txt"  || die "sed failed"

	# Don't build code forcing unwanted automagic dependencies on unstable / controversial / huge stuff
	sed -i \
		-e '/INDICATOR-APPLET/,/SHARED LIBRARIES/d' \
		-e '/STATUS \"> Impulse:\"/,/\#\# ILLUSION/d' \
		-e '/RECENT-EVENTS/,/\#\# REMOTE/d' \
		"${S}/CMakeLists.txt" || die

	# Don't build ruby \(until clean install possible\) \/ mono and vala bindings {I know nothing about that stuff\.\.\.\}
	# Not really sure that escape sequences are needed as part of comments but... [Semi-Private joke]

	sed -i -e '/STATUS \" \* Ruby:\"/,/GETTEXT_DBUS/ { /GETTEXT_DBUS/ !{d}}' "${S}/CMakeLists.txt"  || die "sed failed"

	# Not really needed to explicitly remove as the status notifier won't get built anyway, but some do not like the look of the build log if it is not...

	sed -i -e '/STATUS NOTIFIER/,/\#\# SWITCHER/d' "${S}/CMakeLists.txt"  || die "sed failed"

	# Localization

	local lang

	if [[ -z ${LINGUAS} ]]; then
		touch po/slctd_linguas
	else
		for lang in ${LINGUAS}; do
			echo "\"${S}\"/po/${lang}.po" >> po/slctd_linguas
		done
	fi
	sed -e "s/^\(file (\)GLOB \(PO_FILES\).*$/\1STRINGS slctd_linguas \2)/" -i po/CMakeLists.txt  || die "sed failed"
}

src_configure() {

	# Don't use standard cmake-utils_use* functions because upstream tests STREQUAL "no/yes"

	local mycmakeargs=(
		"-DROOT_PREFIX=${D}"
		$(usex alsa "" "-Denable-alsa=no")
		$(usex disks "-Denable-disks=yes")
		$(usex doncky "-Denable-doncky=yes")
		$(usex gmenu "" "-Denable-gmenu=no")
		$(usex gnome "" "-Denable-gnome-integration=no")
		$(usex kde "-Denable-kde-integration=yes" "")
		$(usex nwmon "-Denable-network-monitor=yes" "")
		$(usex scooby "-Denable-scooby-do=yes" "")
		$(usex webkit "" "-Denable-weblets=no")
		$(usex xfce "" "-Denable-xfce-integration=no")
	)
	cmake-utils_src_configure
}