summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaciej Barć <xgqt@gentoo.org>2022-09-21 00:59:28 +0200
committerMaciej Barć <xgqt@gentoo.org>2022-09-21 01:22:58 +0200
commit296847fca87cfc85db83f73e26acc2fb97b92c9f (patch)
treee8a2312c7e59dce1e8d5affa4f0b98f5e518cceb /sys-apps/openrazer
parentvirtual/dist-kernel: Stabilize 5.4.214 ppc64, #872098 (diff)
downloadgentoo-296847fca87cfc85db83f73e26acc2fb97b92c9f.tar.gz
gentoo-296847fca87cfc85db83f73e26acc2fb97b92c9f.tar.bz2
gentoo-296847fca87cfc85db83f73e26acc2fb97b92c9f.zip
sys-apps/openrazer: new package; add version 3.4.0
Signed-off-by: Maciej Barć <xgqt@gentoo.org>
Diffstat (limited to 'sys-apps/openrazer')
-rw-r--r--sys-apps/openrazer/Manifest1
-rw-r--r--sys-apps/openrazer/metadata.xml17
-rw-r--r--sys-apps/openrazer/openrazer-3.4.0.ebuild145
3 files changed, 163 insertions, 0 deletions
diff --git a/sys-apps/openrazer/Manifest b/sys-apps/openrazer/Manifest
new file mode 100644
index 000000000000..d02859ca045f
--- /dev/null
+++ b/sys-apps/openrazer/Manifest
@@ -0,0 +1 @@
+DIST openrazer-3.4.0.tar.gz 233490 BLAKE2B dc5236e75b998c72c4ebc2420d2c5f3d996af19e87d91d4d76dca7098c6120a12b642c314eca037973f140e4679ab42d0f25ce5225bc97d9839468f8325de56b SHA512 ba9efb3ce2736365e453328e81683368df0ef894ac44ac79c7b34c5bd782b9394170a9528d58db954da880f18a5e72a3d84810ec11b5b34845eee7daa9babd22
diff --git a/sys-apps/openrazer/metadata.xml b/sys-apps/openrazer/metadata.xml
new file mode 100644
index 000000000000..a3d8bb939e9f
--- /dev/null
+++ b/sys-apps/openrazer/metadata.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+
+<pkgmetadata>
+ <maintainer type="person">
+ <email>xgqt@gentoo.org</email>
+ <name>Maciej Barć</name>
+ </maintainer>
+ <use>
+ <flag name="client">Build the OpenRazer daemon client</flag>
+ <flag name="daemon">Build the OpenRazer daemon service</flag>
+ </use>
+ <upstream>
+ <bugs-to>https://github.com/openrazer/openrazer/issues/</bugs-to>
+ <remote-id type="github">openrazer/openrazer</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-apps/openrazer/openrazer-3.4.0.ebuild b/sys-apps/openrazer/openrazer-3.4.0.ebuild
new file mode 100644
index 000000000000..35081c80dc4b
--- /dev/null
+++ b/sys-apps/openrazer/openrazer-3.4.0.ebuild
@@ -0,0 +1,145 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{8..10} )
+
+inherit desktop systemd udev xdg-utils distutils-r1 python-r1 linux-mod
+
+DESCRIPTION="Drivers and user-space daemon to control Razer devices on GNU/Linux"
+HOMEPAGE="https://openrazer.github.io/
+ https://github.com/openrazer/openrazer/"
+SRC_URI="https://github.com/${PN}/${PN}/archive/v${PV}.tar.gz
+ -> ${P}.tar.gz"
+
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+IUSE="+client +daemon"
+REQUIRED_USE="
+ client? ( daemon )
+ daemon? ( ${PYTHON_REQUIRED_USE} )
+ test? ( daemon )
+"
+
+RDEPEND="
+ client? ( dev-python/numpy[${PYTHON_USEDEP}] )
+ daemon? (
+ acct-group/plugdev
+ dev-python/daemonize[${PYTHON_USEDEP}]
+ dev-python/dbus-python[${PYTHON_USEDEP}]
+ dev-python/notify2[${PYTHON_USEDEP}]
+ dev-python/pygobject:3[${PYTHON_USEDEP}]
+ dev-python/pyudev[${PYTHON_USEDEP}]
+ dev-python/setproctitle[${PYTHON_USEDEP}]
+ x11-libs/gtk+:3[introspection]
+ x11-misc/xautomation
+ x11-misc/xdotool
+ )
+"
+BDEPEND="
+ ${RDEPEND}
+ virtual/linux-sources
+"
+
+DOCS=( README.md )
+
+# This is a bit weird, but it's end result is what we want.
+BUILD_TARGETS="clean driver"
+BUILD_PARAMS="-C ${S} SUBDIRS=${S}/driver KERNELDIR=${KERNEL_DIR}"
+MODULE_NAMES="
+ razeraccessory(hid:${S}/driver)
+ razerkbd(hid:${S}/driver)
+ razerkraken(hid:${S}/driver)
+ razermouse(hid:${S}/driver)
+"
+
+distutils_enable_tests unittest
+
+python_compile() {
+ if use daemon ; then
+ ( cd "${S}"/daemon || die ; distutils-r1_python_compile )
+ fi
+ if use client ; then
+ ( cd "${S}"/pylib || die ; distutils-r1_python_compile )
+ fi
+}
+
+python_install() {
+ if use daemon ; then
+ ( cd "${S}"/daemon || die ; distutils-r1_python_install )
+ python_scriptinto /usr/bin
+ python_newscript "${S}"/daemon/run_openrazer_daemon.py ${PN}-daemon
+ fi
+ if use client ; then
+ ( cd "${S}"/pylib || die ; distutils-r1_python_install )
+ fi
+}
+
+src_prepare() {
+ xdg_environment_reset
+ distutils-r1_src_prepare
+
+ # Remove bad tests.
+ rm "${S}"/daemon/tests/test_effect_sync.py || die
+}
+
+src_compile() {
+ linux-mod_src_compile
+ distutils-r1_src_compile
+
+ if use daemon ; then
+ emake -C "${S}"/daemon PREFIX=/usr service
+ fi
+}
+
+src_test() {
+ ( cd "${S}"/daemon/tests || die ; distutils-r1_src_test )
+}
+
+src_install() {
+ linux-mod_src_install
+ distutils-r1_src_install
+
+ udev_dorules "${S}"/install_files/udev/99-razer.rules
+ exeinto "$(get_udevdir)"
+ doexe "${S}"/install_files/udev/razer_mount
+
+ # Install configuration example so that the daemon does not complain.
+ insinto /usr/share/${PN}
+ newins "${S}"/daemon/resources/razer.conf razer.conf.example
+
+ if use daemon ; then
+ # systemd units
+ systemd_dounit "${S}"/daemon/org.razer.service
+ systemd_dounit "${S}"/daemon/${PN}-daemon.service
+ # Manpages
+ doman "${S}"/daemon/resources/man/${PN}-daemon.8
+ doman "${S}"/daemon/resources/man/razer.conf.5
+ # Autostart menu
+ newicon logo/${PN}-chroma.svg ${PN}-daemon.svg
+ domenu "${S}"/install_files/desktop/${PN}-daemon.desktop
+ fi
+}
+
+pkg_postinst() {
+ linux-mod_pkg_postinst
+ udev_reload
+
+ if use daemon ; then
+ xdg_icon_cache_update
+ xdg_desktop_database_update
+ fi
+}
+
+pkg_postrm() {
+ linux-mod_pkg_postrm
+ udev_reload
+
+ if use daemon ; then
+ xdg_icon_cache_update
+ xdg_desktop_database_update
+ fi
+}