aboutsummaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorAlexey Dokuchaev <danfe@FreeBSD.org>2021-09-26 15:44:06 +0000
committerAlexey Dokuchaev <danfe@FreeBSD.org>2021-09-26 15:44:55 +0000
commitbf294827efee6b6298dcd76a985b97d8638a4966 (patch)
tree22f3417d5f3ace1e542417454d4c12a48d8e957e /misc
parent50ae64ad8fa1b644b7388e9f8aae19ec82cb5f2e (diff)
downloadports-bf294827efee6b6298dcd76a985b97d8638a4966.tar.gz
ports-bf294827efee6b6298dcd76a985b97d8638a4966.zip
misc/mc: improve the check whether installed diff(1) is GNU or BSD
In 2017, GNU diff had been replaced by BSD licensed diff in our base, but some features of GNU diff had not been implemented, particularly, the ``group format'' family of options. Instead of checking for the ${OSVERSION} value, check if installed diff(1) implementation is GNU or BSD one based on the --version output. Because conditions are subject to immediate expansion, we cannot use ${DIFF} and ${GREP} variables; however, literal ``diff'' is actually correct in this particular case as user's preferred diff(1) does not necessarily point to ``/usr/bin/diff'' which ${DIFF} expands to. While here, amend the EDITOR option description so it clearly refers to the internal *text* editor.
Diffstat (limited to 'misc')
-rw-r--r--misc/mc/Makefile16
1 files changed, 7 insertions, 9 deletions
diff --git a/misc/mc/Makefile b/misc/mc/Makefile
index ea04ec6871d2..2d9c4925de6e 100644
--- a/misc/mc/Makefile
+++ b/misc/mc/Makefile
@@ -15,6 +15,11 @@ LICENSE_FILE= ${WRKSRC}/COPYING
RUN_DEPENDS= zip:archivers/zip
+.if ${:!diff --version 2>/dev/null | grep -c GNU\ diffutils || :!} < 1
+EXTRA_PATCHES+= ${FILESDIR}/extra-patch-src_diffviewer_ydiff.c
+RUN_DEPENDS+= gdiff:textproc/diffutils
+.endif
+
USES= gmake gnome libtool perl5 pkgconfig python shebangfix tar:xz
SHEBANG_FILES= ${WRKSRC}/src/vfs/extfs/helpers/s3+.in \
${WRKSRC}/src/vfs/extfs/helpers/uc1541
@@ -32,7 +37,7 @@ OPTIONS_SINGLE_SCREEN= SLANG NCURSES
OPTIONS_SUB= yes
ASPELL_DESC= Aspell support for internal editor
-EDITOR_DESC= Build with internal editor
+EDITOR_DESC= Build with internal text editor
EXTATTR_DESC= Extended attributes support
SCREEN_DESC= Screen library
SFTP_DESC= Support for SFTP (via libssh)
@@ -94,11 +99,4 @@ post-install-X11-on:
${STAGEDIR}${PREFIX}/share/pixmaps/
${INSTALL_DATA} ${FILESDIR}/${PORTNAME}.desktop ${STAGEDIR}${DESKTOPDIR}
-.include <bsd.port.pre.mk>
-
-.if ${OPSYS} == FreeBSD && ${OSVERSION} >= 1200030
-EXTRA_PATCHES+= ${FILESDIR}/extra-patch-src_diffviewer_ydiff.c
-RUN_DEPENDS+= gdiff:textproc/diffutils
-.endif
-
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>