Index: Mk/bsd.port.mk =================================================================== --- Mk/bsd.port.mk +++ Mk/bsd.port.mk @@ -5288,7 +5288,7 @@ 150:extract-depends 190:clean-wrkdir 200:${EXTRACT_WRKDIR} \ 300:pre-extract 450:pre-extract-script 500:do-extract \ 700:post-extract 850:post-extract-script \ - ${_OPTIONS_extract} ${_USES_extract} + ${_OPTIONS_extract} ${_USES_extract} ${_SITES_extract} _PATCH_DEP= extract _PATCH_SEQ= 050:ask-license 100:patch-message 150:patch-depends \ 300:pre-patch 450:pre-patch-script 500:do-patch \ Index: Mk/bsd.sites.mk =================================================================== --- Mk/bsd.sites.mk +++ Mk/bsd.sites.mk @@ -514,7 +514,11 @@ # Using the name of a branch here is incorrect. It is # possible to do GH_TAGNAME= GIT_HASH to do a snapshot. # 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(GH_TAGNAME) && ${GH_TAGNAME} == master @@ -523,18 +527,19 @@ not "reroll" as soon as the branch is updated . endif . if defined(GH_TUPLE) -.for _tuple in ${GH_TUPLE} +. for _tuple in ${GH_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:: @${ECHO_MSG} "The ${_tuple} GH_TUPLE line has" @${ECHO_MSG} "a tag containing something else than [a-zA-Z0-9_]" @${FALSE} -.endif -.endfor -GH_ACCOUNT+= ${GH_TUPLE:C@^([^:]*):([^:]*):([^:]*)((:[^:]*)?)@\1\4@} -GH_PROJECT+= ${GH_TUPLE:C@^([^:]*):([^:]*):([^:]*)((:[^:]*)?)@\2\4@} -GH_TAGNAME+= ${GH_TUPLE:C@^([^:]*):([^:]*):([^:]*)((:[^:]*)?)@\3\4@} +. endif +. endfor +GH_ACCOUNT+= ${GH_TUPLE:C@^([^:]*):([^:]*):([^:]*)((:[^:/]*)?)((/.*)?)@\1\4@} +GH_PROJECT+= ${GH_TUPLE:C@^([^:]*):([^:]*):([^:]*)((:[^:/]*)?)((/.*)?)@\2\4@} +GH_TAGNAME+= ${GH_TUPLE:C@^([^:]*):([^:]*):([^:]*)((:[^:/]*)?)((/.*)?)@\3\4@} +GH_SUBDIR+= ${GH_TUPLE:C@^([^:]*):([^:]*):([^:]*)((:[^:/]*)?)((/.*)?)@\6\4@:M/*:S/^\///} . endif # 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. @@ -613,11 +618,32 @@ GH_TAGNAME_DEFAULT= ${_T:C@^(.*):[^/:]+$@\1@} . endif . endfor +. for _S in ${GH_SUBDIR} +_S_SEMP= ${_S:S/^${_S:C@:[^/:]+$@@}//:S/^://} +. if !empty(_S_SEMP) +. for _group in ${_S_SEMP:S/,/ /g} +_G_SEMP= ${_group} +. if ${_G_SEMP} == all || ${_G_SEMP} == ALL || ${_G_SEMP} == 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}= ${_S:C@^(.*):[^/:]+$@\1@} +. endfor +. else +GH_SUBDIR_DEFAULT= ${_S:C@^(.*):[^/:]+$@\1@} +. endif +. endfor # Put the default values back into the variables so that the *default* behavior # is not changed. GH_ACCOUNT:= ${GH_ACCOUNT_DEFAULT} GH_PROJECT:= ${GH_PROJECT_DEFAULT} GH_TAGNAME:= ${GH_TAGNAME_DEFAULT} +GH_SUBDIR:= ${GH_SUBDIR_DEFAULT} . if defined(GH_TAGNAME) GH_TAGNAME_SANITIZED= ${GH_TAGNAME:S,/,-,} # Github silently converts tags starting with v to not have v in the filename @@ -644,6 +670,13 @@ . if !${USE_GITHUB:Mnodefault} && defined(_GITHUB_MUST_SET_DISTNAME) DISTFILES+= ${DISTNAME}${_GITHUB_EXTRACT_SUFX} . endif +. if !empty(GH_SUBDIR) +_SITES_extract:= 690:post-extract-gh-DEFAULT +post-extract-gh-DEFAULT: + @${RMDIR} ${WRKSRC}/${GH_SUBDIR} 2>/dev/null || true + @${MKDIR} ${WRKSRC}/${GH_SUBDIR:H} 2>/dev/null || true + @${LN} -s ${GH_SUBDIR:C/[^\/]//g:C/\//..\//g} ${WRKSRC}/${GH_SUBDIR} +. endif # If there are non default groups . if !empty(_GITHUB_GROUPS:NDEFAULT) # Then for each of the remaining groups, add DISTFILES and MASTER_SITES @@ -660,6 +693,13 @@ 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}@} 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}} 2>/dev/null || true + @${MKDIR} ${WRKSRC}/${GH_SUBDIR_${_group}:H} 2>/dev/null || true + @${MV} ${WRKSRC_${_group}} ${WRKSRC}/${GH_SUBDIR_${_group}} +. endif . endfor . endif .endif # defined(USE_GITHUB) Index: devel/android-tools-fastboot/Makefile =================================================================== --- devel/android-tools-fastboot/Makefile +++ devel/android-tools-fastboot/Makefile @@ -22,6 +22,7 @@ GH_ACCOUNT= android jbeich:extras,libselinux GH_PROJECT= platform_system_core platform_system_extras:extras \ platform_external_libselinux:libselinux +GH_SUBDIR= libselinux:libselinux # Emulate GH_COMMIT without causing desync .ifdef DISTVERSIONSUFFIX @@ -70,7 +71,6 @@ ${BUILD_WRKSRC}/${DISTFILES:M*\:manpage:C/\?.*//} # Adjust paths relative to core @(cd ${WRKSRC_extras} && ${COPYTREE_SHARE} . ${WRKSRC}) - @${MV} ${WRKSRC_libselinux} ${WRKSRC}/libselinux post-install-BASH-on: ${MKDIR} ${STAGEDIR}${PREFIX}/${BASH_PLIST_FILES:H} Index: devel/android-tools-simpleperf/Makefile =================================================================== --- devel/android-tools-simpleperf/Makefile +++ devel/android-tools-simpleperf/Makefile @@ -23,6 +23,7 @@ GH_TAGNAME= ${GH_MYTAG}-249-g5f1de52:bionic \ ${GH_MYTAG}-554-g371e7ea170d7:core \ ${GH_MYTAG}-6-ge43f249:lzma +GH_SUBDIR= bionic:bionic lzma:lzma USES= compiler:c++11-lib uidfix BUILD_WRKSRC= ${WRKSRC}/simpleperf @@ -45,8 +46,6 @@ post-extract: # Adjust paths relative to extras @(cd ${WRKSRC_core} && ${COPYTREE_SHARE} . ${WRKSRC}) - @${MV} ${WRKSRC_bionic} ${WRKSRC}/bionic - @${MV} ${WRKSRC_lzma} ${WRKSRC}/lzma post-patch: # XXX C++ exception with description "regex_error" thrown in the test body. Index: devel/cargo/Makefile =================================================================== --- devel/cargo/Makefile +++ devel/cargo/Makefile @@ -43,6 +43,7 @@ GH_ACCOUNT= rust-lang GH_PROJECT= rust-installer:rust_installer GH_TAGNAME= 4915c75:rust_installer +GH_SUBDIR= src/rust-installer:rust_installer ONLY_FOR_ARCHS= amd64 ONLY_FOR_ARCHS_REASON= requires prebuilt bootstrap cargo @@ -83,10 +84,6 @@ BOOTSTRAP_VARS+= WITH_OPENSSL_PORT=yes .endif -post-extract: - @${RMDIR} ${WRKSRC}/src/rust-installer - @${MV} ${WRKSRC_rust_installer} ${WRKSRC}/src/rust-installer - post-extract-BOOTSTRAP-on: @${MKDIR} ${WRKSRC}/target/dl ${LN} -sf ${DISTDIR}/${CARGO_BOOT} ${WRKSRC}/target/dl/ Index: devel/libbrotli/Makefile =================================================================== --- devel/libbrotli/Makefile +++ devel/libbrotli/Makefile @@ -19,15 +19,13 @@ GH_ACCOUNT= google:brotli GH_PROJECT= brotli:brotli GH_TAGNAME= ${BROTLI_VERSION}:brotli +GH_SUBDIR= brotli:brotli USES= pkgconfig autoreconf libtool compiler:c++0x GNU_CONFIGURE= yes USE_LDCONFIG= yes WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTNAME}-${PORTVERSION} -post-extract: - ${RMDIR} ${WRKSRC}/brotli && ${MV} ${WRKSRC_brotli} ${WRKSRC}/brotli - pre-configure: cd ${WRKSRC} && ./autogen.sh Index: finance/moneymanagerex/Makefile =================================================================== --- finance/moneymanagerex/Makefile +++ finance/moneymanagerex/Makefile @@ -16,17 +16,17 @@ USE_GITHUB= yes GH_ACCOUNT= moneymanagerex GH_PROJECT= moneymanagerex -GH_TUPLE= Regaddi:Chart.js:f13f99b:chart_js \ - FVANCOP:ChartNew.js:77e7f87:chartnew_js \ - diepes:sorttable.js:3c63cb0:sorttable_js \ - utelle:wxsqlite3:v3.3.1:wxsqlite3 \ - moneymanagerex:database:5d7129f:database \ - moneymanagerex:LuaGlue:c51d11a:luaglue \ - moneymanagerex:cajun:3684900:cajun \ - moneymanagerex:html-template:cd434ee:html_template \ - moneymanagerex:csv-parser:ca3f0d7:csv_parser \ - moneymanagerex:ctpp:20158e0:ctpp \ - moneymanagerex:mongoose:97583a6:mongoose +GH_TUPLE= Regaddi:Chart.js:f13f99b:chart_js/3rd/Chart.js \ + FVANCOP:ChartNew.js:77e7f87:chartnew_js/3rd/ChartNew.js \ + diepes:sorttable.js:3c63cb0:sorttable_js/3rd/sorttable.js \ + utelle:wxsqlite3:v3.3.1:wxsqlite3/lib/wxsqlite3 \ + moneymanagerex:database:5d7129f:database/database \ + moneymanagerex:LuaGlue:c51d11a:luaglue/3rd/LuaGlue \ + moneymanagerex:cajun:3684900:cajun/3rd/cajun \ + moneymanagerex:html-template:cd434ee:html_template/3rd/cgitemplate \ + moneymanagerex:csv-parser:ca3f0d7:csv_parser/3rd/csv-parser \ + moneymanagerex:ctpp:20158e0:ctpp/3rd/ctpp \ + moneymanagerex:mongoose:97583a6:mongoose/3rd/mongoose USES= autoreconf compiler:c++11-lib gettext gmake lua pkgconfig GNU_CONFIGURE= yes @@ -53,17 +53,6 @@ .endif post-extract: - @${MV} ${WRKSRC_database}/* ${WRKSRC}/database - @${MV} ${WRKSRC_chart_js}/* ${WRKSRC}/3rd/Chart.js - @${MV} ${WRKSRC_chartnew_js}/* ${WRKSRC}/3rd/ChartNew.js - @${MV} ${WRKSRC_luaglue}/* ${WRKSRC}/3rd/LuaGlue - @${MV} ${WRKSRC_cajun}/* ${WRKSRC}/3rd/cajun - @${MV} ${WRKSRC_csv_parser}/* ${WRKSRC}/3rd/csv-parser - @${MV} ${WRKSRC_ctpp}/* ${WRKSRC}/3rd/ctpp - @${MV} ${WRKSRC_html_template}/* ${WRKSRC}/3rd/cgitemplate - @${MV} ${WRKSRC_mongoose}/* ${WRKSRC}/3rd/mongoose - @${MV} ${WRKSRC_sorttable_js}/* ${WRKSRC}/3rd/sorttable.js - @${MV} ${WRKSRC_wxsqlite3}/* ${WRKSRC}/lib/wxsqlite3 @${MV} ${WRKDIR}/bakefile-0.2.9/autoconf/*.m4 ${WRKSRC}/m4 post-patch: