Changeset View
Changeset View
Standalone View
Standalone View
head/en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml
Show First 20 Lines • Show All 1,971 Lines • ▼ Show 20 Lines | project</entry> | ||||
<row> | <row> | ||||
<entry><varname>GH_TAGNAME</varname></entry> | <entry><varname>GH_TAGNAME</varname></entry> | ||||
<entry>Name of the tag to download (2.0.1, hash, ...) | <entry>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 | ||||
also possible to use the hash of a commit id to do a | also possible to use the hash of a commit id to do a | ||||
snapshot.</entry> | snapshot.</entry> | ||||
<entry><literal>${DISTVERSIONPREFIX}${DISTVERSION}${DISTVERSIONSUFFIX}</literal></entry> | <entry><literal>${DISTVERSIONPREFIX}${DISTVERSION}${DISTVERSIONSUFFIX}</literal></entry> | ||||
</row> | </row> | ||||
<row> | |||||
<entry><varname>GH_TUPLE</varname></entry> | |||||
<entry><varname>GH_TUPLE</varname> allows putting all | |||||
the <varname>GH_ACCOUNT</varname>, | |||||
<varname>GH_PROJECT</varname>, and | |||||
<varname>GH_TAGNAME</varname> into one variable. The | |||||
format is | |||||
<replaceable>account</replaceable><literal>:</literal><replaceable>project</replaceable><literal>:</literal><replaceable>tagname</replaceable><literal>:</literal><replaceable>group</replaceable>. | |||||
It is helpful when there is more than one GitHub | |||||
project from which to fetch.</entry> | |||||
</row> | |||||
</tbody> | </tbody> | ||||
</tgroup> | </tgroup> | ||||
</table> | </table> | ||||
<important> | |||||
<para>Do not use <varname>GH_TUPLE</varname> for the default | |||||
distribution file, as it has no default.</para> | |||||
</important> | |||||
<example xml:id="makefile-master_sites-github-ex1"> | <example xml:id="makefile-master_sites-github-ex1"> | ||||
<title>Simple Use of <varname>USE_GITHUB</varname></title> | <title>Simple Use of <varname>USE_GITHUB</varname></title> | ||||
<para>While trying to make a port for version | <para>While trying to make a port for version | ||||
<literal>1.2.7</literal> of <application>pkg</application> | <literal>1.2.7</literal> of <application>pkg</application> | ||||
from the &os; user on github, at <link | from the &os; user on github, at <link | ||||
xlink:href="https://github.com/freebsd/pkg"/>, The | xlink:href="https://github.com/freebsd/pkg"/>, The | ||||
<filename>Makefile</filename> would end up looking like | <filename>Makefile</filename> would end up looking like | ||||
▲ Show 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | USE_GITHUB= yes</programlisting> | ||||
<para>It will automatically set | <para>It will automatically set | ||||
<varname>GH_TAGNAME</varname> to | <varname>GH_TAGNAME</varname> to | ||||
<literal>v1.0.2</literal>, while <varname>WRKSRC</varname> | <literal>v1.0.2</literal>, while <varname>WRKSRC</varname> | ||||
will be kept to | will be kept to | ||||
<varname>${WRKDIR}/foo-1.0.2</varname>.</para> | <varname>${WRKDIR}/foo-1.0.2</varname>.</para> | ||||
</example> | </example> | ||||
<sect3> | <sect3 xml:id="makefile-master_sites-github-multiple"> | ||||
<title>Fetching Multiple Files from GitHub</title> | <title>Fetching Multiple Files from GitHub</title> | ||||
<para>The <varname>USE_GITHUB</varname> framework also | <para>The <varname>USE_GITHUB</varname> framework also | ||||
supports fetching multiple distribution files from | supports fetching multiple distribution files from | ||||
different places in GitHub. It works in a way very | different places in GitHub. It works in a way very | ||||
similar to <xref | similar to <xref | ||||
linkend="porting-master-sites-n"/>.</para> | linkend="porting-master-sites-n"/>.</para> | ||||
<para>Multiple values are added to | <para>Multiple values are added to | ||||
<varname>GH_ACCOUNT</varname>, | <varname>GH_ACCOUNT</varname>, | ||||
<varname>GH_PROJECT</varname>, and | <varname>GH_PROJECT</varname>, and | ||||
<varname>GH_TAGNAME</varname>. Each different value is | <varname>GH_TAGNAME</varname>. Each different value is | ||||
assigned a tag. The main value can either have no tag, or | assigned a tag. The main value can either have no tag, or | ||||
the <literal>:DEFAULT</literal> tag. A value can be | the <literal>:DEFAULT</literal> tag. A value can be | ||||
omitted if it is the same as the default as listed in | omitted if it is the same as the default as listed in | ||||
<xref | <xref | ||||
linkend="makefile-master_sites-github-description"/>.</para> | linkend="makefile-master_sites-github-description"/>.</para> | ||||
<para><varname>GH_TUPLE</varname> can also be used when there | |||||
are a lot of distribution files. It helps keep the account, | |||||
project, tagname, and group information at the same | |||||
place.</para> | |||||
<para>For each tag, a | <para>For each tag, a | ||||
<varname>${WRKSRC_<replaceable>tag</replaceable>}</varname> | <varname>${WRKSRC_<replaceable>tag</replaceable>}</varname> | ||||
helper variable is created, containing the directory into | helper variable is created, containing the directory into | ||||
which the file has been extracted. The | which the file has been extracted. The | ||||
<varname>${WRKSRC_<replaceable>tag</replaceable>}</varname> | <varname>${WRKSRC_<replaceable>tag</replaceable>}</varname> | ||||
variables can be used to move directories around during | variables can be used to move directories around during | ||||
<buildtarget>post-extract</buildtarget>, or add to | <buildtarget>post-extract</buildtarget>, or add to | ||||
<varname>CONFIGURE_ARGS</varname>, or whatever is needed | <varname>CONFIGURE_ARGS</varname>, or whatever is needed | ||||
▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | <para>All the distribution files are extracted in | ||||
additional distribution file is extracted in | additional distribution file is extracted in | ||||
<varname>${WRKSRC_<replaceable>tag</replaceable>}</varname>. | <varname>${WRKSRC_<replaceable>tag</replaceable>}</varname>. | ||||
Here, for the <literal>icons</literal> tag, it is called | Here, for the <literal>icons</literal> tag, it is called | ||||
<varname>${WRKSRC_icons}</varname> and it contains | <varname>${WRKSRC_icons}</varname> and it contains | ||||
<filename>${WRKDIR}/foo-icons-1.0</filename>. The file | <filename>${WRKDIR}/foo-icons-1.0</filename>. The file | ||||
with the <literal>contrib</literal> tag is called | with the <literal>contrib</literal> tag is called | ||||
<varname>${WRKSRC_contrib}</varname> and contains | <varname>${WRKSRC_contrib}</varname> and contains | ||||
<literal>${WRKDIR}/foo-contrib-fa579bc</literal>.</para> | <literal>${WRKDIR}/foo-contrib-fa579bc</literal>.</para> | ||||
</example> | |||||
<example xml:id="makefile-master_sites-github-multi2"> | |||||
<title>Use of <varname>USE_GITHUB</varname> with Multiple | |||||
Distribution Files Using | |||||
<varname>GH_TUPLE</varname></title> | |||||
<para>This is functionally equivalent to <xref | |||||
linkend="makefile-master_sites-github-multi"/>, but | |||||
using <varname>GH_TUPLE</varname>:</para> | |||||
<programlisting>PORTNAME= foo | |||||
PORTVERSION= 1.0.2 | |||||
USE_GITHUB= yes | |||||
GH_TUPLE= bar:foo-icons:1.0:icons \ | |||||
bar:foo-contrib:fa579bc:contrib | |||||
CONFIGURE_ARGS= --with-contrib=${WRKSRC_contrib} | |||||
post-extract: | |||||
@${MV} ${WRKSRC_icons} ${WRKSRC}/icons</programlisting> | |||||
<para>Grouping was used in the previous example with | |||||
<literal>bar:icons,contrib</literal>. Some redundant | |||||
information is present with <varname>GH_TUPLE</varname> | |||||
because grouping is not possible.</para> | |||||
</example> | </example> | ||||
</sect3> | </sect3> | ||||
</sect2> | </sect2> | ||||
<sect2 xml:id="makefile-extract_sufx"> | <sect2 xml:id="makefile-extract_sufx"> | ||||
<title><varname>EXTRACT_SUFX</varname></title> | <title><varname>EXTRACT_SUFX</varname></title> | ||||
<para>If there is one distribution file, and it uses an odd | <para>If there is one distribution file, and it uses an odd | ||||
▲ Show 20 Lines • Show All 3,231 Lines • Show Last 20 Lines |