diff --git bsd.port.mk bsd.port.mk
index a31757c39fc..ef76d864c8e 100644
--- bsd.port.mk
+++ bsd.port.mk
@@ -129,6 +129,7 @@ _ALL_VARIABLES += HOMEPAGE DISTNAME \
SHARED_LIBS TARGETS PSEUDO_FLAVOR \
MAINTAINER AUTOCONF_VERSION AUTOMAKE_VERSION CONFIGURE_ARGS \
GH_ACCOUNT GH_COMMIT GH_PROJECT GH_TAGNAME PORTROACH \
+ GL_ACCOUNT GL_COMMIT GL_PROJECT GL_TAGNAME \
PORTROACH_COMMENT MAKEFILE_LIST USE_LLD USE_WXNEEDED COMPILER \
COMPILER_LANGS COMPILER_LINKS SUBST_VARS UPDATE_PLIST_ARGS \
PKGPATHS
@@ -620,6 +621,15 @@ GH_PROJECT ?=
DISTNAME ?= ${GH_PROJECT}-${GH_TAGNAME:C/^v//}
.endif
+GL_TAGNAME ?=
+GL_COMMIT ?=
+GL_ACCOUNT ?=
+GL_PROJECT ?=
+
+.if !empty(GL_PROJECT) && !empty(GL_TAGNAME)
+DISTNAME ?= ${GL_PROJECT}-${GL_TAGNAME:C/^v//}
+.endif
+
PKGNAME ?= ${DISTNAME}
FULLPKGNAME ?= ${PKGNAME}${FLAVOR_EXT}
_MASTER ?=
@@ -868,6 +878,18 @@ WRKDIST ?= ${WRKDIR}/${DISTNAME}
. endif
.endif
+.if !empty(GL_TAGNAME)
+WRKDIST ?= ${WRKDIR}/${GL_PROJECT}-${GL_TAGNAME:C/^v//}
+.elif !empty(GL_COMMIT)
+WRKDIST ?= ${WRKDIR}/${GL_PROJECT}-${GL_COMMIT}
+.else
+. if !defined(DISTNAME)
+WRKDIST ?= ${WRKDIR}
+. else
+WRKDIST ?= ${WRKDIR}/${DISTNAME}
+. endif
+.endif
+
WRKSRC ?= ${WRKDIST}
.if ${SEPARATE_BUILD:L} != "no"
@@ -1184,6 +1206,28 @@ HOMEPAGE ?= https://github.com/${GH_ACCOUNT}/${GH_PROJECT}
MASTER_SITES ?=
.endif
+.if !empty(GL_ACCOUNT) && !empty(GL_PROJECT)
+. if !empty(GL_COMMIT) && !empty(GL_TAGNAME)
+ERRORS += "Fatal: specifying both GL_TAGNAME and GL_COMMIT is invalid"
+. endif
+. if ${GL_TAGNAME} == master
+ERRORS += "Fatal: using master as GL_TAGNAME is invalid"
+. endif
+. if !empty(GL_TAGNAME)
+MASTER_SITES_GITLAB += \
+ https://gitlab.com/${GL_ACCOUNT}/${GL_PROJECT}/-/archive/${GL_TAGNAME:S/$/\//}
+. else
+MASTER_SITES_GITLAB += \
+ https://gitlab.com/${GL_ACCOUNT}/${GL_PROJECT}/-/archive/${GL_COMMIT}/${GL_PROJECT-}${GL_COMMIT:S/$/\//}
+. endif
+
+MASTER_SITES ?= ${MASTER_SITES_GITLAB}
+HOMEPAGE ?= https://gitlab.com/${GL_ACCOUNT}/${GL_PROJECT}
+.else
+# Empty declarations to avoid "variable XXX is recursive" errors
+MASTER_SITES ?=
+.endif
+
# I guess we're in the master distribution business! :) As we gain mirror
# sites for distfiles, add them to MASTER_SITE_BACKUP
@@ -1211,6 +1255,14 @@ DISTFILES ?= ${DISTNAME}${EXTRACT_SUFX}
. endif
.endif
+.if !empty(GL_COMMIT)
+DISTFILES ?= ${DISTNAME}-${GL_COMMIT:C/(........).*/\1/}${EXTRACT_SUFX}{${GL_COMMIT}${EXTRACT_SUFX}}
+.else
+. if defined(DISTNAME)
+DISTFILES ?= ${DISTNAME}${EXTRACT_SUFX}
+. endif
+.endif
+
PATCHFILES ?=
SUPDISTFILES ?=
Any feedback for this?
Edward Lopez-Acosta
On 12/16/18 9:11 AM, Edward Lopez-Acosta wrote:
> Hello,
>
> I spent some time and added GitLab support to bsd.port.mk in a similar
> manner as GitHub. Since Microsoft's acquisition of GitHub a large number
> of projects, including major ones like the freedesktop project, have
> migrated to GitLab. I also have a number of projects at GitLab that I
> have been thinking of porting.
>
> https://about.gitlab.com/2018/06/03/movingtogitlab/
> https://about.gitlab.com/2018/08/20/freedesktop-org-migrates-to-gitlab/
>
> I did some tests on this and it seems to work like the GH_* directives
> but would like some additional review if possible please.
>
> Thank you,
No comments:
Post a Comment