pkgsrc-Changes archive

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

CVS commit: pkgsrc/mk



Module Name:    pkgsrc
Committed By:   ryoon
Date:           Tue Mar 30 16:47:03 UTC 2021

Modified Files:
        pkgsrc/mk/extract: extract.mk
        pkgsrc/mk/fetch: bsd.fetch-vars.mk github.mk

Log Message:
mk: Introduce GITHUB_SUBMODULES to get and place Git submodules for GitHub


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 pkgsrc/mk/extract/extract.mk
cvs rdiff -u -r1.24 -r1.25 pkgsrc/mk/fetch/bsd.fetch-vars.mk
cvs rdiff -u -r1.13 -r1.14 pkgsrc/mk/fetch/github.mk

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

Modified files:

Index: pkgsrc/mk/extract/extract.mk
diff -u pkgsrc/mk/extract/extract.mk:1.41 pkgsrc/mk/extract/extract.mk:1.42
--- pkgsrc/mk/extract/extract.mk:1.41   Fri Mar 20 15:00:45 2020
+++ pkgsrc/mk/extract/extract.mk        Tue Mar 30 16:47:03 2021
@@ -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 @@ DOWNLOADED_DISTFILE=        "$${extract_file}"
 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

Index: pkgsrc/mk/fetch/bsd.fetch-vars.mk
diff -u pkgsrc/mk/fetch/bsd.fetch-vars.mk:1.24 pkgsrc/mk/fetch/bsd.fetch-vars.mk:1.25
--- pkgsrc/mk/fetch/bsd.fetch-vars.mk:1.24      Fri Nov 22 19:30:23 2019
+++ pkgsrc/mk/fetch/bsd.fetch-vars.mk   Tue Mar 30 16:47:03 2021
@@ -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 @@ DEFAULT_DISTFILES=   ${DISTNAME}${EXTRACT_
 .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

Index: pkgsrc/mk/fetch/github.mk
diff -u pkgsrc/mk/fetch/github.mk:1.13 pkgsrc/mk/fetch/github.mk:1.14
--- pkgsrc/mk/fetch/github.mk:1.13      Mon Nov  4 19:05:18 2019
+++ pkgsrc/mk/fetch/github.mk   Tue Mar 30 16:47:03 2021
@@ -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 @@ SITES.${_GITHUB_DEFAULT_DISTFILES}= -${M
 
 .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