Gentoo Archives: gentoo-commits

From: Andrew Ammerlaan <andrewammerlaan@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/guru:master commit in: x11-misc/autorandr/
Date: Fri, 25 Jun 2021 10:11:32
Message-Id: 1624611647.af1e115fb6a78f87f3d658ce534245060c8c1a05.andrewammerlaan@gentoo
1 commit: af1e115fb6a78f87f3d658ce534245060c8c1a05
2 Author: Florian Schmaus <flow <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jun 25 08:02:25 2021 +0000
4 Commit: Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
5 CommitDate: Fri Jun 25 09:00:47 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=af1e115f
7
8 x11-misc/autorandr: overhaul
9
10 Signed-off-by: Florian Schmaus <flow <AT> gentoo.org>
11
12 x11-misc/autorandr/autorandr-1.11.ebuild | 47 +++++++++++++++++++-------------
13 x11-misc/autorandr/autorandr-9999.ebuild | 47 +++++++++++++++++++-------------
14 x11-misc/autorandr/metadata.xml | 3 +-
15 3 files changed, 57 insertions(+), 40 deletions(-)
16
17 diff --git a/x11-misc/autorandr/autorandr-1.11.ebuild b/x11-misc/autorandr/autorandr-1.11.ebuild
18 index b2efd0cc5..e3e0a318b 100644
19 --- a/x11-misc/autorandr/autorandr-1.11.ebuild
20 +++ b/x11-misc/autorandr/autorandr-1.11.ebuild
21 @@ -10,7 +10,7 @@ if [[ "${PV}" = "9999" ]] ; then
22 EGIT_REPO_URI="https://github.com/phillipberndt/${PN}.git"
23 else
24 SRC_URI="https://github.com/phillipberndt/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
25 - KEYWORDS="~amd64"
26 + KEYWORDS="~amd64 ~x86"
27 fi
28
29 DESCRIPTION="Automatically select a display configuration based on connected devices"
30 @@ -18,36 +18,45 @@ HOMEPAGE="https://github.com/phillipberndt/autorandr"
31
32 LICENSE="GPL-3"
33 SLOT="0"
34 -IUSE="bash-completion systemd udev"
35 +IUSE="bash-completion +launcher systemd udev"
36
37 +RDEPEND="
38 + launcher? ( x11-libs/libxcb )
39 + udev? ( virtual/udev )
40 +"
41 DEPEND="
42 virtual/pkgconfig
43 ${RDEPEND}
44 "
45 -RDEPEND="
46 - bash-completion? ( app-shells/bash )
47 - systemd? ( sys-apps/systemd )
48 - udev? ( virtual/udev )
49 -"
50
51 -src_install() {
52 - targets="autorandr autostart_config"
53 - if use bash-completion; then
54 - targets="$targets bash_completion"
55 - fi
56 - if use systemd; then
57 - targets="$targets systemd"
58 - fi
59 - if use udev; then
60 - targets="$targets udev"
61 +src_prepare() {
62 + default
63 + sed -i 's/TARGETS=/TARGETS?=/' Makefile || die
64 +}
65 +
66 +src_compile() {
67 + if use launcher; then
68 + emake contrib/autorandr_launcher/autorandr-launcher
69 fi
70 +}
71 +
72 +src_install() {
73 + doman autorandr.1
74 +
75 + local targets=(
76 + autorandr
77 + autostart_config
78 + $(usex bash-completion bash_completion "")
79 + $(usev launcher)
80 + $(usev systemd)
81 + $(usev udev)
82 + )
83
84 emake DESTDIR="${D}" \
85 - install \
86 BASH_COMPLETIONS_DIR="$(get_bashcompdir)" \
87 SYSTEMD_UNIT_DIR="$(systemd_get_systemunitdir)" \
88 UDEV_RULES_DIR="$(get_udevdir)"/rules.d \
89 - TARGETS="$targets"
90 + $(printf "install_%s " "${targets[@]}")
91 }
92
93 pkg_postinst() {
94
95 diff --git a/x11-misc/autorandr/autorandr-9999.ebuild b/x11-misc/autorandr/autorandr-9999.ebuild
96 index b2efd0cc5..e3e0a318b 100644
97 --- a/x11-misc/autorandr/autorandr-9999.ebuild
98 +++ b/x11-misc/autorandr/autorandr-9999.ebuild
99 @@ -10,7 +10,7 @@ if [[ "${PV}" = "9999" ]] ; then
100 EGIT_REPO_URI="https://github.com/phillipberndt/${PN}.git"
101 else
102 SRC_URI="https://github.com/phillipberndt/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
103 - KEYWORDS="~amd64"
104 + KEYWORDS="~amd64 ~x86"
105 fi
106
107 DESCRIPTION="Automatically select a display configuration based on connected devices"
108 @@ -18,36 +18,45 @@ HOMEPAGE="https://github.com/phillipberndt/autorandr"
109
110 LICENSE="GPL-3"
111 SLOT="0"
112 -IUSE="bash-completion systemd udev"
113 +IUSE="bash-completion +launcher systemd udev"
114
115 +RDEPEND="
116 + launcher? ( x11-libs/libxcb )
117 + udev? ( virtual/udev )
118 +"
119 DEPEND="
120 virtual/pkgconfig
121 ${RDEPEND}
122 "
123 -RDEPEND="
124 - bash-completion? ( app-shells/bash )
125 - systemd? ( sys-apps/systemd )
126 - udev? ( virtual/udev )
127 -"
128
129 -src_install() {
130 - targets="autorandr autostart_config"
131 - if use bash-completion; then
132 - targets="$targets bash_completion"
133 - fi
134 - if use systemd; then
135 - targets="$targets systemd"
136 - fi
137 - if use udev; then
138 - targets="$targets udev"
139 +src_prepare() {
140 + default
141 + sed -i 's/TARGETS=/TARGETS?=/' Makefile || die
142 +}
143 +
144 +src_compile() {
145 + if use launcher; then
146 + emake contrib/autorandr_launcher/autorandr-launcher
147 fi
148 +}
149 +
150 +src_install() {
151 + doman autorandr.1
152 +
153 + local targets=(
154 + autorandr
155 + autostart_config
156 + $(usex bash-completion bash_completion "")
157 + $(usev launcher)
158 + $(usev systemd)
159 + $(usev udev)
160 + )
161
162 emake DESTDIR="${D}" \
163 - install \
164 BASH_COMPLETIONS_DIR="$(get_bashcompdir)" \
165 SYSTEMD_UNIT_DIR="$(systemd_get_systemunitdir)" \
166 UDEV_RULES_DIR="$(get_udevdir)"/rules.d \
167 - TARGETS="$targets"
168 + $(printf "install_%s " "${targets[@]}")
169 }
170
171 pkg_postinst() {
172
173 diff --git a/x11-misc/autorandr/metadata.xml b/x11-misc/autorandr/metadata.xml
174 index 2c524f589..bc2b0d691 100644
175 --- a/x11-misc/autorandr/metadata.xml
176 +++ b/x11-misc/autorandr/metadata.xml
177 @@ -6,7 +6,6 @@
178 <name>Florian Schmaus</name>
179 </maintainer>
180 <use>
181 - <flag name="systemd">Install autorand systemd files</flag>
182 - <flag name="udev">Use udev for monitor detection</flag>
183 + <flag name="launcher">Install the launcher</flag>
184 </use>
185 </pkgmetadata>