commit:     e1b36d192e7db7f80004b55f513b0a621c8c503a
Author:     NRK <nrk <AT> disroot <DOT> org>
AuthorDate: Fri Jun 13 10:54:18 2025 +0000
Commit:     Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Sat Jun 21 04:33:11 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e1b36d19

x11-misc/clipmenu: add 9999 ebuild

this is in preparation for the next major release where the
project has been rewritten in C. some notable changes in the
ebuild:

- license changed to MIT per upstream
- enabled tests
- remove outdated dependencies and optfeature

Signed-off-by: NRK <nrk <AT> disroot.org>
Part-of: https://github.com/gentoo/gentoo/pull/42576
Closes: https://github.com/gentoo/gentoo/pull/42576
Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>

 x11-misc/clipmenu/clipmenu-9999.ebuild | 72 ++++++++++++++++++++++++++++++++++
 1 file changed, 72 insertions(+)

diff --git a/x11-misc/clipmenu/clipmenu-9999.ebuild 
b/x11-misc/clipmenu/clipmenu-9999.ebuild
new file mode 100644
index 000000000000..9fc0569ac533
--- /dev/null
+++ b/x11-misc/clipmenu/clipmenu-9999.ebuild
@@ -0,0 +1,72 @@
+# Copyright 2020-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit git-r3 systemd
+
+DESCRIPTION="Clipboard management"
+HOMEPAGE="https://github.com/cdown/clipmenu";
+EGIT_REPO_URI="https://github.com/cdown/clipmenu";
+EGIT_BRANCH="develop"
+
+LICENSE="MIT"
+SLOT="0"
+IUSE="+dmenu fzf rofi test"
+REQUIRED_USE="?? ( dmenu fzf rofi )"
+RESTRICT="!test? ( test )"
+
+DEPEND="
+       x11-libs/libX11
+       x11-libs/libXfixes
+"
+
+RDEPEND="
+       ${DEPEND}
+       dmenu? ( x11-misc/dmenu )
+       fzf? ( app-shells/fzf )
+       rofi? ( x11-misc/rofi )
+"
+
+src_prepare() {
+       default
+
+       if use rofi ; then
+               sed -i 's|"dmenu"|"rofi"|g' src/config.c || die "sed failed"
+       elif use fzf ; then
+               sed -i 's|"dmenu"|"fzf"|g'  src/config.c || die "sed failed"
+       fi
+}
+
+src_compile() {
+       emake CFLAGS="${CFLAGS}"
+       use test && emake CFLAGS="${CFLAGS}" tests/test_store
+}
+
+src_install() {
+       emake install DESTDIR="${D}" PREFIX="${EPREFIX}"/usr \
+               systemd_user_dir="${D}/$(systemd_get_userunitdir)"
+
+       einstalldocs
+}
+
+src_test() {
+       # NOTE(NRK): the "x_integration_tests" are not enabled as they would
+       # require additional setup and dependencies
+       emake tests
+}
+
+pkg_postinst() {
+       if systemd_is_booted || has_version sys-apps/systemd; then
+               einfo ""
+               einfo "Make sure to import \$DISPLAY when using the systemd 
unit for clipmenud."
+               einfo "Please see the README for more details."
+       fi
+
+       if ! use dmenu && ! use fzf && ! use rofi ; then
+               ewarn ""
+               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
+}

Reply via email to