diff options
author | Peter Alfredsen <crabbedhaloablution@icloud.com> | 2020-12-19 21:50:25 +0100 |
---|---|---|
committer | Joonas Niilola <juippis@gentoo.org> | 2021-01-18 10:54:59 +0200 |
commit | 80e5d9524268b9897592f57de572545d16f25915 (patch) | |
tree | de8f6fd49cec05f9f395fe4ff019afeccaa498c1 /app-misc/g810-led/g810-led-0.4.2.ebuild | |
parent | mail-client/mutt-2.0.4-r1: revbump with patch for #765790 (diff) | |
download | gentoo-80e5d9524268b9897592f57de572545d16f25915.tar.gz gentoo-80e5d9524268b9897592f57de572545d16f25915.tar.bz2 gentoo-80e5d9524268b9897592f57de572545d16f25915.zip |
app-misc/g810-led: bump to 0.4.2 + various fixes
0.4.2 brings support for g815, builds with clang, and various minor fixes.
Ebuild fixes:
Create and populate /etc/g810-led/ as in upstream makefile so systemd
.services work.
Change udev rules to use uaccess instead of MODE="666".
Set CXX to system compiler
Build and use "bin-linked" g810-led. Same features, less space.
Include headers in install
Add pkg_postinst with hints about use
Closes: https://bugs.gentoo.org/696468
Closes: https://bugs.gentoo.org/729288
Package-Manager: Portage-3.0.12, Repoman-3.0.2
Signed-off-by: Peter Alfredsen <crabbedhaloablution@icloud.com>
Closes: https://github.com/gentoo/gentoo/pull/18730
Signed-off-by: Joonas Niilola <juippis@gentoo.org>
Diffstat (limited to 'app-misc/g810-led/g810-led-0.4.2.ebuild')
-rw-r--r-- | app-misc/g810-led/g810-led-0.4.2.ebuild | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/app-misc/g810-led/g810-led-0.4.2.ebuild b/app-misc/g810-led/g810-led-0.4.2.ebuild new file mode 100644 index 000000000000..5e5b098aef05 --- /dev/null +++ b/app-misc/g810-led/g810-led-0.4.2.ebuild @@ -0,0 +1,77 @@ +# Copyright 2018-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit eutils systemd toolchain-funcs udev + +DESCRIPTION="Led controller for Logitech G- Keyboards" +HOMEPAGE="https://github.com/MatMoul/g810-led" +SRC_URI="https://github.com/MatMoul/g810-led/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="GPL-3" +SLOT="0" +KEYWORDS="~amd64" +IUSE="+hidapi" + +RDEPEND=" + hidapi? ( dev-libs/hidapi:= ) + !hidapi? ( virtual/libusb:= ) + " +DEPEND="${RDEPEND}" + +DOCS=("README.md" "sample_profiles" "sample_effects") + +src_prepare() { + default + # See + # https://github.com/systemd/systemd/issues/4288 + # https://sourceforge.net/p/sigrok/mailman/sigrok-devel/thread/12691365.gQiffmFRoU%40pebbles.site/ + # We remove the MODE-bit since it's already set to 660+GROUP="input" by default udev rules + sed -i \ + -e 's|MODE="666"|TAG+="uaccess",|' \ + udev/g810-led.rules || die +} + +src_compile() { + emake LIB="$(usex hidapi hidapi libusb)" CXX="$(tc-getCXX)" bin-linked +} + +src_install() { + dolib.so "lib/libg810-led.so.${PV}" + dosym "libg810-led.so.${PV}" "/usr/$(get_libdir)/libg810-led.so" + + insinto /etc/g810-led/ + newins sample_profiles/group_keys profile + newins sample_profiles/all_off reboot + + dobin bin/g810-led + local boards=(213 410 413 512 513 610 815 910 pro) + local x + for x in "${boards[@]}"; do + dosym g810-led "/usr/bin/g${x}-led" + done + + insinto /usr/include/g810-led + doins src/classes/*.h + + systemd_dounit systemd/g810-led.service + systemd_dounit systemd/g810-led-reboot.service + + udev_newrules udev/g810-led.rules 60-g810-led.rules + + einstalldocs +} + +pkg_postinst() { + elog "The file /etc/g810-led/profile is run on boot and device insertion." + elog "The default file can be replaced by other examples:" + elog "/usr/share/doc/${PF}/sample_profiles" + elog "Read the documentation in:" + elog "/usr/share/doc/${PF}/" + elog "to make your own." + if systemd_is_booted; then + elog "To turn off the LEDs on shutdown and save power, do:" + elog "systemctl enable g810-led-reboot.service" + fi +} |