aboutsummaryrefslogtreecommitdiffstats
path: root/misc
diff options
context:
space:
mode:
authorYuri Victorovich <yuri@FreeBSD.org>2017-12-28 01:47:29 +0800
committerYuri Victorovich <yuri@FreeBSD.org>2017-12-28 01:47:29 +0800
commit0a399ebf740c6485a0214971c4ba2aa9c5aedd21 (patch)
tree77ab8cd557dd30b19b7fa5ca3b2e854cd904dc56 /misc
parent94d2930d00e84c4483c359499fc367babbe5b21e (diff)
downloadfreebsd-ports-gnome-0a399ebf740c6485a0214971c4ba2aa9c5aedd21.tar.gz
freebsd-ports-gnome-0a399ebf740c6485a0214971c4ba2aa9c5aedd21.tar.zst
freebsd-ports-gnome-0a399ebf740c6485a0214971c4ba2aa9c5aedd21.zip
New port: misc/nnn: Missing terminal file browser for X
Submitted by: 224600 Reported by: Dmitri Goutnik <dg@syrec.org> Approved by: tcberner (mentor) Differential Revision: https://reviews.freebsd.org/D13646
Diffstat (limited to 'misc')
-rw-r--r--misc/Makefile1
-rw-r--r--misc/nnn/Makefile67
-rw-r--r--misc/nnn/distinfo3
-rw-r--r--misc/nnn/files/patch-Makefile20
-rw-r--r--misc/nnn/files/patch-nnn.c40
-rw-r--r--misc/nnn/pkg-descr23
6 files changed, 154 insertions, 0 deletions
diff --git a/misc/Makefile b/misc/Makefile
index 6442bf747aab..8605edb13921 100644
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -280,6 +280,7 @@
SUBDIR += najitool
SUBDIR += newer
SUBDIR += nms
+ SUBDIR += nnn
SUBDIR += nsf
SUBDIR += numchar
SUBDIR += nut
diff --git a/misc/nnn/Makefile b/misc/nnn/Makefile
new file mode 100644
index 000000000000..548dd6a9dfce
--- /dev/null
+++ b/misc/nnn/Makefile
@@ -0,0 +1,67 @@
+# $FreeBSD$
+
+PORTNAME= nnn
+DISTVERSIONPREFIX= v
+DISTVERSION= 1.6
+CATEGORIES= misc shells
+
+MAINTAINER= dg@syrec.org
+COMMENT= Missing terminal file browser for X
+
+LICENSE= BSD2CLAUSE
+LICENSE_FILE= ${WRKSRC}/LICENSE
+
+RUN_DEPENDS= bash:shells/bash \
+ xdg-open:devel/xdg-utils
+
+USES= gmake localbase ncurses readline shebangfix
+USE_GITHUB= yes
+GH_ACCOUNT= jarun
+SHEBANG_FILES= nlay
+
+MAKE_ARGS= PREFIX=${PREFIX} MANPREFIX=${PREFIX}/man
+CFLAGS+= -D_WITH_DPRINTF # enable dprintf prototype
+
+OPTIONS_DEFINE= ATOOL BASH DOCS EXAMPLES FISH MEDIAINFO ZSH
+OPTIONS_DEFAULT= ATOOL MEDIAINFO
+ATOOL_DESC= List and extract archives
+MEDIAINFO_DESC= Show media information
+
+ATOOL_RUN_DEPENDS= atool:archivers/atool
+MEDIAINFO_RUN_DEPENDS= mediainfo:multimedia/mediainfo
+
+BASH_PLIST_FILES= etc/bash_completion.d/nnn-completion.bash
+FISH_PLIST_FILES= share/fish/completions/nnn.fish
+ZSH_PLIST_FILES= share/zsh/site-functions/_nnn
+
+PLIST_FILES= bin/nnn \
+ bin/nlay \
+ man/man1/nnn.1.gz
+
+PORTDOCS= README.md
+PORTEXAMPLES= *
+
+post-install-BASH-on:
+ @${MKDIR} ${STAGEDIR}${PREFIX}/etc/bash_completion.d
+ ${INSTALL_DATA} ${WRKSRC}/scripts/auto-completion/bash/nnn-completion.bash \
+ ${STAGEDIR}${PREFIX}/etc/bash_completion.d
+
+post-install-DOCS-on:
+ @${MKDIR} ${STAGEDIR}${DOCSDIR}
+ ${INSTALL_MAN} ${PORTDOCS:S|^|${WRKSRC}/|} ${STAGEDIR}${DOCSDIR}
+
+post-install-EXAMPLES-on:
+ @${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
+ cd ${WRKSRC}/scripts && ${COPYTREE_SHARE} "copier quitcd" ${STAGEDIR}${EXAMPLESDIR}
+
+post-install-FISH-on:
+ @${MKDIR} ${STAGEDIR}${PREFIX}/share/fish/completions
+ ${INSTALL_DATA} ${WRKSRC}/scripts/auto-completion/fish/nnn.fish \
+ ${STAGEDIR}${PREFIX}/share/fish/completions
+
+post-install-ZSH-on:
+ @${MKDIR} ${STAGEDIR}${PREFIX}/share/zsh/site-functions
+ ${INSTALL_DATA} ${WRKSRC}/scripts/auto-completion/zsh/_nnn \
+ ${STAGEDIR}${PREFIX}/share/zsh/site-functions
+
+.include <bsd.port.mk>
diff --git a/misc/nnn/distinfo b/misc/nnn/distinfo
new file mode 100644
index 000000000000..efe5f8eb7c8b
--- /dev/null
+++ b/misc/nnn/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1514234740
+SHA256 (jarun-nnn-v1.6_GH0.tar.gz) = e8b10a3b9847ba7ad3317f608691aaebcdaf2b67219d732f7a5d468221d3e83e
+SIZE (jarun-nnn-v1.6_GH0.tar.gz) = 37456
diff --git a/misc/nnn/files/patch-Makefile b/misc/nnn/files/patch-Makefile
new file mode 100644
index 000000000000..37b49666fffb
--- /dev/null
+++ b/misc/nnn/files/patch-Makefile
@@ -0,0 +1,20 @@
+--- Makefile.orig 2017-12-25 13:40:20 UTC
++++ Makefile
+@@ -10,7 +10,7 @@ ifeq ($(shell pkg-config ncursesw && ech
+ CFLAGS += $(shell pkg-config --cflags ncursesw)
+ LDLIBS += $(shell pkg-config --libs ncursesw)
+ else
+- LDLIBS += -lncurses
++ LDLIBS += -lncursesw
+ endif
+
+ DISTFILES = nlay nnn.c nnn.h nnn.1 Makefile README.md LICENSE
+@@ -23,7 +23,7 @@ all: $(BIN) $(PLAYER)
+ $(SRC): nnn.h
+
+ $(BIN): $(SRC)
+- $(CC) -O2 $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS)
++ $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS)
+ strip $@
+
+ debug: $(SRC)
diff --git a/misc/nnn/files/patch-nnn.c b/misc/nnn/files/patch-nnn.c
new file mode 100644
index 000000000000..081991b56312
--- /dev/null
+++ b/misc/nnn/files/patch-nnn.c
@@ -0,0 +1,40 @@
+Upstreamed, remove after the next release:
+ - https://github.com/jarun/nnn/pull/70
+ - https://github.com/jarun/nnn/pull/69
+
+--- nnn.c.orig 2017-12-25 13:40:20 UTC
++++ nnn.c
+@@ -260,7 +260,7 @@ static char * const utils[] = {
+ #ifdef __APPLE__
+ "/usr/bin/open",
+ #else
+- "/usr/bin/xdg-open",
++ "xdg-open",
+ #endif
+ "nlay",
+ "atool"
+@@ -1544,20 +1544,22 @@ show_stats(char *fpath, char *fname, str
+ /* Show size, blocks, file type */
+ #if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__APPLE__)
+ dprintf(fd, "\n Size: %-15lld Blocks: %-10lld IO Block: %-6d %s",
++ (long long)sb->st_size, (long long)sb->st_blocks, sb->st_blksize, desc);
+ #else
+ dprintf(fd, "\n Size: %-15ld Blocks: %-10ld IO Block: %-6ld %s",
+-#endif
+ sb->st_size, sb->st_blocks, sb->st_blksize, desc);
++#endif
+
+ /* Show containing device, inode, hardlink count */
+ #if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__APPLE__)
+ sprintf(g_buf, "%xh/%ud", sb->st_dev, sb->st_dev);
+ dprintf(fd, "\n Device: %-15s Inode: %-11llu Links: %-9hu",
++ g_buf, (unsigned long long)sb->st_ino, sb->st_nlink);
+ #else
+ sprintf(g_buf, "%lxh/%lud", sb->st_dev, sb->st_dev);
+ dprintf(fd, "\n Device: %-15s Inode: %-11lu Links: %-9lu",
+-#endif
+ g_buf, sb->st_ino, sb->st_nlink);
++#endif
+
+ /* Show major, minor number for block or char device */
+ if (perms[0] == 'b' || perms[0] == 'c')
diff --git a/misc/nnn/pkg-descr b/misc/nnn/pkg-descr
new file mode 100644
index 000000000000..dd53deb688d8
--- /dev/null
+++ b/misc/nnn/pkg-descr
@@ -0,0 +1,23 @@
+nnn is a fast and resource-sensitive file browser which integrates well with
+your DE and favorite GUI utilities, works with the desktop opener, supports
+bookmarks, has smart navigation shortcuts, has navigate-as-you-type mode,
+disk usage analyzer mode, comprehensive file details and much more.
+
+nnn can:
+
+ - open any file in the default desktop application or a custom one
+ - navigate-as-you-type (search-as-you-type enabled even on directory
+ switch)
+ - check disk usage with number of files in current directory tree
+ - run desktop search utility (gnome-search-tool or catfish) in any
+ directory
+ - copy absolute file path to clipboard, spawn a terminal and use the file
+ path
+ - navigate instantly using shortcuts like ~, -, & or handy bookmarks
+ - use cd ..... at chdir prompt to go to a parent directory
+ - show detailed file stats, media info, list and extract archives
+ - pin a directory you may need to revisit and jump to it anytime
+ - lock the current terminal after a specified idle time
+ - change directory on exit
+
+WWW: https://github.com/jarun/nnn