pkgsrc-WIP-changes archive

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

mk/*-package.mk: make configuration for VCS checkouts simpler



Module Name:	pkgsrc-wip
Committed By:	Roland Illig <rillig%NetBSD.org@localhost>
Pushed By:	rillig
Date:		Tue Feb 27 14:26:37 2018 +0000
Changeset:	c4ea44c8ba2e8678651b98f50ec1baaa18e952a1

Modified Files:
	mk/hg-package.mk
	mk/svn-package.mk
	nspr-hg/Makefile
	p5-xmlsig-svn/Makefile

Log Message:
mk/*-package.mk: make configuration for VCS checkouts simpler

Most packages only need to define a single line, containing the
repository URL.

The HG_ROOT_SOURCEFORGE still contained the word "cvsroot" and therefore
was never used. It has been removed to keep the code as simple as
possible.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=c4ea44c8ba2e8678651b98f50ec1baaa18e952a1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 mk/hg-package.mk       | 33 ++++++++++++++++++++++++++-------
 mk/svn-package.mk      | 27 +++++++++++++++++++++++++++
 nspr-hg/Makefile       | 14 ++++----------
 p5-xmlsig-svn/Makefile |  8 +-------
 4 files changed, 58 insertions(+), 24 deletions(-)

diffs:
diff --git a/mk/hg-package.mk b/mk/hg-package.mk
index a1498f2891..781281804d 100644
--- a/mk/hg-package.mk
+++ b/mk/hg-package.mk
@@ -14,6 +14,20 @@
 #
 # === Package-settable variables ===
 #
+# HG_REPO (required)
+#	The Mercurial repository URL.
+#
+#	Example: https://hg.mozilla.org/projects/nspr
+#
+# HG_TAG (optional)
+#	The Mercurial tag to check out.
+#
+#	Default: HEAD
+#
+# If a package needs to checkout from more than one Mercurial repository,
+# the setup is a little more complicated, using parameterized variants of
+# the above variables.
+#
 # HG_REPOSITORIES (required)
 #	A list of unique identifiers /id/ for which appropriate
 #	HG_REPO must be defined.
@@ -58,14 +72,19 @@ PKGREVISION?=		${_HG_PKGVERSION:S/.//g}
 # definition of user-visible output variables
 #
 
-# commonly used repositories
-HG_ROOT_SOURCEFORGE?=	http://${HG_PROJECT}.hg.sourceforge.net:/cvsroot/${HG_PROJECT}
-HG_PROJECT?=		${PKGBASE}
-
 #
 # End of the interface part. Start of the implementation part.
 #
 
+# The common case of a single repository.
+.if defined(HG_REPO)
+HG_MODULE?=		${HG_REPO:S,/$,,:T}
+HG_REPOSITORIES+=	_default
+HG_REPO._default=	${HG_REPO}
+HG_MODULE._default=	${HG_MODULE}
+WRKSRC?=		${WRKDIR}/${HG_MODULE}
+.endif
+
 #
 # Input validation
 #
@@ -177,9 +196,9 @@ do-hg-extract:
 
 # Debug info for show-all and show-all-hg
 _VARGROUPS+=	hg
-_USR_VARS.hg+=	HG_DISTDIR
-_PKG_VARS.hg+=	HG_TAG CHECKOUT_DATE HG_REPOSITORIES
-_SYS_VARS.hg+=	DISTFILES PKGNAME PKGREVISION HG_ROOT_SOURCEFORGE HG_PROJECT
+_USR_VARS.hg+=	CHECKOUT_DATE HG_DISTDIR
+_PKG_VARS.hg+=	HG_REPO HG_MODULE HG_TAG HG_REPOSITORIES
+_SYS_VARS.hg+=	DISTFILES PKGNAME PKGREVISION WRKSRC
 _SYS_VARS.hg+=	_HG_PKGVERSION
 .for repo in ${HG_REPOSITORIES}
 .  for varbase in HG_REPO HG_MODULE HG_TAG
diff --git a/mk/svn-package.mk b/mk/svn-package.mk
index 6c2afa2650..d526844dd3 100644
--- a/mk/svn-package.mk
+++ b/mk/svn-package.mk
@@ -5,6 +5,24 @@
 #
 # Package-settable variables:
 #
+# SVN_REPO (required)
+#	The URL of the Subversion repository.
+#
+#	Example: http://svn.code.sf.net/p/projectname/code/trunk
+#
+# SVN_REVISION (optional)
+#	The revision to check out.
+#
+#	Example: 12345
+#
+# SVN_BRANCH (optional)
+#	The branch to check out. Whenever possible, a fixed revision should
+#	be used instead of a branch.
+#
+# If a package needs to checkout from more than one Subversion repository,
+# the setup is a little more complicated, using parameterized variants of
+# the above variables.
+#
 # SVN_REPOSITORIES (required)
 #	A list of unique identifiers /id/ for which appropriate
 #	SVN_REPO must be defined.
@@ -45,6 +63,15 @@ PKGREVISION?=		${_SVN_PKGVERSION:S/.//g}
 # End of the interface part. Start of the implementation part.
 #
 
+# The common case of a single repository.
+.if defined(SVN_REPO)
+SVN_MODULE?=		${SVN_REPO:S,/$,,:S,/trunk,,:S,/code,,:T}
+SVN_REPOSITORIES+=	_default
+SVN_REPO._default=	${SVN_REPO}
+SVN_MODULE._default=	${SVN_MODULE}
+WRKSRC?=		${WRKDIR}/${SVN_MODULE}
+.endif
+
 #
 # Input validation
 #
diff --git a/nspr-hg/Makefile b/nspr-hg/Makefile
index 8887e3611b..2d0e93d121 100644
--- a/nspr-hg/Makefile
+++ b/nspr-hg/Makefile
@@ -1,22 +1,16 @@
-# $NetBSD: Makefile,v 1.3 2015/06/06 14:31:26 thomasklausner Exp $
+# $NetBSD$
 
-# necessary because hg-package.mk would override it
-PKGNAME=	nspr-${NSPR_RELEASE}
-DISTNAME=	nspr-${NSPR_RELEASE}
 NSPR_RELEASE=	4.14beta1
+DISTNAME=	nspr-${NSPR_RELEASE}
+PKGNAME=	${DISTNAME} # to prevent hg-package.mk from overriding it
 CATEGORIES=	devel
-MASTER_SITES=	${MASTER_SITE_MOZILLA_ALL:=nspr/releases/v${NSPR_RELEASE}/src/}
+HG_REPO=	https://hg.mozilla.org/projects/nspr
 
 MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
 HOMEPAGE=	https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR
 COMMENT=	Platform-neutral API for system level and libc like functions (hg version)
 LICENSE=	mpl-2.0
 
-HG_REPOSITORIES=	nspr
-HG_REPO.nspr=		https://hg.mozilla.org/projects/nspr
-WRKSRC=			${WRKDIR}/nspr
-#WRKSRC=		${WRKDIR}
-
 CHECK_PORTABILITY_SKIP+=	${MOZILLA_DIR}js/src/configure
 CHECK_PORTABILITY_SKIP+=	${MOZILLA_DIR}configure
 
diff --git a/p5-xmlsig-svn/Makefile b/p5-xmlsig-svn/Makefile
index 6ba96a2047..a8325f6f7f 100644
--- a/p5-xmlsig-svn/Makefile
+++ b/p5-xmlsig-svn/Makefile
@@ -4,19 +4,13 @@
 DISTNAME=	xmlsig-1.0.1
 PKGNAME=	p5-${DISTNAME}
 CATEGORIES=	textproc
-MASTER_SITES=	http://sourceforge.net/projects/xmlsig/ # stub
+SVN_REPO=	http://svn.code.sf.net/p/xmlsig/code/trunk
 
 MAINTAINER=	gianni-pkgsrc-wip%daprile.net@localhost
 HOMEPAGE=	http://sourceforge.net/projects/xmlsig/
 COMMENT=	Multi-language, multi-platform implementation of XML signatures
 LICENSE=	apache-2.0
 
-# Get it from Subversion repository:
-SVN_REPOSITORIES=	xmlsig
-SVN_REPO.xmlsig=	http://svn.code.sf.net/p/xmlsig/code/trunk
-
-WRKSRC=		${WRKDIR}/${SVN_MODULE.xmlsig}
-
 CONFIGURE_DIRS=	perl
 USE_LANGUAGES=	c c++
 USE_TOOLS+=	gmake perl


Home | Main Index | Thread Index | Old Index