1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-25 04:43:33 +00:00

www/gitea: Use linker flags to set version instead of patching the source.

PR:		240744
Submitted by:	stb@lassitu.de (maintainer)
Reported by:	Ivan <bsd@abinet.ru>
Approved by:	araujo (mentor)
Differential Revision:	https://reviews.freebsd.org/D21771
This commit is contained in:
Dmitri Goutnik 2019-09-23 22:57:28 +00:00
parent 52a95aca95
commit 20844bfa4e
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=512686

View File

@ -4,6 +4,7 @@
PORTNAME= gitea
DISTVERSIONPREFIX= v
DISTVERSION= 1.9.3
PORTREVISION= 1
CATEGORIES= www
MAINTAINER= stb@lassitu.de
@ -19,7 +20,7 @@ USE_GITHUB= yes
GH_ACCOUNT= go-gitea
USE_RC_SUBR= gitea
GO_BUILDFLAGS= -tags "${GO_TAGS}"
GO_BUILDFLAGS= -tags "${GO_TAGS}" -ldflags '-X "main.Version=${PORTVERSION}"'
SUB_FILES+= app.ini.sample
SUB_LIST+= GITUSER=${USERS}
@ -47,15 +48,6 @@ DAEMONARGS= -f
SUB_LIST+= DAEMONARGS="${DAEMONARGS}"
post-patch:
# Gitea releases don't supply the release version number; the
# automatic method to obtain the version number in the Gitea build
# system only works when sources are checked out from git.
# See https://github.com/go-gitea/gitea/issues/1136#issuecomment-311622745
@${SED} -Ei .orig \
-e 's#^(var Version = )"[^"]+"#\1"${PORTVERSION}"#' \
${GO_WRKSRC}/main.go
do-install:
${INSTALL_PROGRAM} ${GO_WRKDIR_BIN}/${PORTNAME} ${STAGEDIR}${PREFIX}/sbin
@${MKDIR} ${STAGEDIR}${ETCDIR}/conf