git: e0ba0f84d9ac - main - multimedia/smplayer: the port had been improved (+)

From: Alexey Dokuchaev <danfe_at_FreeBSD.org>
Date: Fri, 12 May 2023 11:55:36 UTC
The branch main has been updated by danfe:

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

commit e0ba0f84d9ac84a5571565c15ab14eb020efd751
Author:     Alexey Dokuchaev <danfe@FreeBSD.org>
AuthorDate: 2023-05-12 11:55:02 +0000
Commit:     Alexey Dokuchaev <danfe@FreeBSD.org>
CommitDate: 2023-05-12 11:55:02 +0000

    multimedia/smplayer: the port had been improved (+)
    
    - Limit DOS2UNIX conversion only to text files that actually need it
    - Stop messing with the Makefile in the `post-patch' target and amend
      existing patch instead, correctly call inner submakes, etc.
    - Fix spelling in the port installation message while I'm here
---
 multimedia/smplayer/Makefile             |  8 ++------
 multimedia/smplayer/files/patch-Makefile | 35 +++++++++++++++++++++++++++++---
 multimedia/smplayer/files/pkg-message.in |  2 +-
 3 files changed, 35 insertions(+), 10 deletions(-)

diff --git a/multimedia/smplayer/Makefile b/multimedia/smplayer/Makefile
index 6e9f4d544fdd..8b6772ee95ee 100644
--- a/multimedia/smplayer/Makefile
+++ b/multimedia/smplayer/Makefile
@@ -19,11 +19,11 @@ USE_QT=		buildtools:build linguisttools:build \
 USE_XORG=	x11 xext
 
 CPE_VENDOR=	ricardo_villalba
-DOS2UNIX_REGEX=	.*.[^p][^n][^g]$
+DOS2UNIX_GLOB=	*.md *.txt
 
 ALL_TARGET=	src/smplayer
 CONFIGURE_WRKSRC=	${WRKSRC}/src
-MAKE_ARGS=	PREFIX=${PREFIX} DESTDIR=${STAGEDIR}
+MAKE_ENV=	DESTDIR=${STAGEDIR} LRELEASE=${LRELEASE}
 QMAKE_ARGS=	"DEFINES_DISABLED+=MPLAYER2_SUPPORT"
 
 PORTDOCS=	${DOCS:T}
@@ -57,10 +57,6 @@ PORTSCOUT=	site:http://sourceforge.net/projects/smplayer/files/Unstable/releases
 SUB_FILES=	pkg-message
 
 post-patch:
-	@${REINPLACE_CMD} -e 's|&& $$(QMAKE) $$(QMAKE_OPTS)||; \
-		s|lrelease|${LRELEASE}|; \
-		s| make| ${MAKE_CMD}|g' \
-		${WRKSRC}/Makefile
 	@${REINPLACE_CMD} -e 's|-O2 -W -Wall -Werror|${CFLAGS}|' \
 		${WRKSRC}/webserver/Makefile
 	@${REINPLACE_CMD} -e 's|^sed|#sed|' \
diff --git a/multimedia/smplayer/files/patch-Makefile b/multimedia/smplayer/files/patch-Makefile
index 7559e40252aa..e5751409740a 100644
--- a/multimedia/smplayer/files/patch-Makefile
+++ b/multimedia/smplayer/files/patch-Makefile
@@ -1,6 +1,11 @@
---- Makefile.orig	2018-01-12 15:20:18 UTC
+--- Makefile.orig	2021-08-01 06:29:39 UTC
 +++ Makefile
-@@ -5,7 +5,6 @@ PREFIX=/usr/local
+@@ -1,11 +1,10 @@
+ 
+-PREFIX=/usr/local
++PREFIX?=/usr/local
+ #PREFIX=/tmp/smplayer
+ 
  CONF_PREFIX=$(PREFIX)
  
  DATA_PATH=$(PREFIX)/share/smplayer
@@ -8,7 +13,14 @@
  TRANSLATION_PATH=$(PREFIX)/share/smplayer/translations
  THEMES_PATH=$(PREFIX)/share/smplayer/themes
  SHORTCUTS_PATH=$(PREFIX)/share/smplayer/shortcuts
-@@ -19,7 +18,7 @@ LRELEASE=lrelease
+@@ -14,26 +13,26 @@ ICONS_DIR=$(PREFIX)/share/icons/hicolor/
+ APPLNK_DIR=$(PREFIX)/share/applications/
+ METAINFO_DIR=$(PREFIX)/share/metainfo/
+ 
+-QMAKE=qmake
+-LRELEASE=lrelease
++QMAKE?=qmake
++LRELEASE?=lrelease
  
  DEFS=DATA_PATH=\\\"$(DATA_PATH)\\\" \
       TRANSLATION_PATH=\\\"$(TRANSLATION_PATH)\\\" \
@@ -17,6 +29,23 @@
       SHORTCUTS_PATH=\\\"$(SHORTCUTS_PATH)\\\"
  
  all: src/smplayer webserver/simple_web_server
+ 
+ src/smplayer:
+ 	./get_svn_revision.sh
+-	+cd src && $(QMAKE) $(QMAKE_OPTS) && $(DEFS) make
++	$(MAKE) -C src $(DEFS)
+ 	cd src && $(LRELEASE) smplayer.pro
+ 
+ webserver/simple_web_server:
+-	cd webserver && make
++	$(MAKE) -C webserver
+ 
+ clean:
+-	if [ -f src/Makefile ]; then cd src && make distclean; fi
++	if [ -f src/Makefile ]; then $(MAKE) -C src distclean; fi
+ 	-rm src/translations/smplayer_*.qm
+ 	-rm webserver/simple_web_server
+ 
 @@ -44,13 +43,8 @@ install: all
  	install -m 644 src/input.conf $(DESTDIR)$(DATA_PATH)
  	-install -d $(DESTDIR)$(TRANSLATION_PATH)
diff --git a/multimedia/smplayer/files/pkg-message.in b/multimedia/smplayer/files/pkg-message.in
index 80daf058d0e5..366f08894263 100644
--- a/multimedia/smplayer/files/pkg-message.in
+++ b/multimedia/smplayer/files/pkg-message.in
@@ -3,7 +3,7 @@
   message: <<EOM
 SMPlayer has been installed.
 
-For Youtube Videos please use multimedia/smtube port.
+For YouTube videos please use multimedia/smtube port.
 EOM
 }
 ]