git: 647f9b37f934 - main - sysutils/alloy: Improve port
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 28 Aug 2025 14:29:00 UTC
The branch main has been updated by vvd:
URL: https://cgit.FreeBSD.org/ports/commit/?id=647f9b37f934eb4ba1fffd964a8cbf456916d837
commit 647f9b37f934eb4ba1fffd964a8cbf456916d837
Author: Vladimir Druzenko <vvd@FreeBSD.org>
AuthorDate: 2025-08-28 14:19:49 +0000
Commit: Vladimir Druzenko <vvd@FreeBSD.org>
CommitDate: 2025-08-28 14:28:36 +0000
sysutils/alloy: Improve port
- Remove git from BUILD_DEPENDS - build fine without it.
- Remove go version 1.24 - it's default version in ports.
- Remove GH_PROJECT=alloy - it's default value.
- Parametrize "alloy" with "${PORTNAME}" in multiple places.
- Replace "v${PORTVERSION}" with "${GH_TAGNAME}" - suits better.
- Remove unnecessary ";" and "/" at end of commands.
- Fix warnings from portclippy and portlint.
PR: 289140
Approved by: Zach Leslie <zach.leslie@grafana.com> (maintainer)
---
sysutils/alloy/Makefile | 26 +++++++++++---------------
1 file changed, 11 insertions(+), 15 deletions(-)
diff --git a/sysutils/alloy/Makefile b/sysutils/alloy/Makefile
index 66d21ba374ea..970e6662e812 100644
--- a/sysutils/alloy/Makefile
+++ b/sysutils/alloy/Makefile
@@ -1,7 +1,6 @@
PORTNAME= alloy
+DISTVERSIONPREFIX= v
DISTVERSION= 1.10.2
-DISTVERSIONPREFIX=v
-PORTREVISION= 0
CATEGORIES= sysutils
MAINTAINER= zach.leslie@grafana.com
@@ -10,34 +9,31 @@ WWW= https://github.com/grafana/alloy
LICENSE= MIT
-BUILD_DEPENDS= git:devel/git
-
-USES= go:1.24,modules
+USES= go:modules
USE_GITHUB= yes
GH_ACCOUNT= grafana
-GH_PROJECT= alloy
-USE_RC_SUBR= alloy
+USE_RC_SUBR= ${PORTNAME}
GO_MODULE= github.com/${GH_ACCOUNT}/${GH_PROJECT}
GO_PKGNAME= github.com/${GH_ACCOUNT}/${GH_PROJECT}
GO_TARGET= github.com/${GH_ACCOUNT}/${GH_PROJECT}
-GO_BUILDFLAGS= -ldflags='-X github.com/grafana/alloy/internal/build.Version=v${PORTVERSION}'
+GO_BUILDFLAGS= -ldflags='-X github.com/grafana/alloy/internal/build.Version=${GH_TAGNAME}'
post-fetch:
- @${ECHO_MSG} "===> Fetching ${GO_MODNAME}/syntax dependency";
+ @${ECHO_MSG} "===> Fetching ${GO_MODNAME}/syntax dependency"
(cd ${DISTDIR}/${DIST_SUBDIR}; [ -e syntax/go.mod ] || (\
- ${MKDIR} syntax/; \
- ${TAR} -xzf ${DISTNAME}${EXTRACT_SUFX} ${PORTNAME}-${PORTVERSION}/syntax/go.mod; \
- ${CP} ${PORTNAME}-${PORTVERSION}/syntax/go.mod syntax/go.mod))
+ ${MKDIR} syntax; \
+ ${TAR} -xzf ${DISTNAME}${EXTRACT_SUFX} ${PORTNAME}-${DISTVERSION}/syntax/go.mod; \
+ ${CP} ${PORTNAME}-${DISTVERSION}/syntax/go.mod syntax/go.mod))
post-extract:
- ${CP} -r ${WRKDIR}/${PORTNAME}-${PORTVERSION}/syntax ${GO_WRKSRC}/syntax;
+ ${CP} -r ${WRKDIR}/${PORTNAME}-${DISTVERSION}/syntax ${GO_WRKSRC}
do-install:
- ${INSTALL_PROGRAM} ${WRKDIR}/bin/alloy ${STAGEDIR}${PREFIX}/bin/alloy
+ ${INSTALL_PROGRAM} ${WRKDIR}/bin/${PORTNAME} ${STAGEDIR}${PREFIX}/bin
${INSTALL_DATA} ${WRKSRC}/example-config.alloy ${STAGEDIR}${PREFIX}/etc/alloy.flow.sample
- ${MKDIR} ${STAGEDIR}/var/alloy
+ ${MKDIR} ${STAGEDIR}/var/${PORTNAME}
.include <bsd.port.mk>