summaryrefslogtreecommitdiff
blob: 158e4af5f781668e7ebb9e1355a2808d1c1a4f59 (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
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=6

GNOME2_LA_PUNT="yes"

PYTHON_COMPAT=( python3_{7..9} )

PYTHON_REQ_USE="xml"

inherit gnome2 python-r1 vala

DESCRIPTION="Input assistive technology intended for switch and pointer users"
HOMEPAGE="https://wiki.gnome.org/Projects/Caribou"

LICENSE="LGPL-2.1"
SLOT="0"
KEYWORDS="~alpha amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 ~sparc x86"

IUSE=""
REQUIRED_USE="${PYTHON_REQUIRED_USE}"

COMMON_DEPEND="
	app-accessibility/at-spi2-core
	>=dev-python/pygobject-2.90.3:3[${PYTHON_USEDEP}]
	>=x11-libs/gtk+-3:3[introspection]
	x11-libs/gtk+:2
	>=dev-libs/gobject-introspection-0.10.7:=
	dev-libs/libgee:0.8
	dev-libs/libxml2
	>=media-libs/clutter-1.5.11:1.0[introspection]
	x11-libs/libX11
	x11-libs/libxklavier
	x11-libs/libXtst
	${PYTHON_DEPS}
	$(vala_depend)
"
# gsettings-desktop-schemas is needed for the 'toolkit-accessibility' key
# pyatspi-2.1.90 needed to run caribou if pygobject:3 is installed
# librsvg needed to load svg images in css styles
RDEPEND="${COMMON_DEPEND}
	dev-libs/glib[dbus]
	>=dev-python/pyatspi-2.1.90[${PYTHON_USEDEP}]
	>=gnome-base/gsettings-desktop-schemas-3
	gnome-base/librsvg:2
	sys-apps/dbus
	!<x11-base/xorg-server-1.20.10
"
DEPEND="${COMMON_DEPEND}
	dev-libs/libxslt
	>=dev-util/intltool-0.35.5
	virtual/pkgconfig
"

PATCHES=(
	"${FILESDIR}/${PN}-fix-compilation-error.patch"
	"${FILESDIR}/${PN}-fix-subkey-popmenu.patch"
	"${FILESDIR}/${PN}-fix-xadapter-xkb-calls.patch"
	"${FILESDIR}/${PN}-fix-antler-style-css.patch"
)

src_prepare() {
	# FIXME: Now this supports python3 too...
	# delete custom PYTHONPATH, useless on Gentoo and potential bug source
	# + caribou is python2 only so fix the shell scripts
#	sed -e '/export PYTHONPATH=.*python/ d' \
#		-e "s:@PYTHON@:${EPREFIX}/usr/bin/python2:" \
#		-i bin/{antler-keyboard,caribou-preferences}.in ||
#		die "sed failed"

	vala_src_prepare
	gnome2_src_prepare

	prepare_caribou() {
		mkdir -p "${BUILD_DIR}" || die
	}
	python_foreach_impl prepare_caribou
}

src_configure() {
	ECONF_SOURCE="${S}" python_foreach_impl run_in_build_dir \
		gnome2_src_configure \
			--disable-docs \
			--disable-static \
			--enable-gtk3-module \
			--enable-gtk2-module
}

src_compile() {
	python_foreach_impl run_in_build_dir gnome2_src_compile
}

src_test() {
	python_foreach_impl run_in_build_dir default
}

src_install() {
	python_foreach_impl run_in_build_dir gnome2_src_install

	# https://bugzilla.gnome.org/show_bug.cgi?id=769323
	dodoc AUTHORS NEWS README # ChangeLog simply points to git log
}