git: c6914fc48eae - main - misc/far2l: update Far-2-Linux port to version 2.5.3 (sign of mistrust)

From: Alexey Dokuchaev <danfe_at_FreeBSD.org>
Date: Thu, 07 Dec 2023 14:34:32 UTC
The branch main has been updated by danfe:

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

commit c6914fc48eae8ac040d44e6af2b581c0271eee40
Author:     Alexey Dokuchaev <danfe@FreeBSD.org>
AuthorDate: 2023-12-07 14:32:44 +0000
Commit:     Alexey Dokuchaev <danfe@FreeBSD.org>
CommitDate: 2023-12-07 14:32:44 +0000

    misc/far2l: update Far-2-Linux port to version 2.5.3 (sign of mistrust)
    
    - Drop needless dependency on `devel/libfmt' which is not actually used,
      but was pulled for a quite bizarre reason: "sometimes libstd requires
      linking to libfmt, sometimes not, if libfmt [found] let's link to it",
      and prevent its accidental pick up if it's installed on user's system
    - Revert to `find_package(LibArchive)' which had been recently replaced
      with pkgconf(1)-backed in version 2.5.1: this helps CMake to find the
      base system's library again; use it to handle RAR archives while here
    - Amend the list of file suffixes (extensions) which look like archives
    - Purge endian-related patch, this code now compiles cleanly on PowerPC
    
    Reported by:    portscout
    Confirmed by:   pkubaj (last item)
---
 misc/far2l/Makefile                           | 19 ++++++++----
 misc/far2l/distinfo                           |  6 ++--
 misc/far2l/files/patch-far2l_src_datetime.cpp | 42 ---------------------------
 misc/far2l/pkg-plist                          |  3 ++
 4 files changed, 20 insertions(+), 50 deletions(-)

diff --git a/misc/far2l/Makefile b/misc/far2l/Makefile
index 6009ddfad0be..18767f480b4e 100644
--- a/misc/far2l/Makefile
+++ b/misc/far2l/Makefile
@@ -1,5 +1,5 @@
 PORTNAME=	far2l
-PORTVERSION=	2.5.2
+PORTVERSION=	2.5.3
 DISTVERSIONPREFIX=	v_
 CATEGORIES=	misc
 
@@ -9,8 +9,7 @@ WWW=		https://github.com/elfmz/far2l
 
 LICENSE=	GPLv2
 
-LIB_DEPENDS=	libfmt.so:devel/libfmt \
-		libpcre.so:devel/pcre \
+LIB_DEPENDS=	libpcre.so:devel/pcre \
 		libuchardet.so:textproc/uchardet \
 		libxerces-c.so:textproc/xerces-c3
 RUN_DEPENDS=	bash:shells/bash
@@ -22,6 +21,8 @@ USES=		cmake compiler:c++11-lang perl5 pkgconfig shebangfix ssl
 USE_PERL5=	build
 SHEBANG_FILES=	far2l/bootstrap/view.sh
 
+CMAKE_OFF=	UNRAR	# libarchive handles *.rar files just fine
+
 OPTIONS_DEFINE=	NFS SFTP SMB WEBDAV WXGTK X11
 OPTIONS_DEFAULT=	NFS SFTP WEBDAV WXGTK X11
 OPTIONS_SUB=	yes
@@ -46,9 +47,17 @@ X11_USES=	xorg
 X11_USE=	XORG=ice,sm,x11,xext,xi
 
 post-patch:
-	@${REINPLACE_CMD} -e 's,Linux x86_64,${OPSYS} ${ARCH},' \
-		${WRKSRC}/far2l/bootstrap/scripts/far2l_m4.pl
+	@${REINPLACE_CMD} -e \
+		's,pkg_search_module\((LibArchive\)[^)]*,find_package\1,' \
+			${WRKSRC}/CMakeLists.txt
+	@${REINPLACE_CMD} -e 's,^if (fmt_FOUND,& AND FALSE,' \
+		${WRKSRC}/colorer/CMakeLists.txt
+	@${REINPLACE_CMD} -e 's,bxg7,&l, ; s/zoo/tbz2,*.zst,*.&/' \
+		${WRKSRC}/far2l/src/hilight.cpp
 	@${GREP} -Rl --null --include=\*.cpp /bin/bash ${WRKSRC} | ${XARGS} \
 		-0 ${REINPLACE_CMD} -e 's,/bin/bash,${LOCALBASE}&,'
 
+post-stage:
+	${RMDIR} ${STAGEDIR}${PREFIX}/lib/far2l/Plugins/NetRocks/plug/SHELL
+
 .include <bsd.port.mk>
