summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app-misc/nnn/Manifest1
-rw-r--r--app-misc/nnn/metadata.xml3
-rw-r--r--app-misc/nnn/nnn-4.8.ebuild97
3 files changed, 100 insertions, 1 deletions
diff --git a/app-misc/nnn/Manifest b/app-misc/nnn/Manifest
index 4679837bc719..36b518d334bd 100644
--- a/app-misc/nnn/Manifest
+++ b/app-misc/nnn/Manifest
@@ -2,3 +2,4 @@ DIST nnn-4.0.tar.gz 214555 BLAKE2B b0490662bad07213ff79b8865b8d9672d1ff98d93e370
DIST nnn-4.3.tar.gz 236606 BLAKE2B cec0a73a40fae76e478c3299e2ae8a613c2e1b16e009d4f69cc3c9c9f6ea5df4048fc7f941ae6369293cf56df9b91a496531f4b34bf05f1dbbf8fab9120ffe78 SHA512 588af174d86db14acf5d1e2ac42f88ca5c6f0e105996a58771e7e0f989f224616e7a12d74fecc96540a9782db0cf8857c21bf0f50df4ee3b4b5c641291c64575
DIST nnn-4.5.tar.gz 242191 BLAKE2B 2a1564520222bc51df64c495ffa7a22fc3200f4572281e4b4e998e999b41c171f4b832502a054741040fa9d87d0da0d0d23949c0d867fc4c2830722045654c3d SHA512 ab64f0e6211b14e90a4632bb0da9a1214635c9a06718c7c434d344d69d1087b4d5d978d44f38c1b03bb555e3055ca5033bcbca40927135757a468e6f1b99046e
DIST nnn-4.7.tar.gz 250038 BLAKE2B b63da6ac8a0ac6b8b2bce0ed45c43c9e707f11f99e6b456131728d7fde5f638162d8e3bbf1b3a0fadba315d38d9cc1b38c0d4a644ee800fbea00ffe1c92beef0 SHA512 28ec9b9ab93f979d77e80957df2a70ec687e56ada6d5e8555c121f2454b5c049466120e5eb3570174411a61e3855c869f96d306a43516cceff8c4cb7f1075875
+DIST nnn-4.8.tar.gz 253547 BLAKE2B 36e6e1dc39bfbce7fa72fd322339395fa78a410c93043860be845ff3d5be3178fd37966f57da17f115cab8a6973462d44243052a6c736665ef9a180cd9fd6978 SHA512 932e27ec1d7cd3db6ccba33edb3d1ad2620109cde3c4114b734eef3e04d6c6c22ddaa1c4727908dba2a107dd4cfe1f5193aec450f680a390671f48e63d0133bd
diff --git a/app-misc/nnn/metadata.xml b/app-misc/nnn/metadata.xml
index 780adc28a98f..af3b28f22e09 100644
--- a/app-misc/nnn/metadata.xml
+++ b/app-misc/nnn/metadata.xml
@@ -18,7 +18,8 @@
<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="colemak">Key bindings for Colemak-DH keyboard layout</flag>
+ <flag name="colemak">Key bindings for Colemak keyboard layout</flag>
+ <flag name="colemak-dh">Key bindings for Colemak-DH keyboard layout</flag>
<flag name="gitstatus">Add git status column to the detail view</flag>
<flag name="namefirst">Print filenames first in the detail view</flag>
<flag name="restorepreview">Add pipe to close and restore preview-tui for internal undetached edits</flag>
diff --git a/app-misc/nnn/nnn-4.8.ebuild b/app-misc/nnn/nnn-4.8.ebuild
new file mode 100644
index 000000000000..7ce3a7c08a36
--- /dev/null
+++ b/app-misc/nnn/nnn-4.8.ebuild
@@ -0,0 +1,97 @@
+# 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 pcre 8contexts icons nerdfonts emoji qsort colemak colemak-dh gitstatus namefirst restorepreview"
+
+DEPEND="sys-libs/ncurses:=
+ pcre? ( dev-libs/libpcre )
+ readline? ( sys-libs/readline:= )
+ elibc_musl? ( sys-libs/fts-standalone )"
+BDEPEND="virtual/pkgconfig"
+RDEPEND="${DEPEND}"
+REQUIRED_USE="?? ( icons nerdfonts emoji ) ?? ( colemak colemak-dh )"
+
+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"
+ # The Makefile uses O_COLEMAK-DH to control the Colemak-DH patch, but that
+ # does not work with the array approach to make options below. Hence, we
+ # simply rename it to O_COLEMAK_DH.
+ sed -i -e 's/O_COLEMAK-DH/O_COLEMAK_DH/' Makefile || die "sed failed"
+}
+
+src_compile() {
+ nnn_opts=(
+ O_NORL=$(usex readline 0 1)
+ O_PCRE=$(usex pcre 1 0)
+ O_CTX8=$(usex 8contexts 1 0)
+ O_ICONS=$(usex icons 1 0)
+ O_NERD=$(usex nerdfonts 1 0)
+ O_EMOJI=$(usex emoji 1 0)
+ O_QSORT=$(usex qsort 1 0)
+ # nnn's user-submitted patches
+ O_COLEMAK=$(usex colemak 1 0)
+ O_COLEMAK_DH=$(usex colemak-dh 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
+}