Index: head/en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml =================================================================== --- head/en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml +++ head/en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml @@ -1930,8 +1930,9 @@ + - + <varname>USE_GITHUB</varname> If the distribution file comes from a specific commit or @@ -2009,8 +2010,8 @@ While trying to make a port for the bleeding edge version of pkg from the &os; user on github, at , The - Makefile would end up looking like + xlink:href="https://github.com/freebsd/pkg"/>, the + Makefile ends up looking like this (slightly stripped for the example): PORTNAME= pkg-devel @@ -2051,6 +2052,87 @@ ${WRKDIR}/foo-1.0.2. + + Fetching Multiple Files From GitHub + + The USE_GITHUB framework also + supports fetching multiple distribution files from + different places in GitHub. It works in a way very + similar to . + + Multiple values are added to + GH_ACCOUNT, + GH_PROJECT, and + GH_TAGNAME. Each different value is + assigned a tag. The main value can either have no tag, or + the :DEFAULT tag. A value can be + omitted if it is the same as the default as listed in + . + + For each tag, a + ${WRKSRC_tag} + helper variable is created, containing the directory into + which the file has been extracted. The + ${WRKSRC_tag} + variables can be used to move directories around during + post-extract, or add to + CONFIGURE_ARGS, or whatever is needed + so that the software builds correctly. + + + Use of <varname>USE_GITHUB</varname> with Multiple + Distribution Files + + From time to time, there is a need to fetch more + than one distribution file. For example, when the + upstream git repository uses submodules. This can be + done easily using tags in the + GH_* + variables: + + PORTNAME= foo +PORTVERSION= 1.0.2 + +USE_GITHUB= yes +GH_ACCOUNT= bar:icons,contrib +GH_PROJECT= foo-icons:icons foo-contrib:contrib +GH_TAGNAME= 1.0:icons fa579bc:contrib + +CONFIGURE_ARGS= --with-contrib=${WRKSRC_contrib} + +post-extract: + @${MV} ${WRKSRC_icons} ${WRKSRC}/icons + + This will fetch three distribution files from + github. The default one comes from + foo/foo and is version + 1.0.2. The second one, tagged + icons, comes from + bar/foo-icons and is in version + 1.0. The third one comes from + bar/foo-contrib and uses the + Git commit + fa579bc. The distribution files are + named foo-foo-1.0.2_GH0.tar.gz, + bar-foo-icons-1.0_GH0.tar.gz, and + bar-foo-contrib-fa579bc_GH0.tar.gz. + + All the distribution files are extracted in + ${WRKDIR} in their respective + subdirectories. The default file is still extracted in + ${WRKSRC}, in this case, + ${WRKDIR}/foo-1.0.2. Each + additional distribution file is extracted in + ${WRKSRC_tag}. + Here, for the icons tag, it is called + ${WRKSRC_icons} and it contains + ${WRKDIR}/foo-icons-1.0. The file + with the contrib tag is called + ${WRKSRC_contrib} and contains + ${WRKDIR}/foo-contrib-fa579bc. + @@ -2185,9 +2267,8 @@ - Multiple Distribution Files or Patches from Different - Sites and Subdirectories - (<literal>MASTER_SITES:n</literal>) + Multiple Distribution or Patches Files from Multiple + Locations (Consider this to be a somewhat advanced topic; those new to this document