commit:     fab6223dd54f049cf170e01e17e8aa1d6b2a7f0c
Author:     NRK <nrk <AT> disroot <DOT> org>
AuthorDate: Tue Nov 30 12:52:37 2021 +0000
Commit:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Fri Dec  3 13:02:25 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fab6223d

x11-misc/clipmenu: introduce different launcher options

while the default menu/frontend for clipmenu is dmenu, it can also work
with rofi, fzf or any other "menu" application and thus dmenu should not
be pulled in as a hard dep.

Closes: https://github.com/gentoo/gentoo/pull/23125
Signed-off-by: Nickolas Raymond Kaczynski <nrk <AT> disroot.org>
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>

 x11-misc/clipmenu/clipmenu-6.2.0-r1.ebuild | 57 ++++++++++++++++++++++++++++++
 x11-misc/clipmenu/clipmenu-6.2.0.ebuild    | 34 ------------------
 x11-misc/clipmenu/metadata.xml             |  5 +++
 3 files changed, 62 insertions(+), 34 deletions(-)

diff --git a/x11-misc/clipmenu/clipmenu-6.2.0-r1.ebuild 
b/x11-misc/clipmenu/clipmenu-6.2.0-r1.ebuild
new file mode 100644
index 000000000000..be3e66670c5d
--- /dev/null
+++ b/x11-misc/clipmenu/clipmenu-6.2.0-r1.ebuild
@@ -0,0 +1,57 @@
+# Copyright 2020-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit systemd
+
+DESCRIPTION="Clipboard management using dmenu"
+HOMEPAGE="https://github.com/cdown/clipmenu";
+SRC_URI="https://github.com/cdown/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="Unlicense"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="+dmenu rofi fzf"
+REQUIRED_USE="?? ( dmenu rofi fzf )"
+
+RDEPEND="
+       x11-misc/clipnotify
+       x11-misc/xsel
+       dmenu? ( x11-misc/dmenu )
+       rofi? ( x11-misc/rofi )
+       fzf? ( app-shells/fzf )
+"
+
+src_prepare() {
+       default
+
+       if use rofi ; then
+               sed -i 's|CM_LAUNCHER=dmenu|CM_LAUNCHER=rofi|' clipmenu || die 
"sed failed"
+       elif use fzf ; then
+               sed -i 's|CM_LAUNCHER=dmenu|CM_LAUNCHER=fzf|' clipmenu || die 
"sed failed"
+       fi
+}
+
+src_compile() {
+       :
+}
+
+src_install() {
+       local binfile
+       for binfile in clipctl clipdel clipfsck clipmenu clipmenud; do
+               dobin ${binfile}
+       done
+
+       dodoc README.md
+
+       systemd_douserunit "init/clipmenud.service"
+}
+
+pkg_postinst() {
+       if ! use dmenu && ! use rofi && ! use fzf ; then
+               ewarn "Clipmenu has been installed without a launcher."
+               ewarn "You will need to set \$CM_LAUNCHER to a dmenu-compatible 
app for clipmenu to work."
+               ewarn "Please refer to the documents for more info."
+       fi
+}

diff --git a/x11-misc/clipmenu/clipmenu-6.2.0.ebuild 
b/x11-misc/clipmenu/clipmenu-6.2.0.ebuild
deleted file mode 100644
index 5ae7092c8f4c..000000000000
--- a/x11-misc/clipmenu/clipmenu-6.2.0.ebuild
+++ /dev/null
@@ -1,34 +0,0 @@
-# Copyright 2020-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit systemd
-
-DESCRIPTION="Clipboard management using dmenu"
-HOMEPAGE="https://github.com/cdown/clipmenu";
-SRC_URI="https://github.com/cdown/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
-
-LICENSE="Unlicense"
-SLOT="0"
-KEYWORDS="amd64 x86"
-IUSE=""
-
-RDEPEND="
-       x11-misc/clipnotify
-       x11-misc/dmenu
-       x11-misc/xsel
-"
-
-src_compile() {
-       :
-}
-
-src_install() {
-       local binfile
-       for binfile in clipctl clipdel clipfsck clipmenu clipmenud; do
-               dobin ${binfile}
-       done
-
-       systemd_douserunit "init/clipmenud.service"
-}

diff --git a/x11-misc/clipmenu/metadata.xml b/x11-misc/clipmenu/metadata.xml
index a057b342f48a..ad77c07f77a8 100644
--- a/x11-misc/clipmenu/metadata.xml
+++ b/x11-misc/clipmenu/metadata.xml
@@ -9,4 +9,9 @@
                <email>[email protected]</email>
                <name>Proxy Maintainers</name>
        </maintainer>
+       <use>
+               <flag name="dmenu">Use dmenu as default launcher</flag>
+               <flag name="rofi">Use rofi as default launcher</flag>
+               <flag name="fzf">Use fzf as default launcher</flag>
+       </use>
 </pkgmetadata>

Reply via email to