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

EAPI=7

inherit readme.gentoo-r1 cmake-utils udev user xdg

DESCRIPTION="Utility for advanced configuration of Roccat devices"

HOMEPAGE="http://roccat.sourceforge.net/"
SRC_URI="mirror://sourceforge/roccat/${P}.tar.bz2"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"

IUSE_INPUT_DEVICES=(
	input_devices_roccat_arvo
	input_devices_roccat_isku
	input_devices_roccat_iskufx
	input_devices_roccat_kiro
	input_devices_roccat_kone
	input_devices_roccat_koneplus
	input_devices_roccat_konepure
	input_devices_roccat_konepuremilitary
	input_devices_roccat_konepureoptical
	input_devices_roccat_konextd
	input_devices_roccat_konextdoptical
	input_devices_roccat_kovaplus
	input_devices_roccat_kova2016
	input_devices_roccat_lua
	input_devices_roccat_nyth
	input_devices_roccat_pyra
	input_devices_roccat_ryosmk
	input_devices_roccat_ryosmkfx
	input_devices_roccat_ryostkl
	input_devices_roccat_savu
	input_devices_roccat_skeltr
	input_devices_roccat_sova
	input_devices_roccat_suora
	input_devices_roccat_tyon
)

IUSE="${IUSE_INPUT_DEVICES[@]}"

LUA_DEPEND="|| ( dev-lang/lua:5.1 dev-lang/lua:0 )"

RDEPEND="
	dev-libs/dbus-glib
	dev-libs/glib:2
	>=dev-libs/libgaminggear-0.15.1
	dev-libs/libgudev:=
	sys-apps/dbus
	x11-libs/cairo
	x11-libs/gtk+:2
	x11-libs/libX11
	virtual/libusb:1
	input_devices_roccat_ryosmk? ( ${LUA_DEPEND} )
	input_devices_roccat_ryosmkfx? ( ${LUA_DEPEND} )
	input_devices_roccat_ryostkl? ( ${LUA_DEPEND} )
"

DEPEND="
	${RDEPEND}
"

DOCS=( Changelog KNOWN_LIMITATIONS README )

pkg_setup() {
	enewgroup roccat

	local model
	for model in ${IUSE_INPUT_DEVICES[@]} ; do
		use ${model} && USED_MODELS+="${model/input_devices_roccat_/;}"
	done
}

# Required because xdg.eclass overrides src_prepare() from cmake-utils.eclass
src_prepare() {
	cmake-utils_src_prepare
}

src_configure() {
	mycmakeargs=(
		-DDEVICES="${USED_MODELS/;/}"
		-DUDEVDIR="${EPREFIX}$(get_udevdir)/rules.d"
	)

	local lua_use=(
		input_devices_roccat_ryosmk
		input_devices_roccat_ryosmkfx
		input_devices_roccat_ryostkl
	)
	local luse
	for luse in ${lua_use[@]} ; do
		if use ${luse} ; then
			mycmakeargs+=( -DWITH_LUA="5.1" )
			break
		fi
	done

	cmake-utils_src_configure
}

src_install() {
	cmake-utils_src_install
	local stat_dir=/var/lib/roccat
	keepdir ${stat_dir}
	fowners root:roccat ${stat_dir}
	fperms 2770 ${stat_dir}
	readme.gentoo_create_doc
}

pkg_preinst() {
	xdg_pkg_preinst
}

pkg_postinst() {
	xdg_pkg_postinst
	readme.gentoo_print_elog
	ewarn
	ewarn "This version breaks stored data for some devices. Before reporting bugs please delete"
	ewarn "affected folder(s) in /var/lib/roccat"
	ewarn
}

pkg_postrm() {
	xdg_pkg_postrm
}