commit:     af1e115fb6a78f87f3d658ce534245060c8c1a05
Author:     Florian Schmaus <flow <AT> gentoo <DOT> org>
AuthorDate: Fri Jun 25 08:02:25 2021 +0000
Commit:     Florian Schmaus <flow <AT> gentoo <DOT> org>
CommitDate: Fri Jun 25 09:00:47 2021 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=af1e115f

x11-misc/autorandr: overhaul

Signed-off-by: Florian Schmaus <flow <AT> gentoo.org>

 x11-misc/autorandr/autorandr-1.11.ebuild | 47 +++++++++++++++++++-------------
 x11-misc/autorandr/autorandr-9999.ebuild | 47 +++++++++++++++++++-------------
 x11-misc/autorandr/metadata.xml          |  3 +-
 3 files changed, 57 insertions(+), 40 deletions(-)

diff --git a/x11-misc/autorandr/autorandr-1.11.ebuild 
b/x11-misc/autorandr/autorandr-1.11.ebuild
index b2efd0cc5..e3e0a318b 100644
--- a/x11-misc/autorandr/autorandr-1.11.ebuild
+++ b/x11-misc/autorandr/autorandr-1.11.ebuild
@@ -10,7 +10,7 @@ if [[ "${PV}" = "9999" ]] ; then
        EGIT_REPO_URI="https://github.com/phillipberndt/${PN}.git";
 else
        SRC_URI="https://github.com/phillipberndt/${PN}/archive/${PV}.tar.gz -> 
${P}.tar.gz"
-       KEYWORDS="~amd64"
+       KEYWORDS="~amd64 ~x86"
 fi
 
 DESCRIPTION="Automatically select a display configuration based on connected 
devices"
@@ -18,36 +18,45 @@ HOMEPAGE="https://github.com/phillipberndt/autorandr";
 
 LICENSE="GPL-3"
 SLOT="0"
-IUSE="bash-completion systemd udev"
+IUSE="bash-completion +launcher systemd udev"
 
+RDEPEND="
+       launcher? ( x11-libs/libxcb )
+       udev? ( virtual/udev )
+"
 DEPEND="
        virtual/pkgconfig
        ${RDEPEND}
 "
-RDEPEND="
-       bash-completion? ( app-shells/bash )
-       systemd? ( sys-apps/systemd )
-       udev? ( virtual/udev )
-"
 
-src_install() {
-       targets="autorandr autostart_config"
-       if use bash-completion; then
-               targets="$targets bash_completion"
-       fi
-       if use systemd; then
-               targets="$targets systemd"
-       fi
-       if use udev; then
-               targets="$targets udev"
+src_prepare() {
+       default
+       sed -i 's/TARGETS=/TARGETS?=/' Makefile || die
+}
+
+src_compile() {
+       if use launcher; then
+               emake contrib/autorandr_launcher/autorandr-launcher
        fi
+}
+
+src_install() {
+       doman autorandr.1
+
+       local targets=(
+               autorandr
+               autostart_config
+               $(usex bash-completion bash_completion "")
+               $(usev launcher)
+               $(usev systemd)
+               $(usev udev)
+       )
 
        emake DESTDIR="${D}" \
-                 install \
                  BASH_COMPLETIONS_DIR="$(get_bashcompdir)" \
                  SYSTEMD_UNIT_DIR="$(systemd_get_systemunitdir)" \
                  UDEV_RULES_DIR="$(get_udevdir)"/rules.d \
-                 TARGETS="$targets"
+                 $(printf "install_%s " "${targets[@]}")
 }
 
 pkg_postinst() {

diff --git a/x11-misc/autorandr/autorandr-9999.ebuild 
b/x11-misc/autorandr/autorandr-9999.ebuild
index b2efd0cc5..e3e0a318b 100644
--- a/x11-misc/autorandr/autorandr-9999.ebuild
+++ b/x11-misc/autorandr/autorandr-9999.ebuild
@@ -10,7 +10,7 @@ if [[ "${PV}" = "9999" ]] ; then
        EGIT_REPO_URI="https://github.com/phillipberndt/${PN}.git";
 else
        SRC_URI="https://github.com/phillipberndt/${PN}/archive/${PV}.tar.gz -> 
${P}.tar.gz"
-       KEYWORDS="~amd64"
+       KEYWORDS="~amd64 ~x86"
 fi
 
 DESCRIPTION="Automatically select a display configuration based on connected 
devices"
@@ -18,36 +18,45 @@ HOMEPAGE="https://github.com/phillipberndt/autorandr";
 
 LICENSE="GPL-3"
 SLOT="0"
-IUSE="bash-completion systemd udev"
+IUSE="bash-completion +launcher systemd udev"
 
+RDEPEND="
+       launcher? ( x11-libs/libxcb )
+       udev? ( virtual/udev )
+"
 DEPEND="
        virtual/pkgconfig
        ${RDEPEND}
 "
-RDEPEND="
-       bash-completion? ( app-shells/bash )
-       systemd? ( sys-apps/systemd )
-       udev? ( virtual/udev )
-"
 
-src_install() {
-       targets="autorandr autostart_config"
-       if use bash-completion; then
-               targets="$targets bash_completion"
-       fi
-       if use systemd; then
-               targets="$targets systemd"
-       fi
-       if use udev; then
-               targets="$targets udev"
+src_prepare() {
+       default
+       sed -i 's/TARGETS=/TARGETS?=/' Makefile || die
+}
+
+src_compile() {
+       if use launcher; then
+               emake contrib/autorandr_launcher/autorandr-launcher
        fi
+}
+
+src_install() {
+       doman autorandr.1
+
+       local targets=(
+               autorandr
+               autostart_config
+               $(usex bash-completion bash_completion "")
+               $(usev launcher)
+               $(usev systemd)
+               $(usev udev)
+       )
 
        emake DESTDIR="${D}" \
-                 install \
                  BASH_COMPLETIONS_DIR="$(get_bashcompdir)" \
                  SYSTEMD_UNIT_DIR="$(systemd_get_systemunitdir)" \
                  UDEV_RULES_DIR="$(get_udevdir)"/rules.d \
-                 TARGETS="$targets"
+                 $(printf "install_%s " "${targets[@]}")
 }
 
 pkg_postinst() {

diff --git a/x11-misc/autorandr/metadata.xml b/x11-misc/autorandr/metadata.xml
index 2c524f589..bc2b0d691 100644
--- a/x11-misc/autorandr/metadata.xml
+++ b/x11-misc/autorandr/metadata.xml
@@ -6,7 +6,6 @@
        <name>Florian Schmaus</name>
 </maintainer>
 <use>
-       <flag name="systemd">Install autorand systemd files</flag>
-       <flag name="udev">Use udev for monitor detection</flag>
+       <flag name="launcher">Install the launcher</flag>
 </use>
 </pkgmetadata>

Reply via email to