pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/mk mk: Introduce GITHUB_SUBMODULES to get and place Gi...
details: https://anonhg.NetBSD.org/pkgsrc/rev/2d5122e71e85
branches: trunk
changeset: 449454:2d5122e71e85
user: ryoon <ryoon%pkgsrc.org@localhost>
date: Tue Mar 30 16:47:03 2021 +0000
description:
mk: Introduce GITHUB_SUBMODULES to get and place Git submodules for GitHub
diffstat:
mk/extract/extract.mk | 3 ++-
mk/fetch/bsd.fetch-vars.mk | 9 ++++++++-
mk/fetch/github.mk | 24 ++++++++++++++++++++----
3 files changed, 30 insertions(+), 6 deletions(-)
diffs (86 lines):
diff -r 7c0acc2a110a -r 2d5122e71e85 mk/extract/extract.mk
--- a/mk/extract/extract.mk Tue Mar 30 16:40:22 2021 +0000
+++ b/mk/extract/extract.mk Tue Mar 30 16:47:03 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: extract.mk,v 1.41 2020/03/20 15:00:45 rillig Exp $
+# $NetBSD: extract.mk,v 1.42 2021/03/30 16:47:03 ryoon Exp $
#
# The following variables may be set by the package Makefile and
# specify how extraction happens:
@@ -216,6 +216,7 @@
do-extract: ${WRKDIR}
. for f in ${EXTRACT_ONLY}
${RUN} extract_file=${_DISTDIR:Q}/${f:Q}; export extract_file; \
+ EXTRACT_OPTS_TAR=${EXTRACT_OPTS_TAR.${f}}; export EXTRACT_OPTS_TAR; \
cd ${WRKDIR} && cd ${EXTRACT_DIR.${f}} && ${EXTRACT_CMD}
. endfor
.endif
diff -r 7c0acc2a110a -r 2d5122e71e85 mk/fetch/bsd.fetch-vars.mk
--- a/mk/fetch/bsd.fetch-vars.mk Tue Mar 30 16:40:22 2021 +0000
+++ b/mk/fetch/bsd.fetch-vars.mk Tue Mar 30 16:47:03 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.fetch-vars.mk,v 1.24 2019/11/22 19:30:23 rillig Exp $
+# $NetBSD: bsd.fetch-vars.mk,v 1.25 2021/03/30 16:47:03 ryoon Exp $
#
# This Makefile fragment is included separately by bsd.pkg.mk and
# defines some variables which must be defined earlier than where
@@ -60,6 +60,13 @@
.endif
DISTFILES?= ${DEFAULT_DISTFILES}
+.if !empty(GITHUB_SUBMODULES)
+. for _GITHUB_SM_USER _GITHUB_SM_PROJECT _GITHUB_SM_TAG _GITHUB_SM_PLACE in ${GITHUB_SUBMODULES}
+DISTFILES+= ${_GITHUB_SM_USER}-${_GITHUB_SM_PROJECT}-${_GITHUB_SM_TAG}${EXTRACT_SUFX}
+. endfor
+.endif
+
+
# File lists, defined early to allow tool dependencies.
ALLFILES?= ${DISTFILES} ${PATCHFILES}
ALLFILES:= ${ALLFILES:O:u} # remove duplicates
diff -r 7c0acc2a110a -r 2d5122e71e85 mk/fetch/github.mk
--- a/mk/fetch/github.mk Tue Mar 30 16:40:22 2021 +0000
+++ b/mk/fetch/github.mk Tue Mar 30 16:47:03 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: github.mk,v 1.13 2019/11/04 19:05:18 rillig Exp $
+# $NetBSD: github.mk,v 1.14 2021/03/30 16:47:03 ryoon Exp $
#
# github.com master site handling
#
@@ -15,6 +15,9 @@
# SHA-1 commit ids are also acceptable
# GITHUB_RELEASE defaults to not defined, set this to ${DISTNAME}
# when packaging a release not based on a git tag.
+# GITHUB_SUBMODULE manually set submodule information:
+# values should be:
+# GitHub_user GitHub_project tag_or_hash submodule_path
# GITHUB_TYPE overrides the autodetected MASTER_SITE URL scheme:
#
# "tag"
@@ -72,10 +75,23 @@
.endif
+.if !empty(GITHUB_SUBMODULES)
+. for _GITHUB_SM_USER _GITHUB_SM_PROJECT _GITHUB_SM_TAG _GITHUB_SM_PLACE in ${GITHUB_SUBMODULES}
+_GITHUB_SM_DISTFILE= ${_GITHUB_SM_USER}-${_GITHUB_SM_PROJECT}-${_GITHUB_SM_TAG}${EXTRACT_SUFX}
+_GITHUB_DEFAULT_DISTFILES+= ${_GITHUB_SM_USER}-${_GITHUB_SM_PROJECT}-${_GITHUB_SM_TAG}${EXTRACT_SUFX}
+SITES.${_GITHUB_SM_DISTFILE}= -${MASTER_SITE_GITHUB:=${_GITHUB_SM_USER}/${_GITHUB_SM_PROJECT}/archive/${_GITHUB_SM_TAG}${EXTRACT_SUFX}}
+EXTRACT_DIR.${_GITHUB_SM_DISTFILE}= ${WRKSRC}/${_GITHUB_SM_PLACE}
+EXTRACT_OPTS_TAR.${_GITHUB_SM_DISTFILE}= --strip-components=1
+. endfor
+.endif
+
_VARGROUPS+= github
_PKG_VARS.github= GITHUB_PROJECT DISTNAME GITHUB_TYPE GITHUB_TAG \
- GITHUB_RELEASE MASTER_SITES EXTRACT_SUFX
-_DEF_VARS.github= _USE_GITHUB _GITHUB_DEFAULT_DISTFILES \
- SITES.${_GITHUB_DEFAULT_DISTFILES}
+ GITHUB_RELEASE MASTER_SITES EXTRACT_SUFX \
+ GITHUB_SUBMODULES
+_DEF_VARS.github= _USE_GITHUB _GITHUB_DEFAULT_DISTFILES
+.for f in ${_GITHUB_DEFAULT_DISTFILES}
+_DEF_VARS.github+= SITES.${f}
+.endfor
_USE_VARS.github= PKGBASE PKGVERSION_NOREV
_LISTED_VARS.github= SITES.*
Home |
Main Index |
Thread Index |
Old Index