dev-cpp/pangomm: stable 2.42.1 for hppa, bug #717144
[gentoo.git] / sys-apps / roccat-tools / roccat-tools-5.9.0.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 inherit readme.gentoo-r1 cmake flag-o-matic toolchain-funcs udev user xdg
7
8 DESCRIPTION="Utility for advanced configuration of Roccat devices"
9
10 HOMEPAGE="http://roccat.sourceforge.net/"
11 SRC_URI="mirror://sourceforge/roccat/${P}.tar.bz2"
12 LICENSE="GPL-2"
13 SLOT="0"
14 KEYWORDS="~amd64 ~x86"
15
16 IUSE_INPUT_DEVICES=(
17         input_devices_roccat_arvo
18         input_devices_roccat_isku
19         input_devices_roccat_iskufx
20         input_devices_roccat_kiro
21         input_devices_roccat_kone
22         input_devices_roccat_koneplus
23         input_devices_roccat_konepure
24         input_devices_roccat_konepuremilitary
25         input_devices_roccat_konepureoptical
26         input_devices_roccat_konextd
27         input_devices_roccat_konextdoptical
28         input_devices_roccat_kovaplus
29         input_devices_roccat_kova2016
30         input_devices_roccat_lua
31         input_devices_roccat_nyth
32         input_devices_roccat_pyra
33         input_devices_roccat_ryosmk
34         input_devices_roccat_ryosmkfx
35         input_devices_roccat_ryostkl
36         input_devices_roccat_savu
37         input_devices_roccat_skeltr
38         input_devices_roccat_sova
39         input_devices_roccat_suora
40         input_devices_roccat_tyon
41 )
42
43 IUSE="${IUSE_INPUT_DEVICES[@]}"
44
45 LUA_DEPEND="|| ( dev-lang/lua:5.1 dev-lang/lua:0 )"
46
47 RDEPEND="
48         dev-libs/dbus-glib
49         dev-libs/glib:2
50         >=dev-libs/libgaminggear-0.15.1
51         dev-libs/libgudev:=
52         sys-apps/dbus
53         x11-libs/cairo
54         x11-libs/gtk+:2
55         x11-libs/libX11
56         virtual/libusb:1
57         input_devices_roccat_ryosmk? ( ${LUA_DEPEND} )
58         input_devices_roccat_ryosmkfx? ( ${LUA_DEPEND} )
59         input_devices_roccat_ryostkl? ( ${LUA_DEPEND} )
60 "
61
62 DEPEND="
63         ${RDEPEND}
64 "
65 BDEPEND="
66         virtual/pkgconfig
67 "
68
69 DOCS=( Changelog KNOWN_LIMITATIONS README )
70
71 pkg_setup() {
72         enewgroup roccat
73
74         local model
75         for model in ${IUSE_INPUT_DEVICES[@]} ; do
76                 use ${model} && USED_MODELS+="${model/input_devices_roccat_/;}"
77         done
78 }
79
80 # Required because xdg.eclass overrides src_prepare() from cmake.eclass
81 src_prepare() {
82         cmake_src_prepare
83 }
84
85 src_configure() {
86         if has_version \>=x11-libs/pango-1.44.0 ; then
87                 # Fix build with pango-1.44 which depends on harfbuzz
88                 local PKGCONF="$(tc-getPKG_CONFIG)"
89                 append-cflags "$(${PKGCONF} --cflags harfbuzz)"
90         fi
91
92         mycmakeargs=(
93                 -DDEVICES="${USED_MODELS/;/}"
94                 -DUDEVDIR="${EPREFIX}$(get_udevdir)/rules.d"
95         )
96
97         local lua_use=(
98                 input_devices_roccat_ryosmk
99                 input_devices_roccat_ryosmkfx
100                 input_devices_roccat_ryostkl
101         )
102         local luse
103         for luse in ${lua_use[@]} ; do
104                 if use ${luse} ; then
105                         mycmakeargs+=( -DWITH_LUA="5.1" )
106                         break
107                 fi
108         done
109
110         cmake_src_configure
111 }
112
113 src_install() {
114         cmake_src_install
115         local stat_dir=/var/lib/roccat
116         keepdir ${stat_dir}
117         fowners root:roccat ${stat_dir}
118         fperms 2770 ${stat_dir}
119         readme.gentoo_create_doc
120 }
121
122 pkg_postinst() {
123         xdg_pkg_postinst
124         readme.gentoo_print_elog
125         ewarn
126         ewarn "This version breaks stored data for some devices. Before reporting bugs please delete"
127         ewarn "affected folder(s) in /var/lib/roccat"
128         ewarn
129 }