git: ea2a77b789f4 - main - devel/xtensa-esp-elf: Fix toolchain version string

From: Craig Leres <leres_at_FreeBSD.org>
Date: Thu, 17 Oct 2024 19:54:56 UTC
The branch main has been updated by leres:

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

commit ea2a77b789f4db0790a248bd6ff9996054e9e5bc
Author:     Craig Leres <leres@FreeBSD.org>
AuthorDate: 2024-10-17 19:54:35 +0000
Commit:     Craig Leres <leres@FreeBSD.org>
CommitDate: 2024-10-17 19:54:35 +0000

    devel/xtensa-esp-elf: Fix toolchain version string
    
    xtensa-esp32-elf-cc was reporting:
    
        xtensa-esp-elf-cc (crosstool-NG UNKNOWN) 13.2.0
    
    Update to correctly show the version of crosstool used:
    
        xtensa-esp-elf-cc (crosstool-NG esp-13.2.0_20240530) 13.2.0
---
 devel/xtensa-esp-elf/Makefile | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/devel/xtensa-esp-elf/Makefile b/devel/xtensa-esp-elf/Makefile
index 3b9ccfdce9fc..a34b7a88edaa 100644
--- a/devel/xtensa-esp-elf/Makefile
+++ b/devel/xtensa-esp-elf/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	xtensa-esp-elf
 DISTVERSION=	13.2.0_20240530
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	devel
 MASTER_SITES=	https://github.com/espressif/crosstool-NG/releases/download/esp-${DISTVERSION}/:source1 \
 		GNU/gmp:source2 \
@@ -74,7 +74,7 @@ CARGO_CARGOTOML=	${WRKSRC2}/Cargo.toml
 CARGO_CARGOLOCK=	${WRKSRC2}/Cargo.lock
 WRKSRC2=	${WRKDIR}/esp-toolchain-bin-wrappers-${TAG_WRAPPERS}/gnu-xtensa-toolchian
 
-ESPVER=		${DISTNAME:tl:S/-src$//:S/-esp-/-/}
+ESPVER=		esp-${DISTVERSION}
 ESPDATE=	20240305
 GCCVER=		13.2.0
 PLIST_SUB=	PKGBASE=$(PKGBASE) \
@@ -103,6 +103,10 @@ post-extract:
 	${LN} -s \
 	    ${DISTDIR}/espressif-newlib-esp32-esp-4.3.0_${ESPDATE}_GH0.tar.gz \
 	    ${TARBALLS}/newlib-esp32-esp-4.3.0_${ESPDATE}.tar.gz
+	${CP} -p ${BUILD_WRKSRC}/maintainer/git-version-gen \
+	    ${BUILD_WRKSRC}/maintainer/git-version-gen-
+	${PRINTF} "#!/bin/sh\necho -n '${ESPVER}'\n" > \
+	    ${BUILD_WRKSRC}/maintainer/git-version-gen
 
 	# Use a new crosstool.config that lets us download a
 	# branch/tag tarball instead of doing "git clone"
@@ -112,9 +116,6 @@ post-extract:
 
 do-configure:
 	cd ${BUILD_WRKSRC} && ./bootstrap
-	${PRINTF} "#!/bin/sh\necho '${ESPVER}'\n" > \
-	    ${BUILD_WRKSRC}/version.sh
-	${CHMOD} -w+x ${BUILD_WRKSRC}/version.sh
 	cd ${BUILD_WRKSRC} && \
 	    ${SETENV} ${BUILD_ENV} LIBS=-lintl \
 	    ./configure --prefix=${WRKDIR}/ct-ng --exec-prefix=${WRKDIR}/ct-ng