Page MenuHomeFreeBSD

D45631.1789592732.diff
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

D45631.1789592732.diff

diff --git a/Mk/Uses/go.mk b/Mk/Uses/go.mk
--- a/Mk/Uses/go.mk
+++ b/Mk/Uses/go.mk
@@ -23,6 +23,16 @@
# In most cases, this is the only required variable for ports that
# use Go modules.
#
+# GO_MOD_DIST
+# The location to download the go.mod file if GO_MODULE is used.
+# The default is empty, so it is loaded from GO_PROXY.
+# Set it to "gitlab" and make sure GL_PROJECT is defined to download
+# the "go.mod" from gitlab.
+# Set it to "github" and make sure GH_PROJECT is defined to download
+# the "go.mod" from github.
+# You can also set it completely manually a URI without go.mod in it,
+# is attached automatically to the URI.
+#
# GO_PKGNAME
# The name of the package when building in GOPATH mode. This
# is the directory that will be created in ${GOPATH}/src. If not set
@@ -143,9 +153,25 @@
GO_MODVERSION= ${GO_MODULE:C/^([^@]*)(@([^@]*)?)/\2/:M@*:S/^@//:S/^$/${DISTVERSIONFULL}/}
GO_MODFILE= ${GO_MODVERSION}.mod
GO_DISTFILE= ${GO_MODVERSION}.zip
+# If GO_MOD_DIST is gitlab, download the go.mod from gitlab by the defined GL_ACCOUNT
+. if defined(GO_MOD_DIST) && ${GO_MOD_DIST:Mgitlab}
+MASTER_SITES+= https://gitlab.com/${GL_ACCOUNT}/${PORTNAME}/-/raw/v${DISTVERSION}/
+DISTFILES+= go.mod
+# If GO_MOD_DIST is github, download the go.mod from github by the defined GH_ACCOUNT
+. elif defined(GO_MOD_DIST) && ${GO_MOD_DIST:Mgithub}
+MASTER_SITES+= https://raw.githubusercontent.com/${GH_ACCOUNT}/${PORTNAME}/v${DISTVERSION}/
+DISTFILES+= go.mod
+# Manually defined GO_MOD_DIST
+. elifdef(GO_MOD_DIST)
+MASTER_SITES+= ${GO_MOD_DIST}
+DISTFILES+= go.mod
+# Fallback to default GO_PROXY
+. else
MASTER_SITES+= ${GO_GOPROXY}/${GO_MODNAME:C/([A-Z])/!\1/g:tl}/@v/
DISTFILES+= ${GO_MODFILE} ${GO_DISTFILE}
WRKSRC= ${WRKDIR}/${GO_MODNAME}@${GO_MODVERSION}
+. endif
+
. endif
EXTRACT_ONLY?= ${DISTFILES:N*.mod\:*:N*.mod:C/:.*//}
DIST_SUBDIR= go/${PKGORIGIN:S,/,_,g}/${DISTNAME}

File Metadata

Mime Type
text/plain
Expires
Wed, Sep 16, 9:05 PM (46 m, 30 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29705996
Default Alt Text
D45631.1789592732.diff (1 KB)

Event Timeline