Changeset View
Changeset View
Standalone View
Standalone View
Mk/bsd.sites.mk
Show First 20 Lines • Show All 508 Lines • ▼ Show 20 Lines | |||||
# | # | ||||
# GH_PROJECT - name of the project on GitHub | # GH_PROJECT - name of the project on GitHub | ||||
# default: ${PORTNAME} | # default: ${PORTNAME} | ||||
# | # | ||||
# GH_TAGNAME - name of the tag to download (2.0.1, hash, ...) | # GH_TAGNAME - name of the tag to download (2.0.1, hash, ...) | ||||
# Using the name of a branch here is incorrect. It is | # Using the name of a branch here is incorrect. It is | ||||
# possible to do GH_TAGNAME= GIT_HASH to do a snapshot. | # possible to do GH_TAGNAME= GIT_HASH to do a snapshot. | ||||
# default: ${DISTVERSION} | # default: ${DISTVERSION} | ||||
# GH_TUPLE - above shortened to account:project:tagname[:group] | |||||
# | # | ||||
# GH_SUBDIR - directory relative to WRKSRC where to move this distfile's | |||||
# content after extracting. | |||||
# | |||||
# GH_TUPLE - above shortened to account:project:tagname[:group][/subdir] | |||||
# | |||||
.if defined(USE_GITHUB) | .if defined(USE_GITHUB) | ||||
. if defined(GH_TAGNAME) && ${GH_TAGNAME} == master | . if defined(GH_TAGNAME) && ${GH_TAGNAME} == master | ||||
IGNORE?= Using master as GH_TAGNAME is invalid. \ | IGNORE?= Using master as GH_TAGNAME is invalid. \ | ||||
Must use a tag or commit hash so the upstream does \ | Must use a tag or commit hash so the upstream does \ | ||||
not "reroll" as soon as the branch is updated | not "reroll" as soon as the branch is updated | ||||
. endif | . endif | ||||
. if defined(GH_TUPLE) | . if defined(GH_TUPLE) | ||||
.for _tuple in ${GH_TUPLE} | . for _tuple in ${GH_TUPLE} | ||||
_t_tmp=${_tuple} | _t_tmp=${_tuple} | ||||
.if ${_t_tmp:C@^([^:]*):([^:]*):([^:]*)((:[^:]*)?)@\4@:S/://:C/[a-zA-Z0-9_]//g} | . if ${_t_tmp:C@^([^:]*):([^:]*):([^:]*)((:[^:/]*)?)((/.*)?)@\4@:S/://:C/[a-zA-Z0-9_]//g} | ||||
check-makevars:: | check-makevars:: | ||||
@${ECHO_MSG} "The ${_tuple} GH_TUPLE line has" | @${ECHO_MSG} "The ${_tuple} GH_TUPLE line has" | ||||
@${ECHO_MSG} "a tag containing something else than [a-zA-Z0-9_]" | @${ECHO_MSG} "a tag containing something else than [a-zA-Z0-9_]" | ||||
@${FALSE} | @${FALSE} | ||||
.endif | . endif | ||||
.endfor | . endfor | ||||
GH_ACCOUNT+= ${GH_TUPLE:C@^([^:]*):([^:]*):([^:]*)((:[^:]*)?)@\1\4@} | GH_ACCOUNT+= ${GH_TUPLE:C@^([^:]*):([^:]*):([^:]*)((:[^:/]*)?)((/.*)?)@\1\4@} | ||||
GH_PROJECT+= ${GH_TUPLE:C@^([^:]*):([^:]*):([^:]*)((:[^:]*)?)@\2\4@} | GH_PROJECT+= ${GH_TUPLE:C@^([^:]*):([^:]*):([^:]*)((:[^:/]*)?)((/.*)?)@\2\4@} | ||||
GH_TAGNAME+= ${GH_TUPLE:C@^([^:]*):([^:]*):([^:]*)((:[^:]*)?)@\3\4@} | GH_TAGNAME+= ${GH_TUPLE:C@^([^:]*):([^:]*):([^:]*)((:[^:/]*)?)((/.*)?)@\3\4@} | ||||
GH_SUBDIR+= ${GH_TUPLE:C@^([^:]*):([^:]*):([^:]*)((:[^:/]*)?)((/.*)?)@\6\4@:M/*} | |||||
. endif | . endif | ||||
# We are cheating and using backend URLS for Github here. See ports/194898 | # We are cheating and using backend URLS for Github here. See ports/194898 | ||||
# comment #15 for explanation as to why and how to deal with it if it breaks. | # comment #15 for explanation as to why and how to deal with it if it breaks. | ||||
MASTER_SITE_GITHUB+= https://codeload.github.com/%SUBDIR% | MASTER_SITE_GITHUB+= https://codeload.github.com/%SUBDIR% | ||||
MASTER_SITE_GITHUB_CLOUD+= https://cloud.github.com/downloads/%SUBDIR% | MASTER_SITE_GITHUB_CLOUD+= https://cloud.github.com/downloads/%SUBDIR% | ||||
. if !defined(MASTER_SITES) || !${MASTER_SITES:MGH} && !${MASTER_SITES:MGHC} && !${USE_GITHUB:Mnodefault} | . if !defined(MASTER_SITES) || !${MASTER_SITES:MGH} && !${MASTER_SITES:MGHC} && !${USE_GITHUB:Mnodefault} | ||||
MASTER_SITES+= GH | MASTER_SITES+= GH | ||||
▲ Show 20 Lines • Show All 62 Lines • ▼ Show 20 Lines | |||||
_GITHUB_GROUPS+= ${_group} | _GITHUB_GROUPS+= ${_group} | ||||
. endif | . endif | ||||
GH_TAGNAME_${_group}= ${_T:C@^(.*):[^/:]+$@\1@} | GH_TAGNAME_${_group}= ${_T:C@^(.*):[^/:]+$@\1@} | ||||
. endfor | . endfor | ||||
. else | . else | ||||
GH_TAGNAME_DEFAULT= ${_T:C@^(.*):[^/:]+$@\1@} | GH_TAGNAME_DEFAULT= ${_T:C@^(.*):[^/:]+$@\1@} | ||||
. endif | . endif | ||||
. endfor | . endfor | ||||
. for _T in ${GH_SUBDIR} | |||||
_S_TEMP= ${_T:S/^${_T:C@:[^/:]+$@@}//:S/^://} | |||||
. if !empty(_S_TEMP) | |||||
. for _group in ${_S_TEMP:S/,/ /g} | |||||
_G_TEMP= ${_group} | |||||
. if ${_G_TEMP} == all || ${_G_TEMP} == ALL || ${_G_TEMP} == default | |||||
check-makevars:: | |||||
@${ECHO_MSG} "Makefile error: the words all, ALL and default are reserved and cannot be" | |||||
@${ECHO_MSG} "used in group definitions. Please fix your GH_SUBDIR" | |||||
@${FALSE} | |||||
. endif | |||||
. if !${_GITHUB_GROUPS:M${_group}} | |||||
_GITHUB_GROUPS+= ${_group} | |||||
. endif | |||||
GH_SUBDIR_${_group}= ${_T:C@^(.*):[^/:]+$@\1@} | |||||
. endfor | |||||
. endif | |||||
. endfor | |||||
# Put the default values back into the variables so that the *default* behavior | # Put the default values back into the variables so that the *default* behavior | ||||
# is not changed. | # is not changed. | ||||
GH_ACCOUNT:= ${GH_ACCOUNT_DEFAULT} | GH_ACCOUNT:= ${GH_ACCOUNT_DEFAULT} | ||||
GH_PROJECT:= ${GH_PROJECT_DEFAULT} | GH_PROJECT:= ${GH_PROJECT_DEFAULT} | ||||
GH_TAGNAME:= ${GH_TAGNAME_DEFAULT} | GH_TAGNAME:= ${GH_TAGNAME_DEFAULT} | ||||
. if defined(GH_TAGNAME) | . if defined(GH_TAGNAME) | ||||
GH_TAGNAME_SANITIZED= ${GH_TAGNAME:S,/,-,} | GH_TAGNAME_SANITIZED= ${GH_TAGNAME:S,/,-,} | ||||
# Github silently converts tags starting with v to not have v in the filename | # Github silently converts tags starting with v to not have v in the filename | ||||
Show All 31 Lines | |||||
GH_TAGNAME_${_group}?= ${GH_TAGNAME_DEFAULT} | GH_TAGNAME_${_group}?= ${GH_TAGNAME_DEFAULT} | ||||
GH_TAGNAME_${_group}_SANITIZED= ${GH_TAGNAME_${_group}:S,/,-,} | GH_TAGNAME_${_group}_SANITIZED= ${GH_TAGNAME_${_group}:S,/,-,} | ||||
GH_TAGNAME_${_group}_EXTRACT= ${GH_TAGNAME_${_group}_SANITIZED:C/^[vV]([0-9])/\1/} | GH_TAGNAME_${_group}_EXTRACT= ${GH_TAGNAME_${_group}_SANITIZED:C/^[vV]([0-9])/\1/} | ||||
DISTNAME_${_group}:= ${GH_ACCOUNT_${_group}}-${GH_PROJECT_${_group}}-${GH_TAGNAME_${_group}_SANITIZED} | DISTNAME_${_group}:= ${GH_ACCOUNT_${_group}}-${GH_PROJECT_${_group}}-${GH_TAGNAME_${_group}_SANITIZED} | ||||
DISTFILE_${_group}:= ${DISTNAME_${_group}}_GH${_GITHUB_REV}${_GITHUB_EXTRACT_SUFX} | DISTFILE_${_group}:= ${DISTNAME_${_group}}_GH${_GITHUB_REV}${_GITHUB_EXTRACT_SUFX} | ||||
DISTFILES:= ${DISTFILES} ${DISTFILE_${_group}}:${_group} | DISTFILES:= ${DISTFILES} ${DISTFILE_${_group}}:${_group} | ||||
MASTER_SITES:= ${MASTER_SITES} ${MASTER_SITE_GITHUB:S@%SUBDIR%@${GH_ACCOUNT_${_group}}/${GH_PROJECT_${_group}}/tar.gz/${GH_TAGNAME_${_group}}?dummy=/:${_group}@} | MASTER_SITES:= ${MASTER_SITES} ${MASTER_SITE_GITHUB:S@%SUBDIR%@${GH_ACCOUNT_${_group}}/${GH_PROJECT_${_group}}/tar.gz/${GH_TAGNAME_${_group}}?dummy=/:${_group}@} | ||||
WRKSRC_${_group}:= ${WRKDIR}/${GH_PROJECT_${_group}}-${GH_TAGNAME_${_group}_EXTRACT} | WRKSRC_${_group}:= ${WRKDIR}/${GH_PROJECT_${_group}}-${GH_TAGNAME_${_group}_EXTRACT} | ||||
. if !empty(GH_SUBDIR_${_group}) | |||||
_SITES_extract:= ${_SITES_extract} 690:post-extract-gh-${_group} | |||||
post-extract-gh-${_group}: | |||||
@${RMDIR} ${WRKSRC}${GH_SUBDIR_${_group}} | |||||
@${MV} ${WRKSRC_${_group}} ${WRKSRC}${GH_SUBDIR_${_group}} | |||||
. endif | |||||
. endfor | . endfor | ||||
. endif | . endif | ||||
.endif # defined(USE_GITHUB) | .endif # defined(USE_GITHUB) | ||||
.endif # !defined(IGNORE_MASTER_SITE_GITHUB) | .endif # !defined(IGNORE_MASTER_SITE_GITHUB) | ||||
.if !defined(IGNORE_MASTER_SITE_GNOME) | .if !defined(IGNORE_MASTER_SITE_GNOME) | ||||
MASTER_SITE_GNOME+= \ | MASTER_SITE_GNOME+= \ | ||||
https://download.gnome.org/%SUBDIR%/ \ | https://download.gnome.org/%SUBDIR%/ \ | ||||
▲ Show 20 Lines • Show All 816 Lines • Show Last 20 Lines |