summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Schmaus <flow@gentoo.org>2022-10-20 11:01:48 +0200
committerFlorian Schmaus <flow@gentoo.org>2022-10-20 12:52:37 +0200
commit850afc904a3c133d9bf360723973f916658416d2 (patch)
treec61336e82a598d40448c89f8d0a7e58a01d9ed98
parentwww-apps/gitea: Stabilize 1.17.3 amd64, #877707 (diff)
downloadgentoo-850afc904a3c133d9bf360723973f916658416d2.tar.gz
gentoo-850afc904a3c133d9bf360723973f916658416d2.tar.bz2
gentoo-850afc904a3c133d9bf360723973f916658416d2.zip
x11-misc/autorandr: fix non-systemd udev rule, add missing pkg_postrm
Also use PEP517 build mode. Closes: https://bugs.gentoo.org/803545 Signed-off-by: Florian Schmaus <flow@gentoo.org>
-rw-r--r--x11-misc/autorandr/autorandr-1.12.1-r2.ebuild (renamed from x11-misc/autorandr/autorandr-1.12.1-r1.ebuild)12
-rw-r--r--x11-misc/autorandr/autorandr-9999.ebuild7
-rw-r--r--x11-misc/autorandr/files/autorandr-Makefile-fix-install_udev-target-by-s-TARGETS-MAKECM.patch28
3 files changed, 47 insertions, 0 deletions
diff --git a/x11-misc/autorandr/autorandr-1.12.1-r1.ebuild b/x11-misc/autorandr/autorandr-1.12.1-r2.ebuild
index 0badb8f708aa..77f954a8aaa0 100644
--- a/x11-misc/autorandr/autorandr-1.12.1-r1.ebuild
+++ b/x11-misc/autorandr/autorandr-1.12.1-r2.ebuild
@@ -3,6 +3,7 @@
EAPI=7
+DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( python3_{8..11} )
inherit bash-completion-r1 distutils-r1 systemd udev
@@ -30,6 +31,11 @@ RDEPEND="
DEPEND="${RDEPEND}"
BDEPEND="virtual/pkgconfig"
+PATCHES=(
+ # https://github.com/phillipberndt/autorandr/pull/306
+ "${FILESDIR}"/autorandr-Makefile-fix-install_udev-target-by-s-TARGETS-MAKECM.patch
+)
+
src_compile() {
distutils-r1_src_compile
@@ -63,3 +69,9 @@ pkg_postinst() {
udev_reload
fi
}
+
+pkg_postrm() {
+ if use udev; then
+ udev_reload
+ fi
+}
diff --git a/x11-misc/autorandr/autorandr-9999.ebuild b/x11-misc/autorandr/autorandr-9999.ebuild
index 0badb8f708aa..7f0dd9c1da1b 100644
--- a/x11-misc/autorandr/autorandr-9999.ebuild
+++ b/x11-misc/autorandr/autorandr-9999.ebuild
@@ -3,6 +3,7 @@
EAPI=7
+DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( python3_{8..11} )
inherit bash-completion-r1 distutils-r1 systemd udev
@@ -63,3 +64,9 @@ pkg_postinst() {
udev_reload
fi
}
+
+pkg_postrm() {
+ if use udev; then
+ udev_reload
+ fi
+}
diff --git a/x11-misc/autorandr/files/autorandr-Makefile-fix-install_udev-target-by-s-TARGETS-MAKECM.patch b/x11-misc/autorandr/files/autorandr-Makefile-fix-install_udev-target-by-s-TARGETS-MAKECM.patch
new file mode 100644
index 000000000000..ff3b31d01326
--- /dev/null
+++ b/x11-misc/autorandr/files/autorandr-Makefile-fix-install_udev-target-by-s-TARGETS-MAKECM.patch
@@ -0,0 +1,28 @@
+From 4b8d397fc7a0d22a51ee13428ae13d892c0cc911 Mon Sep 17 00:00:00 2001
+From: Florian Schmaus <flo@geekplace.eu>
+Date: Thu, 20 Oct 2022 10:48:54 +0200
+Subject: [PATCH] Makefile: fix install_udev target by s/TARGETS/MAKECMDGOALS/
+
+A Gentoo user reported [1] that the 'install_udev' target would
+install a systemd-flavored udev rules, despite the 'systemd' target
+not being selected. Replacing 'TARGETS' with 'MAKECMDGOALS' in the
+Makefile rule fixes this .
+
+I am not sure where the TARGETS variable origniates from, but GNU make
+uses MAKECMDGOALS (FreeBSD make uses .TARGETS, i.e., with a leading
+dot). So if further portability between make variants is required,
+then this needs to be adjusted.
+
+1: https://bugs.gentoo.org/803545#c3
+Fixes: ae1f18a06039 ("udev rule: Dynamically call either systemd or autorandr directly depending on whether systemd unit is available")
+--- a/Makefile
++++ b/Makefile
+@@ -129,7 +129,7 @@ endif
+ install_udev:
+ $(if $(UDEV_RULES_DIR),,$(error UDEV_RULES_DIR is not defined))
+ mkdir -p ${DESTDIR}/${UDEV_RULES_DIR}/
+- echo 'ACTION=="change", SUBSYSTEM=="drm", RUN+="$(if $(findstring systemd, $(TARGETS)),/bin/systemctl start --no-block autorandr.service,${PREFIX}/bin/autorandr --batch --change --default default)"' > ${DESTDIR}/${UDEV_RULES_DIR}/40-monitor-hotplug.rules
++ echo 'ACTION=="change", SUBSYSTEM=="drm", RUN+="$(if $(findstring systemd, $(MAKECMDGOALS)),/bin/systemctl start --no-block autorandr.service,${PREFIX}/bin/autorandr --batch --change --default default)"' > ${DESTDIR}/${UDEV_RULES_DIR}/40-monitor-hotplug.rules
+ @echo
+ @echo "To activate the udev rules, run this command as root:"
+ @echo " udevadm control --reload-rules"