git: f116f3b18afa - main - misc/clifm: update CliFM to version 1.6

From: Alexey Dokuchaev <danfe_at_FreeBSD.org>
Date: Tue, 12 Jul 2022 07:56:37 UTC
The branch main has been updated by danfe:

URL: https://cgit.FreeBSD.org/ports/commit/?id=f116f3b18afa48e39386d926479b10dfbf3c842a

commit f116f3b18afa48e39386d926479b10dfbf3c842a
Author:     Alexey Dokuchaev <danfe@FreeBSD.org>
AuthorDate: 2022-07-12 07:55:40 +0000
Commit:     Alexey Dokuchaev <danfe@FreeBSD.org>
CommitDate: 2022-07-12 07:55:40 +0000

    misc/clifm: update CliFM to version 1.6
    
    - Port one GNU-oriented shell script to use FreeBSD native
      utilities (mostly)
    - Fix -Wformat warnings on i386 (unfortunately, had to keep
      existing format specifiers because they are part of the
      translated strings and throw some ugly typecasts instead)
    
    Reported by:    portscout
---
 misc/clifm/Makefile                     | 11 ++++-
 misc/clifm/distinfo                     |  6 +--
 misc/clifm/files/patch-Makefile         | 13 +++---
 misc/clifm/files/patch-plugins_fdups.sh | 74 +++++++++++++++++++++++++++++++++
 misc/clifm/files/patch-src_jump.c       | 16 +++++++
 misc/clifm/files/patch-src_properties.c | 32 ++++++++++++++
 misc/clifm/pkg-plist                    | 13 ++++++
 7 files changed, 152 insertions(+), 13 deletions(-)

diff --git a/misc/clifm/Makefile b/misc/clifm/Makefile
index 22726e28433f..56279fd03a19 100644
--- a/misc/clifm/Makefile
+++ b/misc/clifm/Makefile
@@ -1,7 +1,7 @@
 # Created by: Alexey Dokuchaev <danfe@FreeBSD.org>
 
 PORTNAME=	clifm
-PORTVERSION=	1.5.1
+PORTVERSION=	1.6
 DISTVERSIONPREFIX=	v
 CATEGORIES=	misc
 
@@ -10,10 +10,14 @@ COMMENT=	Non-curses, KISS file manager for the terminal
 
 LICENSE=	GPLv2+
 
-USES=		desktop-file-utils gettext-runtime readline
+RUN_DEPENDS=	gfind:misc/findutils guniq:sysutils/coreutils
+
+USES=		desktop-file-utils gettext-runtime python:run \
+		readline shebangfix
 USE_GITHUB=	yes
 GH_ACCOUNT=	leo-arch
 ALL_TARGET=	build
+SHEBANG_FILES=	misc/tools/manpages_comp_gen.py
 
 OPTIONS_DEFINE=	COLORS
 OPTIONS_DEFAULT=	COLORS
