summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Palimaka <kensington@gentoo.org>2017-09-10 01:00:14 +1000
committerMichael Palimaka <kensington@gentoo.org>2017-09-10 01:00:40 +1000
commit28d377022df4bf5de7697adfeb0d743e0dd63c34 (patch)
tree4ee3536f0cd50913b5d7a6dd7f9ef067cf298bb7 /sys-apps/razercfg
parentdev-libs/volume_key: Add missing REQUIRED_USE (diff)
downloadgentoo-28d377022df4bf5de7697adfeb0d743e0dd63c34.tar.gz
gentoo-28d377022df4bf5de7697adfeb0d743e0dd63c34.tar.bz2
gentoo-28d377022df4bf5de7697adfeb0d743e0dd63c34.zip
sys-apps/razercfg: revision bump with assorted fixes
* Use standard PYTHON_COMPAT format * Remove bogus inherits and sort * Use HTTPS for HOMEPAGE/SRC_URI * Remove bogus systemd USE flag that didn't control anything * Fix LICENSE * Sort dependencies * mycmakeargs must be declared local * Force using the correct udev and systmed unit locations * Avoid sandbox violations with systemd * Avoid systemd unit automagic installation * Misc tidying Closes: https://bugs.gentoo.org/623734 Package-Manager: Portage-2.3.6, Repoman-2.3.3
Diffstat (limited to 'sys-apps/razercfg')
-rw-r--r--sys-apps/razercfg/files/razercfg-0.39-unit-variables.patch21
-rw-r--r--sys-apps/razercfg/razercfg-0.39-r1.ebuild91
2 files changed, 112 insertions, 0 deletions
diff --git a/sys-apps/razercfg/files/razercfg-0.39-unit-variables.patch b/sys-apps/razercfg/files/razercfg-0.39-unit-variables.patch
new file mode 100644
index 000000000000..c17e529c49f2
--- /dev/null
+++ b/sys-apps/razercfg/files/razercfg-0.39-unit-variables.patch
@@ -0,0 +1,21 @@
+We set these variables in the ebuild, so don't override them.
+
+--- a/scripts/cmake.global
++++ b/scripts/cmake.global
+@@ -27,16 +27,6 @@
+ include_directories(AFTER ${LIBUSB_INCLUDE_PATH})
+ set(CMAKE_REQUIRED_INCLUDES "${LIBUSB_INCLUDE_PATH};${CMAKE_REQUIRED_INCLUDES}")
+
+-execute_process(COMMAND pkg-config --variable=systemdsystemunitdir systemd
+- OUTPUT_VARIABLE SYSTEMD_UNIT_DIR
+- ERROR_QUIET
+- OUTPUT_STRIP_TRAILING_WHITESPACE)
+-
+-execute_process(COMMAND pkg-config --variable=udevdir udev
+- OUTPUT_VARIABLE UDEV_DIR
+- ERROR_QUIET
+- OUTPUT_STRIP_TRAILING_WHITESPACE)
+-
+ macro(INSTALL_EXEC_CMD _COMMAND _FAILMSG)
+ install(CODE "
+ execute_process(COMMAND ${_COMMAND} RESULT_VARIABLE install_exec_res)
diff --git a/sys-apps/razercfg/razercfg-0.39-r1.ebuild b/sys-apps/razercfg/razercfg-0.39-r1.ebuild
new file mode 100644
index 000000000000..ec711690643a
--- /dev/null
+++ b/sys-apps/razercfg/razercfg-0.39-r1.ebuild
@@ -0,0 +1,91 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python{3_4,3_5,3_6} )
+
+inherit cmake-utils python-single-r1 systemd udev
+
+DESCRIPTION="Utility for advanced configuration of Razer mice"
+HOMEPAGE="https://bues.ch/cms/hacking/razercfg.html"
+SRC_URI="https://bues.ch/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="+pm-utils qt4 +udev"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="${PYTHON_DEPS}
+ virtual/libusb:1
+ pm-utils? ( sys-power/pm-utils )
+ qt4? ( >=dev-python/pyside-1.2.1[${PYTHON_USEDEP}] )
+ udev? ( virtual/udev )
+"
+DEPEND="${PYTHON_DEPS}
+ dev-python/setuptools[${PYTHON_USEDEP}]
+ virtual/libusb:1
+ virtual/pkgconfig
+"
+
+PATCHES=( "${FILESDIR}/${P}-unit-variables.patch" )
+
+src_prepare() {
+ default
+
+ sed -i CMakeLists.txt \
+ -e '/udevadm control/{N;d}' \
+ -e '/systemctl/{N;d}' \
+ -e "s:/etc/pm/sleep.d:/usr/$(get_libdir)/pm-utils/sleep.d/:" \
+ -e 's:50-razer:80razer:' \
+ || die
+
+ sed -i librazer/CMakeLists.txt \
+ -e '/ldconfig/{N;d}' \
+ -e "s:DESTINATION lib:DESTINATION $(get_libdir):" \
+ || die
+
+ sed -i razercfg.desktop.template \
+ -e '/^Categories=/s/=.*$/=Qt;Settings/' \
+ || die
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DPYTHON="${PYTHON}"
+ -DSYSTEMD_UNIT_DIR="$(systemd_get_systemunitdir)"
+ -DUDEV_DIR="$(get_udevdir)"
+ )
+ RAZERCFG_PKG_BUILD=1 cmake-utils_src_configure
+}
+
+src_install() {
+ RAZERCFG_PKG_BUILD=1 cmake-utils_src_install
+
+ newinitd "${FILESDIR}"/razerd.init.d-r2 razerd
+ dodoc README.* HACKING.* razer.conf
+
+ if ! use qt4; then
+ rm "${D%/}"/usr/bin/qrazercfg{,-applet} || die
+ rm "${D%/}"/usr/share/icons/hicolor/scalable/apps/razercfg* || die
+ rm "${D%/}"/usr/share/applications/razercfg.desktop || die
+ fi
+
+ if ! use pm-utils; then
+ rm "${D%/}/usr/$(get_libdir)/pm-utils/sleep.d/80razer" || die
+ fi
+}
+
+pkg_postinst() {
+ if use udev ; then
+ udevadm control --reload-rules
+ udevadm trigger --subsystem-match=usb
+ fi
+
+ if [[ -e "${ROOT%/}"/usr/bin/pyrazer.pyc ]]; then
+ eerror "A stale ${ROOT}usr/bin/pyrazer.pyc exists and will prevent"
+ eerror "the Python frontends from working until removed manually."
+ fi
+}