Introduce USE_GITHUB=nodefault to allow fetching additional distfiles

from github, but not the default one.

With hat:	portmgr
Sponsored by:	Absolight
This commit is contained in:
Mathieu Arnold 2015-05-29 13:07:33 +00:00
parent 65089af011
commit 70444a23e6
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=387852
3 changed files with 14 additions and 5 deletions

View File

@ -10,6 +10,13 @@ in the release notes and/or placed into UPDATING.
All ports committers are allowed to commit to this file.
20150529:
AUTHOR: mat@FreeBSD.org
Extend the multiple distfiles USE_GITHUB framework by allowing it to fetch
only additional distfiles, but not the main one. Set USE_GITHUB=nodefault
and use the GH_* variables with groups as usual.
20150528:
AUTHOR: mat@FreeBSD.org

View File

@ -1316,7 +1316,7 @@ _SUF2= ,${PORTEPOCH}
PKGVERSION= ${PORTVERSION:C/[-_,]/./g}${_SUF1}${_SUF2}
PKGNAME= ${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}-${PKGVERSION}
DISTVERSIONFULL= ${DISTVERSIONPREFIX}${DISTVERSION:C/:(.)/\1/g}${DISTVERSIONSUFFIX}
.if defined(USE_GITHUB) && empty(MASTER_SITES:MGHC) && empty(DISTNAME)
.if defined(USE_GITHUB) && empty(MASTER_SITES:MGHC) && empty(DISTNAME) && empty(USE_GITHUB:Mnodefault)
_GITHUB_MUST_SET_DISTNAME= yes
.else
DISTNAME?= ${PORTNAME}-${DISTVERSIONFULL}
@ -5376,7 +5376,7 @@ _CHECK_CONFIG_ERROR= true
.if !target(check-config)
check-config: _check-config
.if !empty(_CHECK_CONFIG_ERROR)
.if !empty(_CHECK_CONFIG_ERROR) && !defined(IGNORE_INVALID_CONFIG)
@${FALSE}
.endif
.endif # check-config

View File

@ -520,7 +520,7 @@ IGNORE?= Using master as GH_TAGNAME is invalid. \
MASTER_SITE_GITHUB+= https://codeload.github.com/%SUBDIR%
MASTER_SITE_GITHUB_CLOUD+= http://cloud.github.com/downloads/%SUBDIR%
. if !defined(MASTER_SITES) || !${MASTER_SITES:MGH} && !${MASTER_SITES:MGHC}
. if !defined(MASTER_SITES) || !${MASTER_SITES:MGH} && !${MASTER_SITES:MGHC} && !${USE_GITHUB:Mnodefault}
MASTER_SITES+= GH
. endif
_GH_ACCOUNT_DEFAULT= ${PORTNAME}
@ -603,6 +603,7 @@ GH_TAGNAME_SANITIZED= ${GH_TAGNAME:S,/,-,}
# and extraction directory.
GH_TAGNAME_EXTRACT= ${GH_TAGNAME_SANITIZED:C/^[vV]([0-9])/\1/}
. endif
_GITHUB_REV= 0
. if defined(_GITHUB_MUST_SET_DISTNAME)
# GH_TAGNAME defaults to DISTVERSIONFULL; Avoid adding DISTVERSIONFULL in twice
. if ${GH_TAGNAME} != ${DISTVERSIONFULL}
@ -610,20 +611,21 @@ DISTNAME= ${GH_ACCOUNT}-${GH_PROJECT}-${DISTVERSIONFULL}-${GH_TAGNAME_SANITIZED}
. else
DISTNAME= ${GH_ACCOUNT}-${GH_PROJECT}-${GH_TAGNAME_SANITIZED}
. endif
. endif
# This new scheme rerolls distfiles. Also ensure they are renamed to avoid
# conflicts. Use _GITHUB_REV in case github changes their zipping or structure
# which has happened before.
_GITHUB_REV= 0
. if ${MASTER_SITES:MGH}
DISTNAME:= ${DISTNAME}_GH${_GITHUB_REV}
. endif
. endif
.endif
_GITHUB_EXTRACT_SUFX= .tar.gz
# If there are non default groups
.if !empty(_GITHUB_GROUPS:NDEFAULT)
# Put the DEFAULT distfile first
.if !${USE_GITHUB:Mnodefault}
DISTFILES+= ${DISTNAME}${_GITHUB_EXTRACT_SUFX}
.endif
# Then for each of the remaining groups, add DISTFILES and MASTER_SITES
# entries with the correct group and create {WRKSRC,DISTNAME,DISTFILES}_group
# helper variables.