diff --git a/misc/far2l/distinfo b/misc/far2l/distinfo
index afbb997c2cde..660ffd41dd6e 100644
--- a/misc/far2l/distinfo
+++ b/misc/far2l/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1692098850
-SHA256 (elfmz-far2l-v_2.5.2_GH0.tar.gz) = c8ae8bd7b9f242e267f4b13c81735706accdc40046dd262d30a4017b703f36b7
-SIZE (elfmz-far2l-v_2.5.2_GH0.tar.gz) = 6483703
+TIMESTAMP = 1699171546
+SHA256 (elfmz-far2l-v_2.5.3_GH0.tar.gz) = e9de15221d2fcc164cf4a64e4f8239ff3a3b4d5a06601dd6c6f1e63fb5a91bdc
+SIZE (elfmz-far2l-v_2.5.3_GH0.tar.gz) = 6529657
diff --git a/misc/far2l/files/patch-far2l_src_datetime.cpp b/misc/far2l/files/patch-far2l_src_datetime.cpp
deleted file mode 100644
index 95cd26f1daf2..000000000000
--- a/misc/far2l/files/patch-far2l_src_datetime.cpp
+++ /dev/null
@@ -1,42 +0,0 @@
---- far2l/src/datetime.cpp.orig	2023-10-06 15:57:46 UTC
-+++ far2l/src/datetime.cpp
-@@ -531,15 +531,27 @@ int64_t FileTimeDifference(const FILETIME *a, const FI
- {
- 	LARGE_INTEGER A =
- 						{
-+#if defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
-+								{(LONG)a->dwHighDateTime, a->dwLowDateTime}
-+#else
- 								{a->dwLowDateTime, (LONG)a->dwHighDateTime}
-+#endif
-     },
-+#if defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
-+				B = {{(LONG)b->dwHighDateTime, b->dwLowDateTime}};
-+#else
- 				B = {{b->dwLowDateTime, (LONG)b->dwHighDateTime}};
-+#endif
- 	return A.QuadPart - B.QuadPart;
- }
- 
- uint64_t FileTimeToUI64(const FILETIME *ft)
- {
-+#if defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
-+	ULARGE_INTEGER A = { {ft->dwHighDateTime, ft->dwLowDateTime} };
-+#else
- 	ULARGE_INTEGER A = { {ft->dwLowDateTime, ft->dwHighDateTime} };
-+#endif
- 	return A.QuadPart;
- }
- 
-@@ -761,7 +773,11 @@ void ConvertRelativeDate(const FILETIME &ft, FARString
- 
- void ConvertRelativeDate(const FILETIME &ft, FARString &strDaysText, FARString &strTimeText)
- {
-+#if defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
-+	ULARGE_INTEGER time = { {ft.dwHighDateTime, ft.dwLowDateTime}};
-+#else
- 	ULARGE_INTEGER time = { {ft.dwLowDateTime, ft.dwHighDateTime}};
-+#endif
- 
- 	UINT64 ms = (time.QuadPart/= 10000) % 1000;
- 	UINT64 s = (time.QuadPart/= 1000) % 60;
diff --git a/misc/far2l/pkg-plist b/misc/far2l/pkg-plist
index 48f58181550f..b1655b096b61 100644
--- a/misc/far2l/pkg-plist
+++ b/misc/far2l/pkg-plist
@@ -4,6 +4,7 @@ lib/far2l/Plugins/NetRocks/plug/NetRocks-FILE.broker
 lib/far2l/Plugins/NetRocks/plug/NetRocks-FTP.broker
 %%NFS%%lib/far2l/Plugins/NetRocks/plug/NetRocks-NFS.broker
 %%SFTP%%lib/far2l/Plugins/NetRocks/plug/NetRocks-SFTP.broker
+lib/far2l/Plugins/NetRocks/plug/NetRocks-SHELL.broker
 %%SMB%%lib/far2l/Plugins/NetRocks/plug/NetRocks-SMB.broker
 %%WEBDAV%%lib/far2l/Plugins/NetRocks/plug/NetRocks-WebDAV.broker
 lib/far2l/Plugins/NetRocks/plug/NetRocks.far-plug-wide
@@ -39,6 +40,8 @@ share/applications/far2l.desktop
 %%DATADIR%%/FarSpa.lng
 %%DATADIR%%/FarUkr.hlf
 %%DATADIR%%/FarUkr.lng
+%%DATADIR%%/Plugins/NetRocks/plug/SHELL/remote.sh
+%%DATADIR%%/Plugins/NetRocks/plug/SHELL/ways.ini
 %%DATADIR%%/Plugins/NetRocks/plug/bel.lng
 %%DATADIR%%/Plugins/NetRocks/plug/eng.lng
 %%DATADIR%%/Plugins/NetRocks/plug/helpe.hlf