@@ -28,4 +32,7 @@ post-install-COLORS-on:
 	${INSTALL_DATA} ${WRKSRC_cfmc}/colors/*.cfm \
 		${STAGEDIR}${DATADIR}/colors
 
+post-stage:
+	@${RM} ${STAGEDIR}${DATADIR}/plugins/*.orig
+
 .include <bsd.port.mk>
diff --git a/misc/clifm/distinfo b/misc/clifm/distinfo
index 5b841484fc23..0cde014a4cba 100644
--- a/misc/clifm/distinfo
+++ b/misc/clifm/distinfo
@@ -1,5 +1,5 @@
-TIMESTAMP = 1648330915
-SHA256 (leo-arch-clifm-v1.5.1_GH0.tar.gz) = c615fbf52a0f701b3c509437d3edf0bbdcb6645712f08cdf745fac38b23a087b
-SIZE (leo-arch-clifm-v1.5.1_GH0.tar.gz) = 1217409
+TIMESTAMP = 1656397054
+SHA256 (leo-arch-clifm-v1.6_GH0.tar.gz) = 303f0ee2c6b19d3612de623c3ae0ee3ac110dcacfc348ec0f1d80015fc5f26e1
+SIZE (leo-arch-clifm-v1.6_GH0.tar.gz) = 1268633
 SHA256 (leo-arch-clifm-colors-v0.1.0_GH0.tar.gz) = 147573aa1e83c286488fdf45c3673e6b417957fb3c5a7f70eba0021cc1f3aa70
 SIZE (leo-arch-clifm-colors-v0.1.0_GH0.tar.gz) = 875324
diff --git a/misc/clifm/files/patch-Makefile b/misc/clifm/files/patch-Makefile
index 3c635f8452a8..aeae151c3fd1 100644
--- a/misc/clifm/files/patch-Makefile
+++ b/misc/clifm/files/patch-Makefile
@@ -1,18 +1,15 @@
---- Makefile.orig	2021-08-29 04:14:33 UTC
+--- Makefile.orig	2022-06-28 06:17:34 UTC
 +++ Makefile
-@@ -22,9 +22,9 @@ SRCDIR = src
- SRC = $(SRCDIR)/*.c
- HEADERS = $(SRCDIR)/*.h
+@@ -24,7 +24,7 @@ LIBS_Linux ?= -lreadline -lacl -lcap -lmagic
  
--CFLAGS ?= -O3 -fstack-protector-strong -march=native -Wall -DCLIFM_DATADIR=$(DATADIR)
-+CFLAGS += -Wall -DCLIFM_DATADIR=$(DATADIR)
+ CFLAGS ?= -O3 -fstack-protector-strong -march=native -Wall
  LIBS_Linux ?= -lreadline -lacl -lcap -lmagic
 -LIBS_FreeBSD ?= -I/usr/local/include -L/usr/local/lib -lreadline -lintl -lmagic
 +LIBS_FreeBSD ?= -I$(LOCALBASE)/include -L$(LOCALBASE)/lib -lreadline -lintl -lmagic
  LIBS_NetBSD ?= -I/usr/pkg/include -L/usr/pkg/lib -Wl,-R/usr/pkg/lib -lreadline -lintl -lmagic
  LIBS_OpenBSD ?= -I/usr/local/include -L/usr/local/lib -lereadline -lintl -lmagic
- 
-@@ -36,7 +36,7 @@ clean:
+ LIBS_Darwin ?= -I/opt/local/include -L/opt/local/lib -lreadline -lintl -lmagic
+@@ -39,7 +39,7 @@ clean:
  	$(RM) -- $(BIN)
  	$(RM) -f -- $(SRCDIR)/*.o
  
diff --git a/misc/clifm/files/patch-plugins_fdups.sh b/misc/clifm/files/patch-plugins_fdups.sh
new file mode 100644
index 000000000000..747c786debbf
--- /dev/null
+++ b/misc/clifm/files/patch-plugins_fdups.sh
@@ -0,0 +1,74 @@
+--- plugins/fdups.sh.orig	2022-06-28 06:17:34 UTC
++++ plugins/fdups.sh
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ 
+ # Plugin to find/remove duplicate files for CliFM
+ #
+@@ -8,14 +8,12 @@
+ # by MD5) in DIR (current directory if omitted) and allow the user to remove
+ # one or more of them
+ #
+-# Dependencies: find md5sum sort uniq xargs sed stat
++# Dependencies: gfind md5 sort guniq xargs sed stat
+ #
+ # Notes:
+ # 1. If the file size exceeds SIZE_DIGITS digits the file will be misplaced.
+ #    (12 digits amount to sizes up to 931GiB)
+-# 2. Bash compatible shell required for mktemp(1)
+ #
+-# Shell: Bash
+ # Based on https://github.com/jarun/nnn/blob/master/plugins/dups and modified
+ # to fit our needs
+ #
+@@ -25,14 +23,14 @@ no_dep=0
+ me="clifm"
+ no_dep=0
+ 
+-if ! type find > /dev/null 2>&1; then
+-	printf "%s: find: command not found\n" "$me" >&2; no_dep=1
+-elif ! type md5sum > /dev/null 2>&1; then
+-	printf "%s: md5sum: command not found\n" "$me" >&2; no_dep=1
++if ! type gfind > /dev/null 2>&1; then
++	printf "%s: gfind: command not found\n" "$me" >&2; no_dep=1
++elif ! type md5 > /dev/null 2>&1; then
++	printf "%s: md5: command not found\n" "$me" >&2; no_dep=1
+ elif ! type sort > /dev/null 2>&1; then
+ 	printf "%s: sort: command not found\n" "$me" >&2; no_dep=1
+-elif ! type uniq > /dev/null 2>&1; then
+-	printf "%s: uniq: command not found\n" "$me" >&2; no_dep=1
++elif ! type guniq > /dev/null 2>&1; then
++	printf "%s: guniq: command not found\n" "$me" >&2; no_dep=1
+ elif ! type xargs > /dev/null 2>&1; then
+ 	printf "%s: xargs: command not found\n" "$me" >&2; no_dep=1
+ elif ! type sed > /dev/null 2>&1; then
+@@ -72,20 +70,20 @@ printf "\
+ " > "$tmp_file"
+ 
+ # shellcheck disable=SC2016
+-find "$dir" -size +0 -type f -printf "%${size_digits}s %p\n" | sort -rn | uniq -w"${size_digits}" -D | sed -e '                                s/^ \{0,12\}\([0-9]\{0,12\}\) \(.*\)$/printf "%s %s\\n" "$(md5sum "\2")" "d\1"/                                                                       ' | tr '\n' '\0' | xargs -0 -n1 -r sh -c | sort | { uniq -w32 --all-repeated=separate; echo; } | sed -ne '
+-h                                                           
++gfind "$dir" -size +0 -type f -printf "%${size_digits}s %p\n" | sort -rn | guniq -w"${size_digits}" -D | sed -e 's/^ \{0,12\}\([0-9]\{0,12\}\) \(.*\)$/printf "%s %s\\n" "$(md5 -r "\2")" "d\1"/' | tr '\n' '\0' | xargs -0 -n1 -r sh -c | sort | { guniq -w32 --all-repeated=separate; echo; } | sed -ne '
++h
+ s/^\(.\{32\}\).* d\([0-9]*\)$/## md5sum: \1 size: \2 bytes/p
+-g    
++g
+ :loop
+-N             
+-/.*\n$/!b loop                               
+-p' | sed -e 's/^.\{32\}  \(.*\) d[0-9]*$/\1/' >> "$tmp_file"
++N
++/.*\n$/!b loop
++p' | sed -e 's/^.\{32\} \(.*\) d[0-9]*$/\1/' >> "$tmp_file"
+ 
+-time_pre="$(stat -c '%Y' "$tmp_file")"
++time_pre="$(stat -f '%m' "$tmp_file")"
+ 
+ "$EDITOR" "$tmp_file"
+ 
+-time_post="$(stat -c '%Y' "$tmp_file")"
++time_post="$(stat -f '%m' "$tmp_file")"
+ 
+ if [ "$time_pre" = "$time_post" ]; then
+ 	printf "%s: Nothing to do\n" "$me"
diff --git a/misc/clifm/files/patch-src_jump.c b/misc/clifm/files/patch-src_jump.c
new file mode 100644
index 000000000000..6066e780b200
--- /dev/null
+++ b/misc/clifm/files/patch-src_jump.c
@@ -0,0 +1,16 @@
+--- src/jump.c.orig	2022-06-28 06:17:34 UTC
++++ src/jump.c
+@@ -207,11 +207,11 @@ save_jumpdb(void)
+ 		}
+ 
+ 		jump_num++;
+-#ifndef __OpenBSD__
++#ifndef __i386__
+ 		fprintf(fp, "%zu:%ld:%ld:%s\n", jump_db[i].visits, jump_db[i].first_visit,
+ 			jump_db[i].last_visit, jump_db[i].path);
+ #else
+-		fprintf(fp, "%zu:%lld:%lld:%s\n", jump_db[i].visits, jump_db[i].first_visit,
++		fprintf(fp, "%zu:%d:%d:%s\n", jump_db[i].visits, jump_db[i].first_visit,
+ 			jump_db[i].last_visit, jump_db[i].path);
+ #endif
+ 	}
diff --git a/misc/clifm/files/patch-src_properties.c b/misc/clifm/files/patch-src_properties.c
new file mode 100644
index 000000000000..eeacb8c3c138
--- /dev/null
+++ b/misc/clifm/files/patch-src_properties.c
@@ -0,0 +1,32 @@
+--- src/properties.c.orig	2022-06-28 06:17:34 UTC
++++ src/properties.c
+@@ -406,8 +406,8 @@ get_properties(char *filename, const int dsize)
+ 	if (colorize == 1)
+ 		printf("%s", cend);
+ 
+-#if defined(__OpenBSD__) || defined(__APPLE__)
+-	printf(_("\tBlocks: %s%lld%s"), cbold, attr.st_blocks, cend);
++#if defined(__OpenBSD__) || defined(__APPLE__) || defined(__FreeBSD__)
++	printf(_("\tBlocks: %s%lld%s"), cbold, (long long)attr.st_blocks, cend);
+ #else
+ 	printf(_("\tBlocks: %s%ld%s"), cbold, attr.st_blocks, cend);
+ #endif
+@@ -417,15 +417,15 @@ get_properties(char *filename, const int dsize)
+ #else
+ 	printf(_("\tIO Block: %s%ld%s"), cbold, attr.st_blksize, cend);
+ #endif
+-#if defined(__OpenBSD__) || defined(__APPLE__)
+-	printf(_("\tInode: %s%llu%s\n"), cbold, attr.st_ino, cend);
++#if defined(__OpenBSD__) || defined(__APPLE__) || defined(__FreeBSD__)
++	printf(_("\tInode: %s%llu%s\n"), cbold, (unsigned long long)attr.st_ino, cend);
+ #else
+ 	printf(_("\tInode: %s%zu%s\n"), cbold, attr.st_ino, cend);
+ #endif
+ #if defined(__OpenBSD__) || defined(__APPLE__)
+ 	printf(_("Device: %s%d%s"), cbold, attr.st_dev, cend);
+ #else
+-	printf(_("Device: %s%zu%s"), cbold, attr.st_dev, cend);
++	printf(_("Device: %s%zu%s"), cbold, (size_t)attr.st_dev, cend);
+ #endif
+ 	printf(_("\tUid: %s%u (%s)%s"), cid, attr.st_uid, !owner ? _("unknown")
+ 			: owner->pw_name, cend);
diff --git a/misc/clifm/pkg-plist b/misc/clifm/pkg-plist
index 220c8bd93a30..9c9eedb3d961 100644
--- a/misc/clifm/pkg-plist
+++ b/misc/clifm/pkg-plist
@@ -10,12 +10,17 @@ share/bash-completion/completions/clifm
 %%COLORS%%%%DATADIR%%/colors/cga.cfm
 %%COLORS%%%%DATADIR%%/colors/cold.cfm
 %%COLORS%%%%DATADIR%%/colors/default.cfm
+%%COLORS%%%%DATADIR%%/colors/dracula-vivid.cfm
 %%COLORS%%%%DATADIR%%/colors/dracula.cfm
 %%COLORS%%%%DATADIR%%/colors/forest.cfm
 %%COLORS%%%%DATADIR%%/colors/green-256.cfm
 %%COLORS%%%%DATADIR%%/colors/gruvbox.cfm
+%%COLORS%%%%DATADIR%%/colors/jellybeans-vivid.cfm
 %%COLORS%%%%DATADIR%%/colors/light.cfm
 %%COLORS%%%%DATADIR%%/colors/molokai.cfm
+%%COLORS%%%%DATADIR%%/colors/nocolor.cfm
+%%COLORS%%%%DATADIR%%/colors/nord.cfm
+%%COLORS%%%%DATADIR%%/colors/one-dark.cfm
 %%COLORS%%%%DATADIR%%/colors/snow.cfm
 %%COLORS%%%%DATADIR%%/colors/solarized.cfm
 %%COLORS%%%%DATADIR%%/colors/sunset.cfm
@@ -32,9 +37,13 @@ share/bash-completion/completions/clifm
 %%DATADIR%%/plugins/BFG.sh
 %%DATADIR%%/plugins/batch_copy.sh
 %%DATADIR%%/plugins/batch_create.sh
+%%DATADIR%%/plugins/bm_import.sh
 %%DATADIR%%/plugins/clip.sh
 %%DATADIR%%/plugins/colors.sh
+%%DATADIR%%/plugins/cprm.sh
+%%DATADIR%%/plugins/disk_analyzer.sh
 %%DATADIR%%/plugins/dragondrop.sh
+%%DATADIR%%/plugins/fdups.sh
 %%DATADIR%%/plugins/finder.sh
 %%DATADIR%%/plugins/fzcd.sh
 %%DATADIR%%/plugins/fzfdesel.sh
@@ -49,13 +58,17 @@ share/bash-completion/completions/clifm
 %%DATADIR%%/plugins/kbgen.c
 %%DATADIR%%/plugins/mime_list.sh
 %%DATADIR%%/plugins/music_player.sh
+%%DATADIR%%/plugins/pager.sh
 %%DATADIR%%/plugins/pdf_viewer.sh
 %%DATADIR%%/plugins/plugins-helper
+%%DATADIR%%/plugins/recur_rm.sh
 %%DATADIR%%/plugins/rgfind.sh
 %%DATADIR%%/plugins/update.sh
 %%DATADIR%%/plugins/vid_viewer.sh
 %%DATADIR%%/plugins/wallpaper_setter.sh
 %%DATADIR%%/prompts.cfm
 %%DATADIR%%/readline.cfm
+%%DATADIR%%/tools/deroff.py
+%%DATADIR%%/tools/manpages_comp_gen.py
 share/icons/hicolor/scalable/apps/clifm.svg
 share/zsh/site-functions/_clifm