Changeset View
Standalone View
en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 2,870 Lines • ▼ Show 20 Lines | GH_TUPLE= utelle:wxsqlite3:v3.4.0:wxsqlite3/lib/wxsqlite3 \ | ||||
moneymanagerex:LuaGlue:c51d11a:lua_glue/3rd/LuaGlue \ | moneymanagerex:LuaGlue:c51d11a:lua_glue/3rd/LuaGlue \ | ||||
moneymanagerex:html-template:cd434ee:html_template/3rd/cgitemplate \ | moneymanagerex:html-template:cd434ee:html_template/3rd/cgitemplate \ | ||||
cesanta:mongoose:2140e59:mongoose/3rd/mongoose \ | cesanta:mongoose:2140e59:mongoose/3rd/mongoose \ | ||||
[...]</programlisting> | [...]</programlisting> | ||||
</example> | </example> | ||||
</sect3> | </sect3> | ||||
</sect2> | </sect2> | ||||
<sect2 xml:id="makefile-master_sites-gitlab"> | |||||
<title><varname>USE_GITLAB</varname></title> | |||||
<para>Similar to GitHub, if the distribution file comes from | |||||
<link xlink:href="https://gitlab.com">gitlab.com</link> | |||||
or is hosting the <application>GitLab</application> | |||||
mat: ```
<application>GitLab</application>, these variables are available for uses and
```
(and… | |||||
software, these variables are available for uses and may | |||||
wblockUnsubmitted Done Inline ActionsShould that be "available for use" or does it really mean USES? Also, s/may/might/ (because "may" usually means permission, and "might" is when something has a probability). wblock: Should that be "available for use" or does it really mean USES?
Also, s/may/might/ (because… | |||||
ultimaAuthorUnsubmitted Not Done Inline ActionsNice catch, I should have probably realized the uses sounded a bit off when I fixed it! >.< ultima: Nice catch, I should have probably realized the uses sounded a bit off when I fixed it! >.< | |||||
need to be set.</para> | |||||
Done Inline Actionsempty line between para and table. mat: empty line between para and table. | |||||
<table xml:id="makefile-master_sites-gitlab-description"> | |||||
<title><varname>USE_GITLAB</varname> Description</title> | |||||
<tgroup cols="3"> | |||||
<thead> | |||||
<row> | |||||
<entry>Variable</entry> | |||||
<entry>Description</entry> | |||||
<entry>Default</entry> | |||||
</row> | |||||
</thead> | |||||
<tbody> | |||||
<row> | |||||
<entry><varname>GL_SITE</varname></entry> | |||||
<entry>Site name hosting the <application>GitLab</application> | |||||
project</entry> <entry>https://gitlab.com</entry> | |||||
</row> | |||||
<row> | |||||
<entry><varname>GL_ACCOUNT</varname></entry> | |||||
<entry>Account name of the <application>GitLab</application> | |||||
user hosting the project</entry> | |||||
<entry><literal>${PORTNAME}</literal></entry> | |||||
</row> | |||||
<row> | |||||
<entry><varname>GL_PROJECT</varname></entry> | |||||
<entry>Name of the project on <application>GitLab</application></entry> | |||||
<entry><literal>${PORTNAME}</literal></entry> | |||||
</row> | |||||
<row> | |||||
<entry><varname>GL_COMMIT</varname></entry> | |||||
<entry>The commit hash to download. Must be the full | |||||
160 bit, 40 character hex sha1 hash. This is a required | |||||
variable for <application>GitLab</application>.</entry> | |||||
<entry><literal>(none)</literal></entry> | |||||
</row> | |||||
<row> | |||||
<entry><varname>GL_SUBDIR</varname></entry> | |||||
<entry>When the software needs an additional | |||||
distribution file to be extracted within | |||||
<varname>${WRKSRC}</varname>, this variable can be | |||||
used. See the examples in <xref | |||||
linkend="makefile-master_sites-gitlab-multiple"/> | |||||
for more information.</entry> | |||||
<entry>(none)</entry> | |||||
</row> | |||||
<row> | |||||
<entry><varname>GL_TUPLE</varname></entry> | |||||
<entry><varname>GL_TUPLE</varname> allows putting | |||||
<varname>GL_SITE</varname>, | |||||
<varname>GL_ACCOUNT</varname>, | |||||
<varname>GL_PROJECT</varname>, | |||||
<varname>GL_COMMIT</varname>, and | |||||
<varname>GL_SUBDIR</varname> into a single variable. | |||||
The format is | |||||
<replaceable>site</replaceable><literal>:</literal><replaceable>account</replaceable><literal>:</literal><replaceable>project</replaceable><literal>:</literal><replaceable>commit</replaceable><literal>:</literal><replaceable>group</replaceable><literal>/</literal><replaceable>subdir</replaceable>. | |||||
Not Done Inline ActionsI wonder if there is a way to express the optionalliness (yes, I wrote it, so it exists) of those two directly in docbook. (but it is not important) mat: I wonder if there is a way to express the optionalliness (yes, I wrote it, so it exists) of… | |||||
The <replaceable>site</replaceable><literal>:</literal> and | |||||
<literal>/</literal><replaceable>subdir</replaceable> | |||||
part is optional. It is helpful when there are more | |||||
than one <application>GitLab</application> project from | |||||
which to fetch.</entry> | |||||
</row> | |||||
</tbody> | |||||
</tgroup> | |||||
Done Inline Actionsthe </table> and <example> should have the same indentation, but there is a good chance that it is phabricator being stupid. mat: the `</table>` and `<example>` should have the same indentation, but there is a good chance… | |||||
Not Done Inline ActionsLooks like it was actually my mistake, fixed! ultima: Looks like it was actually my mistake, fixed! | |||||
</table> | |||||
<example xml:id="makefile-master_sites-gitlab-ex1"> | |||||
<title>Simple Use of <varname>USE_GITLAB</varname></title> | |||||
Done Inline Actionsmaybe on gitlab.com it is kind of vague otherwise, the whole chapter is about Gitlab, one can assume you're going to talk about it. mat: maybe `on gitlab.com` it is kind of vague otherwise, the whole chapter is about Gitlab, one can… | |||||
<para>While trying to make a port for version | |||||
<literal>1.14</literal> of <application>libsignon-glib</application> | |||||
from the accounts-sso user on gitlab.com, at <link | |||||
xlink:href="https://gitlab.com/accounts-sso/libsignon-glib"/>, The | |||||
<filename>Makefile</filename> would end up looking like | |||||
this for fetching the distribution files:</para> | |||||
<programlisting>PORTNAME= libsignon-glib | |||||
DISTVERSION= 1.14 | |||||
USE_GITLAB= yes | |||||
GL_ACCOUNT= accounts-sso | |||||
GL_COMMIT= e90302e342bfd27bc8c9132ab9d0ea3d8723fd03</programlisting> | |||||
Done Inline Actionsxlink:href="https://gitlab.com">gitlab.com</link> and (because it would probably be better to have a different way of saying Gitlab as an application, and gitlab.com, the web site.) mat: ```
xlink:href="https://gitlab.com">gitlab.com</link> and
```
(because it would probably be… | |||||
<para>It will automatically have | |||||
<varname>MASTER_SITES</varname> set to <link | |||||
xlink:href="https://gitlab.com">gitlab.com</link> | |||||
and <varname>WRKSRC</varname> to | |||||
<literal>${WRKDIR}/libsignon-glib-e90302e342bfd27bc8c9132ab9d0ea3d8723fd03-e90302e342bfd27bc8c9132ab9d0ea3d8723fd03</literal>.</para> | |||||
</example> | |||||
<example xml:id="makefile-master_sites-gitlab-ex2"> | |||||
<title>More Complete Use of | |||||
<varname>USE_GITLAB</varname></title> | |||||
<para>A more complete use of the above if | |||||
Done Inline ActionsRFC 6761 describe domains names to be used in documentation, domains that are expected to not exist and the users know are for documentation purposes only. mat: [[ https://tools.ietf.org/html/rfc6761 | RFC 6761 ]] describe domains names to be used in… | |||||
Not Done Inline ActionsGood to know, example.com has been dubbed the example domain. RFC 6761 Bookmarked! I'm pretty sure if you did charge I would be in debt for years. >.< ultima: Good to know, example.com has been dubbed the example domain. RFC 6761 Bookmarked!
I'm pretty… | |||||
port had no versioning and <application>foobar</application> | |||||
from the foo user on project bar on a self hosted <application>GitLab</application> | |||||
site <literal>https://gitlab.example.com</literal>, the <filename>Makefile</filename> | |||||
ends up looking like this for fetching distribution files:</para> | |||||
<programlisting>PORTNAME= foobar | |||||
DISTVERSION= g20170906 | |||||
USE_GITLAB= yes | |||||
GL_SITE= https://gitlab.example.com | |||||
GL_ACCOUNT= foo | |||||
GL_PROJECT= bar | |||||
GL_COMMIT= 9c1669ce60c3f4f5eb43df874d7314483fb3f8a6</programlisting> | |||||
<para>It will have <varname>MASTER_SITES</varname> set to | |||||
"<literal>https://gitlab.example.com</literal>" and <varname>WRKSRC</varname> to | |||||
<literal>${WRKDIR}/bar-9c1669ce60c3f4f5eb43df874d7314483fb3f8a6-9c1669ce60c3f4f5eb43df874d7314483fb3f8a6</literal>.</para> | |||||
<tip> | |||||
<para><literal>20170906</literal> is the date of the | |||||
Done Inline Actionsthe date the commit to the &os; ports tree is made.</para> mat: ```
the date the commit to the &os; ports tree is made.</para>
``` | |||||
commit referenced in <varname>GL_COMMIT</varname>, not | |||||
the date the <filename>Makefile</filename> is edited, or | |||||
Done Inline Actionsempty line between tip and note. mat: empty line between tip and note. | |||||
the date the commit to the &os; ports tree is made.</para> | |||||
</tip> | |||||
<note> | |||||
<para><varname>GL_SITE</varname>'s protocol, port and | |||||
webroot can all be modified in the same variable.</para> | |||||
</note> | |||||
</example> | |||||
<sect3 xml:id="makefile-master_sites-gitlab-multiple"> | |||||
<title>Fetching Multiple Files from <application>GitLab</application></title> | |||||
<para>The <varname>USE_GITLAB</varname> framework also | |||||
supports fetching multiple distribution files from | |||||
different places from <application>GitLab</application> | |||||
and <application>GitLab</application> hosted sites. It | |||||
works in a way very similar to <xref | |||||
Done Inline Actionsdefault distribution file is not fetched from a GitLab site. (Because a default distribution is somewhat required, I know, you copied it from something I wrote, would be nice to fix it too 😇.) mat: ```
default distribution file is not fetched from a GitLab site.
```
(Because a default… | |||||
Not Done Inline ActionsThe fix for GitHub is at D12512 ultima: The fix for GitHub is at D12512 | |||||
linkend="porting-master-sites-n"/> and xref | |||||
linkend="makefile-master_sites-gitlab-multiple".</para> | |||||
<para>When fetching multiple files using <application>GitLab</application>, | |||||
sometimes the default distribution file is not fetched from a <application>GitLab</application> | |||||
site. To disable fetching the default distribution, set:</para> | |||||
<programlisting>USE_GITLAB= nodefault</programlisting> | |||||
<para>Multiple values are added to | |||||
<varname>GL_SITE</varname>, | |||||
<varname>GL_ACCOUNT</varname>, | |||||
<varname>GL_PROJECT</varname> and | |||||
<varname>GL_COMMIT</varname>. Each different value is | |||||
assigned a group. | |||||
<xref | |||||
linkend="makefile-master_sites-gitlab-description"/>.</para> | |||||
<para><varname>GL_TUPLE</varname> can also be used when there | |||||
are a lot of distribution files. It helps keep the site, | |||||
account, project, commit, and group information at the same | |||||
place.</para> | |||||
<para>For each group, a | |||||
<varname>${WRKSRC_<replaceable>group</replaceable>}</varname> | |||||
helper variable is created, containing the directory into | |||||
which the file has been extracted. The | |||||
<varname>${WRKSRC_<replaceable>group</replaceable>}</varname> | |||||
variables can be used to move directories around during | |||||
<buildtarget>post-extract</buildtarget>, or add to | |||||
<varname>CONFIGURE_ARGS</varname>, or whatever is needed | |||||
so that the software builds correctly.</para> | |||||
<caution> | |||||
<para>The | |||||
<literal>:<replaceable>group</replaceable></literal> part | |||||
<emphasis>must</emphasis> be used for <emphasis>only | |||||
one</emphasis> distribution file. It is used as a | |||||
unique key and using it more than once will overwrite the | |||||
previous values.</para> | |||||
</caution> | |||||
<note> | |||||
<para>As this is only syntastic sugar above | |||||
<varname>DISTFILES</varname> and | |||||
<varname>MASTER_SITES</varname>, the group names must | |||||
adhere to the restrictions on group names outlined in | |||||
<xref linkend="porting-master-sites-n"/></para> | |||||
</note> | |||||
<example xml:id="makefile-master_sites-gitlab-multi"> | |||||
<title>Use of <varname>USE_GITLAB</varname> with Multiple | |||||
Distribution Files</title> | |||||
<para>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 groups in the | |||||
<varname>GL_<replaceable>*</replaceable></varname> | |||||
variables:</para> | |||||
<programlisting>PORTNAME= foo | |||||
DISTVERSION= 1.0.2 | |||||
USE_GITLAB= yes | |||||
GL_SITE= https://gitlab.example.com:9434/gitlab:icons | |||||
GL_ACCOUNT= bar:icons,contrib | |||||
GL_PROJECT= foo-icons:icons foo-contrib:contrib | |||||
GL_COMMIT= c189207a55da45305c884fe2b50e086fcad4724b ae7368cab1ca7ca754b38d49da064df87968ffe4:icons 9e4dd76ad9b38f33fdb417a4c01935958d5acd2a:contrib | |||||
GL_SUBDIR= ext/icons:icons | |||||
CONFIGURE_ARGS= --with-contrib=${WRKSRC_contrib}</programlisting> | |||||
<para>This will fetch two distribution files from | |||||
gitlab.com and one from <literal>gitlab.example.com</literal> | |||||
hosting <application>GitLab</application>. The default one comes | |||||
from <filename>https://gitlab.com/foo/foo</filename> and commit is | |||||
<literal>c189207a55da45305c884fe2b50e086fcad4724b</literal>. The | |||||
second one, with the <literal>icons</literal> group, comes from | |||||
<filename>https://gitlab.example.com:9434/gitlab/bar/foo-icons</filename> | |||||
and commit is <literal>ae7368cab1ca7ca754b38d49da064df87968ffe4</literal>. | |||||
The third one comes from <filename>https://gitlab.com/bar/foo-contrib</filename> | |||||
and is commit <literal>9e4dd76ad9b38f33fdb417a4c01935958d5acd2a</literal>. | |||||
The distribution files are named <filename>foo-foo-c189207a55da45305c884fe2b50e086fcad4724b_GL0.tar.gz</filename>, | |||||
<filename>bar-foo-icons-ae7368cab1ca7ca754b38d49da064df87968ffe4_GL0.tar.gz</filename>, and | |||||
<filename>bar-foo-contrib-9e4dd76ad9b38f33fdb417a4c01935958d5acd2a_GL0.tar.gz</filename>.</para> | |||||
<para>All the distribution files are extracted in | |||||
<varname>${WRKDIR}</varname> in their respective | |||||
subdirectories. The default file is still extracted in | |||||
<varname>${WRKSRC}</varname>, in this case, | |||||
<filename>${WRKDIR}/foo-c189207a55da45305c884fe2b50e086fcad4724b-c189207a55da45305c884fe2b50e086fcad4724b</filename>. | |||||
Each additional distribution file is extracted in | |||||
<varname>${WRKSRC_<replaceable>group</replaceable>}</varname>. | |||||
Here, for the <literal>icons</literal> group, it is called | |||||
<varname>${WRKSRC_icons}</varname> and it contains | |||||
<filename>${WRKDIR}/foo-icons-ae7368cab1ca7ca754b38d49da064df87968ffe4-ae7368cab1ca7ca754b38d49da064df87968ffe4</filename>. | |||||
The file with the <literal>contrib</literal> group is | |||||
called <varname>${WRKSRC_contrib}</varname> and contains | |||||
<literal>${WRKDIR}/foo-contrib-9e4dd76ad9b38f33fdb417a4c01935958d5acd2a-9e4dd76ad9b38f33fdb417a4c01935958d5acd2a</literal>.</para> | |||||
<para>The software's build system expects to find the icons | |||||
in a <filename>ext/icons</filename> subdirectory in its | |||||
sources, so <varname>GL_SUBDIR</varname> is used. | |||||
<varname>GL_SUBDIR</varname> makes sure that | |||||
<filename>ext</filename> exists, but that | |||||
<filename>ext/icons</filename> does not already exist. | |||||
Then it does this:</para> | |||||
<programlisting>post-extract: | |||||
@${MV} ${WRKSRC_icons} ${WRKSRC}/ext/icons</programlisting> | |||||
</example> | |||||
<example xml:id="makefile-master_sites-gitlab-multi2"> | |||||
<title>Use of <varname>USE_GITLAB</varname> with Multiple | |||||
Distribution Files Using | |||||
<varname>GL_TUPLE</varname></title> | |||||
<para>This is functionally equivalent to <xref | |||||
linkend="makefile-master_sites-gitlab-multi"/>, but | |||||
using <varname>GL_TUPLE</varname>:</para> | |||||
<programlisting>PORTNAME= foo | |||||
DISTVERSION= 1.0.2 | |||||
USE_GITLAB= yes | |||||
GL_COMMIT= c189207a55da45305c884fe2b50e086fcad4724b | |||||
GL_TUPLE= https://gitlab.example.com:9434/gitlab:bar:foo-icons:ae7368cab1ca7ca754b38d49da064df87968ffe4:icons/ext/icons \ | |||||
bar:foo-contrib:9e4dd76ad9b38f33fdb417a4c01935958d5acd2a:contrib | |||||
CONFIGURE_ARGS= --with-contrib=${WRKSRC_contrib}</programlisting> | |||||
<para>Grouping was used in the previous example with | |||||
<literal>bar:icons,contrib</literal>. Some redundant | |||||
information is present with <varname>GL_TUPLE</varname> | |||||
because grouping is not possible.</para> | |||||
</example> | |||||
</sect3> | |||||
</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 | ||||
suffix to indicate the compression mechanism, set | suffix to indicate the compression mechanism, set | ||||
<varname>EXTRACT_SUFX</varname>.</para> | <varname>EXTRACT_SUFX</varname>.</para> | ||||
<para>For example, if the distribution file was named | <para>For example, if the distribution file was named | ||||
▲ Show 20 Lines • Show All 4,645 Lines • Show Last 20 Lines |
(and all other occurrences of Gitlab)