From e7c2c077fc40e2f36fa5be5d92247c234e444062 Mon Sep 17 00:00:00 2001 From: Ceres Date: Sun, 4 Jan 2026 22:34:27 +0000 Subject: [PATCH] gui-wm/niri: new package, add 9999 Signed-off-by: Ceres --- gui-wm/niri/niri-9999.ebuild | 152 +++++++++++++++++++++++++++++++++++ 1 file changed, 152 insertions(+) create mode 100644 gui-wm/niri/niri-9999.ebuild diff --git a/gui-wm/niri/niri-9999.ebuild b/gui-wm/niri/niri-9999.ebuild new file mode 100644 index 0000000..8522ac8 --- /dev/null +++ b/gui-wm/niri/niri-9999.ebuild @@ -0,0 +1,152 @@ +# Copyright 2024-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +CRATES=" +" + +LLVM_COMPAT=( {18..21} ) +RUST_MIN_VER="1.82.0" + +inherit cargo llvm-r2 optfeature shell-completion systemd + +DESCRIPTION="Scrollable-tiling Wayland compositor" +HOMEPAGE="https://github.com/YaLTeR/niri" + +if [[ ${PV} == 9999 ]]; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/Naxdy/niri.git" +else + SRC_URI=" + https://github.com/Naxdy/niri/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz + https://github.com/Naxdy/niri/releases/download/v${PV}/${P}-vendored-dependencies.tar.xz + ${CARGO_CRATE_URIS} + " + KEYWORDS="~amd64" + + # used for version string + export NIRI_BUILD_COMMIT="b35bcae" +fi + +LICENSE="GPL-3+" +# Dependent crate licenses +LICENSE+=" + Apache-2.0 Apache-2.0-with-LLVM-exceptions BSD-2 BSD ISC MIT MPL-2.0 + Unicode-3.0 ZLIB +" +SLOT="0" +IUSE="+dbus screencast systemd" +REQUIRED_USE=" + screencast? ( dbus ) + systemd? ( dbus ) +" + +DEPEND=" + dev-libs/glib:2 + dev-libs/libinput:= + dev-libs/wayland + niri || die + "$(cargo_target_dir)"/niri completions fish > niri.fish || die + "$(cargo_target_dir)"/niri completions zsh > _niri || die +} + +src_install() { + cargo_src_install + + dobin resources/niri-session + systemd_douserunit resources/niri{.service,-shutdown.target} + + insinto /usr/share/wayland-sessions + doins resources/niri.desktop + + insinto /usr/share/xdg-desktop-portal + doins resources/niri-portals.conf + + dobashcomp niri + dofishcomp niri.fish + dozshcomp _niri +} + +src_test() { + # tests create a wayland socket in the xdg runtime dir + local -x XDG_RUNTIME_DIR="${T}/xdg" + mkdir "${XDG_RUNTIME_DIR}" || die + chmod 0700 "${XDG_RUNTIME_DIR}" || die + + # bug 950626 + # https://yalter.github.io/niri/Packaging-niri.html#running-tests + local -x RAYON_NUM_THREADS=2 + local skip=( + # requires surfacesless EGL to be available + --skip=::egl + ) + cargo_src_test -- --test-threads=2 "${skip[@]}" +} + +pkg_postinst() { + optfeature "Default application launcher" "gui-apps/fuzzel" + optfeature "Default status bar" "gui-apps/waybar" + optfeature "Default terminal" "x11-terms/alacritty" + optfeature "Xwayland support" "gui-apps/xwayland-satellite" +}