Upstream has a lot more make options for compilation that currently configurable via USE flags: https://github.com/jarun/nnn/wiki/Developer-guides#make-options I updated and tested the ebuild on amd64 hardware with different USE flag combinations. I'm still a bit unsure whether this does or does not violate the "When not to use USE Flags?" paragraph from the dev manual. Changes: - added <changelog> to metadata.xml - added USE flags batchrename, debug, discardfilter, fifo, mouse, only-c-locale, session, ug, unsorted, X - inherit xdg instead of xdg-utils and drop unnecessary pkg_postrm, which fixes > QA Notice: new icons have been found installed but icon cache has not been updated From 893365f4ed52d671406234396f7f6fcf2f880644 Mon Sep 17 00:00:00 2001 From: Lucio Sauer <watermanpaint@posteo.net> Date: Fri, 10 Feb 2023 05:56:09 +0100 Subject: [PATCH] app-misc/nnn: add USE flags to reflect upstream configuration options add <changelog> to metadata.xml inherit xdg instead of xdg-utils to fix "QA Notice: new icons have been found installed but icon cache has not been updated" Signed-off-by: Lucio Sauer <watermanpaint@posteo.net> --- app-misc/nnn/metadata.xml | 19 ++++-- app-misc/nnn/nnn-4.7-r2.ebuild | 105 +++++++++++++++++++++++++++++++++ 2 files changed, 120 insertions(+), 4 deletions(-) create mode 100644 app-misc/nnn/nnn-4.7-r2.ebuild diff --git a/app-misc/nnn/metadata.xml b/app-misc/nnn/metadata.xml index 780adc28a98..dc5f51e8c3d 100644 --- a/app-misc/nnn/metadata.xml +++ b/app-misc/nnn/metadata.xml @@ -10,17 +10,28 @@ <name>Proxy Maintainers</name> </maintainer> <upstream> + <changelog>https://github.com/jarun/nnn/blob/master/CHANGELOG</changelog> <remote-id type="github">jarun/nnn</remote-id> </upstream> <use> <flag name="8contexts">Enable 8 contexts (instead of 4)</flag> - <flag name="qsort">Use Alexey Tourbin's quick sort implementation</flag> - <flag name="icons">Display icons using icons-in-terminal</flag> - <flag name="nerdfonts">Display icons using nerdfonts icons</flag> - <flag name="emoji">Display icons using emoji</flag> + <flag name="batchrename">Enable built-in feature-limited batch renamer</flag> <flag name="colemak">Key bindings for Colemak-DH keyboard layout</flag> + <flag name="debug">Log additional debug information in /tmp or if unsuccessful in the working directory</flag> + <flag name="discardfilter">Discard filter key when there is no match</flag> + <flag name="emoji">Display icons using emoji</flag> + <flag name="fifo">Allow creation of named pipe NNN_FIFO to write hovered file path to</flag> <flag name="gitstatus">Add git status column to the detail view</flag> + <flag name="icons">Display icons using icons-in-terminal</flag> + <flag name="mouse">Support mouse input</flag> <flag name="namefirst">Print filenames first in the detail view</flag> + <flag name="nerdfonts">Display icons using nerdfonts icons</flag> + <flag name="only-c-locale">Build only the C locale</flag> + <flag name="qsort">Use Alexey Tourbin's quick sort implementation</flag> <flag name="restorepreview">Add pipe to close and restore preview-tui for internal undetached edits</flag> + <flag name="session">Allow for persistent session support (nnn -S)</flag> + <flag name="ug">Allow addition of user and group details to the status bar (nnn -U)</flag> + <flag name="unsorted">Load directories unsorted. Useful in type-to-nav mode</flag> + <flag name="X">Allow notification on cp, mv, rm completion, selection sync to system clipboard and xterm title advertisement on directory change (nnn -x)</flag> </use> </pkgmetadata> diff --git a/app-misc/nnn/nnn-4.7-r2.ebuild b/app-misc/nnn/nnn-4.7-r2.ebuild new file mode 100644 index 00000000000..76f87159b98 --- /dev/null +++ b/app-misc/nnn/nnn-4.7-r2.ebuild @@ -0,0 +1,105 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit bash-completion-r1 flag-o-matic toolchain-funcs xdg + +DESCRIPTION="The missing terminal file browser for X" +HOMEPAGE="https://github.com/jarun/nnn" +SRC_URI="https://github.com/jarun/nnn/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="BSD-2" +SLOT="0" +KEYWORDS="~amd64 ~ppc64 ~x86" +IUSE="+readline 8contexts batchrename colemak debug discardfilter emoji fifo + gitstatus icons mouse namefirst nerdfonts only-c-locale pcre qsort + restorepreview session ug unsorted X" + +DEPEND="sys-libs/ncurses:= + pcre? ( dev-libs/libpcre ) + readline? ( sys-libs/readline:= ) + elibc_musl? ( sys-libs/fts-standalone )" +BDEPEND="virtual/pkgconfig" +RDEPEND="${DEPEND}" +# O_NOLC is ignored if any of O_{EMOJI,ICONS,NERD} apply (see Makefile comments) +REQUIRED_USE="?? ( icons nerdfonts emoji only-c-locale )" + +src_prepare() { + default + tc-export CC + use elibc_musl && append-flags "-lfts" + # When using nnn's bundled patches, the 'install' target should not depend + # on 'all'. See: https://github.com/jarun/nnn/issues/1493 + sed -i -e 's/install: all/install:/' Makefile || die "sed failed" +} + +src_compile() { + nnn_opts=( + O_CTX8=$(usex 8contexts 1 0) + O_DEBUG=$(usex debug 1 0) + O_EMOJI=$(usex emoji 1 0) + O_ICONS=$(usex icons 1 0) + O_MATCHFLTR=$(usex discardfilter 1 0) + O_NERD=$(usex nerdfonts 1 0) + O_NOBATCH=$(usex batchrename 0 1) + O_NOFIFO=$(usex fifo 0 1) + O_NOLC=$(usex only-c-locale 1 0) + O_NOMOUSE=$(usex mouse 0 1) + O_NORL=$(usex readline 0 1) + O_NOSORT=$(usex unsorted 1 0) + O_NOSSN=$(usex session 0 1) + O_NOUG=$(usex ug 0 1) + O_NOX11=$(usex X 0 1) + O_PCRE=$(usex pcre 1 0) + O_QSORT=$(usex qsort 1 0) + # nnn's user-submitted patches + O_COLEMAK=$(usex colemak 1 0) + O_GITSTATUS=$(usex gitstatus 1 0) + O_NAMEFIRST=$(usex namefirst 1 0) + O_RESTOREPREVIEW=$(usex restorepreview 1 0) + ) + emake "${nnn_opts[@]}" +} + +src_install() { + emake PREFIX="${EPREFIX}/usr" DESTDIR="${D}" install + + emake PREFIX="${EPREFIX}/usr" DESTDIR="${D}" install-desktop + + newbashcomp misc/auto-completion/bash/nnn-completion.bash nnn + + insinto /usr/share/fish/vendor_completions.d + doins misc/auto-completion/fish/nnn.fish + + insinto /usr/share/zsh/site-functions + doins misc/auto-completion/zsh/_nnn + + einstalldocs + + insinto /usr/share/nnn + insopts -m0755 + doins -r plugins + fperms 0644 /usr/share/nnn/plugins/README.md +} + +pkg_postinst() { + xdg_pkg_postinst + + elog "nnn plugins are installed to /usr/share/nnn/plugins/, but nnn does not" + elog "load them fom this directory. You will need to copy/symlink them to" + elog "~/.config/nnn/plugins/ if you want to use them." + elog "Note that some plugins have runtime dependencies that may need to be installed." + elog "Refer to the individual plugin's in-file documentation for more information." + + if use icons; then + elog "In order for file icons to work, your terminal needs to use icons-in-terminal." + elog "See https://github.com/sebastiencs/icons-in-terminal" + elif use nerdfonts; then + elog "In order for file icons to work, your terminal needs to use a patched nerdfont." + elog "See https://www.nerdfonts.com/" + elif use emoji; then + elog "In order for file icons to work, your terminal needs to use a font that" + elog "includes standard unicode emoji." + fi +} -- 2.39.1 Reproducible: Always
Forgot to post `emerge --info` but I doubt it is of use here: Portage 3.0.43 (python 3.10.9-final-0, default/linux/amd64/17.1/hardened/selinux, gcc-12, glibc-2.36-r5, 5.15.88-gentoo-x86_64 x86_64) ================================================================= System uname: Linux-5.15.88-gentoo-x86_64-x86_64-Intel-R-_Core-TM-_i5-6600K_CPU_@_3.50GHz-with-glibc2.36 KiB Mem: 16338864 total, 7940984 free KiB Swap: 0 total, 0 free Timestamp of repository gentoo: Fri, 10 Feb 2023 03:15:01 +0000 Head commit of repository gentoo: c035192e22ba5714ccc15672f335e9b97aaeb568 Timestamp of repository gentoo-zh: Thu, 09 Feb 2023 18:47:12 +0000 Head commit of repository gentoo-zh: 4d12f96d6502eede9cb25ee33c2ca09d3909d325 Timestamp of repository guru: Thu, 09 Feb 2023 18:47:25 +0000 Head commit of repository guru: daf4c12f3adbeac595d45d6317a94e3e3de849ce Timestamp of repository steam-overlay: Tue, 07 Feb 2023 14:47:33 +0000 Head commit of repository steam-overlay: 8121a25bc99056e35ab2dd7924bb01ad8f80df8d sh bash 5.1_p16-r2 ld GNU ld (Gentoo 2.39 p5) 2.39.0 app-misc/pax-utils: 1.3.5::gentoo app-shells/bash: 5.1_p16-r2::gentoo dev-java/java-config: 2.3.1::gentoo dev-lang/perl: 5.36.0-r1::gentoo dev-lang/python: 3.10.9-r1::gentoo, 3.11.1-r1::gentoo dev-lang/rust: 1.66.1::gentoo dev-util/cmake: 3.25.2::gentoo dev-util/meson: 0.64.1::gentoo sec-policy/selinux-base: 2.20221101-r3::gentoo sys-apps/baselayout: 2.9::gentoo sys-apps/openrc: 0.45.2-r2::gentoo sys-apps/sandbox: 2.29::gentoo sys-devel/autoconf: 2.13-r7::gentoo, 2.71-r5::gentoo sys-devel/automake: 1.16.5::gentoo sys-devel/binutils: 2.39-r4::gentoo sys-devel/binutils-config: 5.4.1::gentoo sys-devel/clang: 15.0.7-r1::gentoo sys-devel/gcc: 12.2.1_p20230121-r1::gentoo sys-devel/gcc-config: 2.8::gentoo sys-devel/libtool: 2.4.7-r1::gentoo sys-devel/lld: 15.0.7::gentoo sys-devel/llvm: 15.0.7::gentoo sys-devel/make: 4.3::gentoo sys-kernel/linux-headers: 5.15-r3::gentoo (virtual/os-headers) sys-libs/glibc: 2.36-r5::gentoo sys-libs/libselinux: 3.4::gentoo Repositories: gentoo location: /var/db/repos/gentoo sync-type: rsync sync-uri: rsync://rsync.de.gentoo.org/gentoo-portage/ priority: -1000 volatile: True sync-rsync-verify-max-age: 24 sync-rsync-verify-metamanifest: yes sync-rsync-extra-opts: sync-rsync-verify-jobs: 1 gentoo-zh location: /var/db/repos/gentoo-zh sync-type: git sync-uri: https://github.com/gentoo-mirror/gentoo-zh.git masters: gentoo volatile: True guru location: /var/db/repos/guru sync-type: git sync-uri: https://github.com/gentoo-mirror/guru.git masters: gentoo volatile: True local location: /var/db/repos/local masters: gentoo volatile: True steam-overlay location: /var/db/repos/steam-overlay sync-type: git sync-uri: https://github.com/gentoo-mirror/steam-overlay.git masters: gentoo volatile: True ACCEPT_KEYWORDS="amd64" ACCEPT_LICENSE="@FREE" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=native -O2 -pipe" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c" CXXFLAGS="-march=native -O2 -pipe" DISTDIR="/var/cache/distfiles" EMERGE_DEFAULT_OPTS="--ask" ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME" FCFLAGS="-march=native -O2 -pipe" FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch preserve-libs protect-owned qa-unresolved-soname-deps sandbox selinux sesandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr" FFLAGS="-march=native -O2 -pipe" GENTOO_MIRRORS="https://packages.hs-regensburg.de/gentoo-distfiles/ https://ftp.fau.de/gentoo/" LANG="en_US.UTF-8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" LEX="flex" MAKEOPTS="-j4" PKGDIR="/var/cache/binpkgs" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git" PORTAGE_TMPDIR="/var/tmp" SHELL="/bin/bash" USE="X acl amd64 audit bzip2 caps cdr cet clang cli crypt dbus dri dvd elogind fortran gdbm hardened iconv ipv6 jpeg libglvnd libtirpc man matroska metric multilib ncurses nls nptl openmp pam pcre pie png policykit pulseaudio readline seccomp selinux split-usr ssl ssp test-rust unicode xattr xtpax zlib" ABI_X86="64" ADA_TARGET="gnat_2021" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="libinput wacom" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LLVM_TARGETS="NVPTX" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-4 php8-0" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_10" PYTHON_TARGETS="python3_10" RUBY_TARGETS="ruby27" USERLAND="GNU" VIDEO_CARDS="nouveau nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS
Yes, I omitted some of nnn's compile-time configuration options to keep the ebuild and the user experience simpler (cf. "When not to use USE Flags?"). Those flags you added allow disabling features without reducing dependencies. I don't see the point in making these things configurable. That may only be me, though. Upstream added these flags for a reason, I suppose. Could you please explain which of these flags you really miss and what your use case is? In any case, most of these USE flags should be enabled by default, so that user's get a default rather than stripped-down build when they don't touch the USE flags.
Created attachment 850364 [details, diff] fix QA Notice: new icons have been found installed but icon cache has not been updated
(In reply to Sebastian Hamann from comment #2) > Could you please explain which of these flags you really miss and what your > use case is? I must concede that the added USE flags don't add or remove much worthwhile functionality. Thanks for pointing that out, I retract my proposal :) If you care about the QA notice, I uploaded the relevant patch: https://bugs.gentoo.org/attachment.cgi?id=850364 I'll close the bug.
Thank you for addressing the QA notice. I submitted your patch. To future readers of this bug: I am not opposed to adding more USE flags for nnn's compile-time options. Please explain why they are useful :)
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c13c81b8ec51a58afb98351dcd4fcf8b1e3e5104 commit c13c81b8ec51a58afb98351dcd4fcf8b1e3e5104 Author: Lucio Sauer <watermanpaint@posteo.net> AuthorDate: 2023-02-11 12:12:38 +0000 Commit: Joonas Niilola <juippis@gentoo.org> CommitDate: 2023-02-25 09:11:43 +0000 app-misc/nnn: update xdg caches Closes: https://bugs.gentoo.org/893780 Signed-off-by: Lucio Sauer <watermanpaint@posteo.net> Signed-off-by: Sebastian Hamann <code@ares-macrotechnology.com> Closes: https://github.com/gentoo/gentoo/pull/29547 Signed-off-by: Joonas Niilola <juippis@gentoo.org> app-misc/nnn/nnn-4.7-r1.ebuild | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)