tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: pkgsrc/mk



On Sat, 7 Mar 2015 19:07:05 +0100
Tobias Nygren <tnn%NetBSD.org@localhost> wrote:

> On Sat, 7 Mar 2015 18:45:04 +0100
> Alistair Crooks <agc%pkgsrc.org@localhost> wrote:
> 
> > I wish this had been discussed prior to bringing in - it's an infrastructure
> > change, and so would have been nice to talk about various issues I have with this
> > when not in reactionary mode.
> 
> Fair enough. I did not consider the change to be that major but I
> will not recommend it for any more packages until concerns have been
> settled.

Hi!

I'm not sure I understood everything, but I thought about your
concerns a bit and came up with this change. Is this satisfactory?

1) turn _USE_GITHUB into internal infrastructure variable
2) put back MASTER_SITES
3) encode the account in the master site URL, remove GH_ACCOUNT
4) rename GH_PROJECT to GITHUB_PROJECT
5) rename GH_TAGNAME to GITHUB_TAG and allow it to accept commit hash
   as well as tag. GH_COMMIT is gone.
6) magically turn on this functionality when MASTER_SITES matches
   a predefined github pattern instead of via explicit USE_GITHUB.

Kind regards,
-Tobias

Index: benchmarks/glmark2/Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/benchmarks/glmark2/Makefile,v
retrieving revision 1.3
diff -u -r1.3 Makefile
--- benchmarks/glmark2/Makefile	7 Mar 2015 17:15:11 -0000	1.3
+++ benchmarks/glmark2/Makefile	7 Mar 2015 20:14:45 -0000
@@ -2,8 +2,8 @@
 
 DISTNAME=	glmark2-2014.03
 CATEGORIES=	benchmarks
-USE_GITHUB=	yes
-GH_COMMIT=	499aa81a68fb4c8aac1c80f0d6a4cce05941c4cc
+MASTER_SITES=	${MASTER_SITE_GITHUB:=glmark2/}
+GITHUB_TAG=	499aa81a68fb4c8aac1c80f0d6a4cce05941c4cc
 
 MAINTAINER=	prlw1%cam.ac.uk@localhost
 HOMEPAGE=	https://github.com/glmark2/glmark2
Index: mk/bsd.pkg.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/bsd.pkg.mk,v
retrieving revision 1.2010
diff -u -r1.2010 bsd.pkg.mk
--- mk/bsd.pkg.mk	7 Mar 2015 14:17:51 -0000	1.2010
+++ mk/bsd.pkg.mk	7 Mar 2015 20:14:45 -0000
@@ -96,12 +96,8 @@
 .endif
 PKGWILDCARD?=		${PKGBASE}-[0-9]*
 TOOL_DEPENDS?=		# empty
-.if defined(USE_GITHUB) && !empty(USE_GITHUB:M[yY][eE][sS]) && \
-	defined(GH_COMMIT) && !empty(GH_COMMIT)
-WRKSRC?=		${WRKDIR}/${GH_PROJECT}-${GH_COMMIT}
-.elif defined(USE_GITHUB) && !empty(USE_GITHUB:M[yY][eE][sS]) && \
-	defined(GH_TAGNAME) && !empty(GH_TAGNAME)
-WRKSRC?=	${WRKDIR}/${GH_PROJECT}-${GH_TAGNAME:C/^v//}
+.if defined(GITHUB_TAG)
+WRKSRC?=		${WRKDIR}/${GITHUB_PROJECT}-${GITHUB_TAG:C/^v//}
 .else
 WRKSRC?=		${WRKDIR}/${DISTNAME:U${PKGNAME_NOREV}}
 .endif
Index: mk/fetch/github.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/fetch/github.mk,v
retrieving revision 1.4
diff -u -r1.4 github.mk
--- mk/fetch/github.mk	7 Mar 2015 16:54:28 -0000	1.4
+++ mk/fetch/github.mk	7 Mar 2015 20:14:45 -0000
@@ -31,39 +31,41 @@
 #
 # Keywords: github
 
-.if defined(USE_GITHUB) && !empty(USE_GITHUB:M[yY][eE][sS])
+# xxx move this to sites.mk
+MASTER_SITE_GITHUB?=	https://github.com/
 
-# maybe move this to sites.mk
-MASTER_SITE_GITHUB?=		https://github.com/
+.if defined(MASTER_SITES) && !empty(MASTER_SITES:Mhttps\://github.com/[a-zA-Z0-9]*/)
+_USE_GITHUB=		YES
+.endif
+
+.if (defined(GITHUB_TAG) || defined(GITHUB_RELEASE)) && !defined(_USE_GITHUB)
+PKG_FAIL_REASON+=	"MASTER_SITES must match https://github.com/account/";	\
+			"when GITHUB_TAG or GITHUB_RELEASE is in use."
+.endif
 
-GH_ACCOUNT?=	${PKGBASE}
-GH_PROJECT?=	${PKGBASE}
-GH_TAGNAME?=	${PKGVERSION_NOREV}
+.if defined(_USE_GITHUB) && !empty(_USE_GITHUB:M[yY][eE][sS])
 
-.  if !empty(GH_TAGNAME:Mmaster)
-PKG_FAIL_REASON+=	"master is not a valid tag name, use an explicit commit hash (hint: set GH_COMMIT)"
+GITHUB_PROJECT?=	${PKGBASE}
+GITHUB_TAG?=		${PKGVERSION_NOREV}
+
+.  if !empty(GITHUB_TAG:Mmaster)
+PKG_FAIL_REASON+=	"master is not a valid tag name, use an explicit commit hash"
 .  endif
 
-.  if !defined(GH_TYPE)
-.    if defined(GH_COMMIT) && !empty(GH_COMMIT:M*)
-GH_TYPE=	commit
-.  elif defined(GH_RELEASE) && !empty(GH_RELEASE:M*)
-GH_TYPE=	release
-.  else
-GH_TYPE=	tag
+.  if !defined(GITHUB_TYPE)
+.    if defined(GITHUB_RELEASE) && !empty(GITHUB_RELEASE)
+GITHUB_TYPE=	release
+.    else
+GITHUB_TYPE=	tag
 .    endif
 .  endif
 
-.if !empty(GH_TYPE:Mrelease)
-MASTER_SITES?=	${MASTER_SITE_GITHUB}${GH_ACCOUNT}/${GH_PROJECT}/releases/download/${GH_RELEASE}/
-.endif
-
-.if !empty(GH_TYPE:Mcommit)
-MASTER_SITES?=	-${MASTER_SITE_GITHUB}${GH_ACCOUNT}/${GH_PROJECT}/archive/${GH_COMMIT}${EXTRACT_SUFX}
+.if !empty(GITHUB_TYPE:Mrelease)
+MASTER_SITES:=	${MASTER_SITES:=${GITHUB_PROJECT}/releases/download/${GITHUB_RELEASE}/}
 .endif
 
-.if !empty(GH_TYPE:Mtag)
-MASTER_SITES?=	-${MASTER_SITE_GITHUB}${GH_ACCOUNT}/${GH_PROJECT}/archive/${GH_TAGNAME}${EXTRACT_SUFX}
+.if !empty(GITHUB_TYPE:Mtag)
+MASTER_SITES:=	-${MASTER_SITES:=${GITHUB_PROJECT}/archive/${GITHUB_TAG}${EXTRACT_SUFX}}
 .endif
 
 .endif


Home | Main Index | Thread Index | Old Index