git: 139487d6381f - main - games/kodi-addon-game.libretro.genplus: Update to 1.7.4.31 and more

From: Bernhard Froehlich <decke_at_FreeBSD.org>
Date: Fri, 14 Jan 2022 14:15:14 UTC
The branch main has been updated by decke:

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

commit 139487d6381fb03c9afe1c862e7791ac2b2ef6c8
Author:     Bernhard Froehlich <decke@FreeBSD.org>
AuthorDate: 2022-01-14 14:11:47 +0000
Commit:     Bernhard Froehlich <decke@FreeBSD.org>
CommitDate: 2022-01-14 14:11:47 +0000

    games/kodi-addon-game.libretro.genplus: Update to 1.7.4.31 and more
    
    This avoids bundling the genplus code and instead depends on the
    libretro-genesis_plus_gx port.
    
    PR:             261112
    Submitted by:   Ivan Rozhuk <rozhuk.im@gmail.com> (maintainer)
---
 games/kodi-addon-game.libretro.genplus/Makefile | 56 ++++++++++++-------------
 games/kodi-addon-game.libretro.genplus/distinfo |  8 ++--
 2 files changed, 30 insertions(+), 34 deletions(-)

diff --git a/games/kodi-addon-game.libretro.genplus/Makefile b/games/kodi-addon-game.libretro.genplus/Makefile
index d72fb2efa79b..aeac170a0535 100644
--- a/games/kodi-addon-game.libretro.genplus/Makefile
+++ b/games/kodi-addon-game.libretro.genplus/Makefile
@@ -1,43 +1,41 @@
 # Created by: Rozhuk Ivan <rozhuk.im@gmail.com>
 
 PORTNAME=	game.libretro.genplus
-PORTVERSION=	1.7.4.15
+PORTVERSION=	1.7.4.31
 DISTVERSIONSUFFIX=	-Matrix
-PORTREVISION=	1
 CATEGORIES=	games
 
 MAINTAINER=	rozhuk.im@gmail.com
 COMMENT=	Kodi game addon for Sega - MS/GG/MD/CD (Genesis Plus GX)
 
-LICENSE=	GPGX
-LICENSE_NAME=	GPGX
-LICENSE_FILE=	${WRKSRC}/depends/common/genplus/LICENSE.txt
-LICENSE_PERMS=	dist-mirror no-dist-sell pkg-mirror no-pkg-sell auto-accept
+LICENSE=	GPLv2+
 
-LIB_DEPENDS=	libtinyxml.so:textproc/tinyxml
-RUN_DEPENDS=	kodi-addon-game.libretro>=0:games/kodi-addon-game.libretro
+LIBRETRO_PORT=	libretro-genesis_plus_gx
 
-USES=		cmake:noninja gmake kodi
+RUN_DEPENDS=	kodi-addon-game.libretro>=0:games/kodi-addon-game.libretro \
+		${LIBRETRO_PORT}>=0:games/${LIBRETRO_PORT}
+
+NO_ARCH=	yes
+
+USES=		kodi
 USE_GITHUB=	yes
-GH_ACCOUNT=	kodi-game \
-		libretro:genplus
-GH_PROJECT=	Genesis-Plus-GX:genplus
-# Keep in sync with: depends/common/genplus/genplus.txt
-GH_TAGNAME=	0164eb9730c0803674a54a3694633a56f4801661:genplus
-
-CMAKE_ARGS=	-DCMAKE_BUILD_TYPE=Release \
-		-DBUILD_SHARED_LIBS=1 \
-		-DADDONS_TO_BUILD=${PORTNAME} \
-		-DGENPLUS_LIB=depends/common/genplus/genesis_plus_gx_libretro.so
-
-post-extract:
-	@${MV} ${WRKSRC_genplus}/* ${WRKSRC}/depends/common/genplus/
-
-post-patch:
-	@${REINPLACE_CMD} -e 's|find_library(GENPLUS_LIB.*|add_subdirectory(depends/common/genplus)|g' \
-		${WRKSRC}/CMakeLists.txt
-
-post-install:
-	${RM} -rf ${STAGEDIR}${PREFIX}/lib/libretro
+GH_ACCOUNT=	kodi-game
+
+do-build:
+	@${MKDIR} ${WRKSRC}/lib
+	@LIBRARY_FILENAME_FULL=`${MAKE} -C ../${LIBRETRO_PORT} -V PLIST_FILES | ${SED} 's| .*||g'` && \
+	LIBRARY_FILENAME=`basename "$${LIBRARY_FILENAME_FULL}"` && \
+	${LN} -sf "${LOCALBASE}/$${LIBRARY_FILENAME_FULL}" ${WRKSRC}/lib/ && \
+	${REINPLACE_CMD} -e 's|@PLATFORM@|freebsd|g' \
+		-e "s|@LIBRARY_FILENAME@|$${LIBRARY_FILENAME}|g" \
+		${WRKSRC}/${PORTNAME}/addon.xml.in
+	@${MV} ${WRKSRC}/${PORTNAME}/addon.xml.in ${WRKSRC}/${PORTNAME}/addon.xml
+	@${RM} -f ${WRKSRC}/${PORTNAME}/addon.xml.in.bak
+
+do-install:
+	@${MKDIR} ${STAGEDIR}${PREFIX}/lib/kodi/addons/${PORTNAME} \
+		${STAGEDIR}${PREFIX}/share/kodi/addons
+	@(cd ${WRKSRC}/lib/ && ${COPYTREE_SHARE} * ${STAGEDIR}${PREFIX}/lib/kodi/addons/${PORTNAME})
+	@(cd ${WRKSRC} && ${COPYTREE_SHARE} ${PORTNAME} ${STAGEDIR}${PREFIX}/share/kodi/addons)
 
 .include <bsd.port.mk>
diff --git a/games/kodi-addon-game.libretro.genplus/distinfo b/games/kodi-addon-game.libretro.genplus/distinfo
index ac3b14b76b56..f2b25c83729b 100644
--- a/games/kodi-addon-game.libretro.genplus/distinfo
+++ b/games/kodi-addon-game.libretro.genplus/distinfo
@@ -1,5 +1,3 @@
-TIMESTAMP = 1611230470
-SHA256 (kodi-game-game.libretro.genplus-1.7.4.15-Matrix_GH0.tar.gz) = 7a2cb0872e1d4a6908672dd250aeae8a3369c525b73cde30c370e0de87e22f9e
-SIZE (kodi-game-game.libretro.genplus-1.7.4.15-Matrix_GH0.tar.gz) = 862196
-SHA256 (libretro-Genesis-Plus-GX-0164eb9730c0803674a54a3694633a56f4801661_GH0.tar.gz) = 549961291e5615caa156186d5975353db84488ef7395a9d095b37ae30cf22891
-SIZE (libretro-Genesis-Plus-GX-0164eb9730c0803674a54a3694633a56f4801661_GH0.tar.gz) = 6512941
+TIMESTAMP = 1641911296
+SHA256 (kodi-game-game.libretro.genplus-1.7.4.31-Matrix_GH0.tar.gz) = 3eebfa7685da718e11bd7f1bd45c34ba796da2323d165ccc9862bcf6d987331a
+SIZE (kodi-game-game.libretro.genplus-1.7.4.31-Matrix_GH0.tar.gz) = 870715