1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-29 05:38:00 +00:00

textproc/gitlab-elasticsearch-indexer: use new feature from go.mk to download go.mod from gitlab

This commit is contained in:
Matthias Fechner 2024-07-03 12:23:53 +03:00
parent f1ff7793f1
commit ec690fc8da

View File

@ -20,29 +20,13 @@ USES= gmake go:modules,no_targets,1.22 pkgconfig
USE_GITLAB= yes
GL_ACCOUNT= gitlab-org
GO_MOD_DIST= gitlab
GO_MODULE= gitlab.com/gitlab-org/gitlab-elasticsearch-indexer
MAKE_ENV= GOFLAGS="${GO_BUILDFLAGS}"
# make sure to pass go build options into make process
MAKE_ENV+= ${GO_ENV}
# for go dependencies
# Gitlab hosts there dependencies on their own platform and not on go-proxy
# so we download the required go.mod file from gitlab
# lines are taken from go.mk
# ---------------------------
FETCH_DEPENDS= ${GO_CMD}:${GO_PORT}
MASTER_SITES+= https://gitlab.com/gitlab-org/gitlab-elasticsearch-indexer/-/raw/v${DISTVERSION}/
DISTFILES+= go.mod
DIST_SUBDIR= go/${PKGORIGIN:S,/,_,g}/${DISTNAME}
EXTRACT_ONLY+= ${DISTFILES:N*.mod\:*:N*.mod:C/:.*//}
_USES_fetch+= 800:go-post-fetch
go-post-fetch:
@${ECHO_MSG} "===> Fetching ${GO_MODNAME} dependencies";
@(cd ${DISTDIR}/${DIST_SUBDIR}; \
[ -e go.mod ] || ${RLN} ${GO_MODFILE} go.mod; \
${SETENV} ${GO_ENV} GOPROXY=${GO_GOPROXY} ${GO_CMD} mod download -x all)
# ---------------------------
PLIST_FILES= bin/${PORTNAME}
# add a git tag, as that is required by the build script