New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add GitHub portgroup #12
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,198 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V5.0//EN" | ||
"http://docbook.org/xml/5.0/dtd/docbook.dtd"> | ||
<section xml:id="reference.portgroup.github"> | ||
|
||
<title>PortGroup github</title> | ||
|
||
<para>The <code>github</code> portgroup allows for efficient porting of | ||
software hosted on GitHub.</para> | ||
|
||
<section xml:id="reference.portgroup.github.description"> | ||
<title>Description</title> | ||
|
||
<para> | ||
This portgroup greatly simplifies the porting of software hosted on | ||
GitHub. Provided a GitHub repository author follows common GitHub | ||
practices, a port can be almost fully configured simply by declaring the | ||
repository coordinates. The <code>github</code> portgroup is indeed | ||
capable of configuring, amongst other things: | ||
|
||
<itemizedlist> | ||
<listitem> | ||
<para>The port <code>name</code>.</para> | ||
</listitem> | ||
<listitem> | ||
<para>The port <code>version</code>.</para> | ||
</listitem> | ||
<listitem> | ||
<para>The <code>distfiles</code> (if the project uses GitHub | ||
releases).</para> | ||
</listitem> | ||
<listitem> | ||
<para>The <code>livecheck</code> parameters.</para> | ||
</listitem> | ||
</itemizedlist> | ||
</para> | ||
</section> | ||
|
||
<section xml:id="reference.portgroup.github.setup"> | ||
<title>Setting up the GitHub repository coordinates</title> | ||
|
||
<para> | ||
The main port configuration is triggered by the usage of the | ||
<code>github.setup</code> keyword: | ||
|
||
<programlisting> | ||
PortGroup github 1.0 | ||
github.setup author project version [tag_prefix]</programlisting> | ||
</para> | ||
|
||
<para> | ||
By default, the port <code>name</code> will be set to the GitHub project | ||
name (<code>project</code>) and <code>version</code> will be set to the | ||
GitHub project <code>version</code>. The port name can be overridden by | ||
using the <code>name</code> keyword. | ||
</para> | ||
|
||
<para> | ||
The <code>tag_prefix</code> is optional, and it's used to specify a prefix | ||
to use when constructing the tag name. If, for example, the project uses | ||
tags such as <code>v1.0.0</code>, then the <code>tag_prefix</code> should | ||
be set to <code>v</code>, as in the following example: | ||
|
||
<programlisting> | ||
github.setup author project version v</programlisting> | ||
</para> | ||
</section> | ||
|
||
<section xml:id="reference.portgroup.github.distfilestrategy"> | ||
<title>Choosing a distfile strategy</title> | ||
|
||
<para> | ||
GitHub, and as a consequence the <code>github</code> portgroup, offers | ||
multiple mechanisms to get a distfile: | ||
|
||
<itemizedlist> | ||
<listitem> | ||
<para>Distfile from a <code>git</code> commit or tag.</para> | ||
</listitem> | ||
<listitem> | ||
<para> | ||
Distfile from a GitHub <link | ||
xlink:href="https://github.com/blog/1547-release-your-software">release</link>. | ||
</para> | ||
</listitem> | ||
<listitem> | ||
<para> | ||
Distfile from a GitHub <link | ||
xlink:href="https://github.com/blog/1302-goodbye-uploads">download</link>. | ||
</para> | ||
</listitem> | ||
</itemizedlist> | ||
</para> | ||
|
||
<para> | ||
The default behaviour of the portgroup is using GitHub automatically | ||
generated distfile from a <code>git</code> commit or tag. However, the | ||
best practice should be using a GitHub release. | ||
</para> | ||
</section> | ||
|
||
<section xml:id="reference.portgroup.github.distfile"> | ||
<title>Distfile from tag or commit</title> | ||
|
||
<para> | ||
The default behaviour of the <code>github</code> portgroup is leveraging | ||
GitHub's ability to create a distfile from a <code>git</code> tag or | ||
commit. In this case, the <code>distname</code> is irrelevant and should | ||
not be set. | ||
</para> | ||
|
||
<para> | ||
If the project's developers do not tag their releases, they should be | ||
encouraged to do so. Until they do, or in the case in which an untagged | ||
development version has to be used, port maintainers have the possibility | ||
of specifying a <code>git</code> commit hash and manually set the | ||
<code>version</code> field. If the project does not assign version | ||
numbers the port maintainer has to define one. Such versions typically | ||
format the date of the chosen commit using the <code>YYYYMMDD</code> | ||
pattern. If, for example, the port maintainer decides to use a changeset | ||
with the hash <code>0ff25277c3842598d919cd3c73d60768</code>, committed on | ||
April 1, 2014, then the following would be used: | ||
|
||
<programlisting> | ||
github.setup someone someproject 0ff25277c3842598d919cd3c73d60768 | ||
version 20140401</programlisting> | ||
</para> | ||
</section> | ||
|
||
<section xml:id="reference.portgroup.github.releases"> | ||
<title>Distfile from a GitHub release</title> | ||
|
||
<para> | ||
The <code>github</code> portgroup allows maintainers to easily configure | ||
the distfiles when the project uses GitHub releases. A release is the | ||
best distfile candidate, and project maintainers should be encouraged to | ||
use them. To enable this feature, the following keyword must be used: | ||
|
||
<programlisting> | ||
github.tarball_from releases</programlisting> | ||
|
||
By default, the <code>github</code> portgroup sets <code>distname</code> | ||
to: | ||
|
||
<programlisting> | ||
distname ${github.project}-${github.version}</programlisting> | ||
|
||
However, GitHub does not enforce any rule for release distfiles, so port | ||
maintainers may need to override the <code>distname</code> as they would | ||
do for other ports. | ||
</para> | ||
</section> | ||
|
||
<section xml:id="reference.portgroup.github.downloads"> | ||
<title>Distfile from a GitHub download</title> | ||
|
||
<para> | ||
Older projects use the discontinued <link | ||
xlink:href="https://github.com/blog/1302-goodbye-uploads">downloads</link> | ||
service. New GitHub downloads can no longer be created, but old ones are | ||
still available. | ||
</para> | ||
|
||
<para> | ||
If the project doesn't have GitHub releases but does have GitHub | ||
downloads, they can be used using the following keyword: | ||
|
||
<programlisting> | ||
github.tarball_from downloads</programlisting> | ||
|
||
Since GitHub doesn't enforce any naming rules for downloads, the portgroup | ||
can only provide a sensible default value for <code>distname</code>, which | ||
can be overridden if necessary. | ||
</para> | ||
</section> | ||
|
||
<section xml:id="reference.portgroup.github.submodule"> | ||
<title>Using repositories with git submodules</title> | ||
|
||
<para> | ||
If the project uses <code>git</code> submodules, some projects' tag- or | ||
commit-based distfiles will not contain all the necessary files. Once | ||
again, the best distfile candidate (if available) is a distfile from | ||
GitHub releases, as described in the previous sections. However, in the | ||
case a project doesn't provide any other alternative, a project using | ||
submodules can be successfully retrieved by fetching the sources using | ||
<code>git</code> and then using a <code>post-fetch</code> to initialize | ||
the submodules: | ||
|
||
<programlisting> | ||
fetch.type git | ||
|
||
post-fetch { | ||
system -W ${worksrcpath} "git submodule update --init" | ||
}</programlisting> | ||
</para> | ||
</section> | ||
</section> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI, that wasn't a typo, but it was an old value and you're right to change it as you did.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.