USE_GITHUB and submodules

Bryan Drewery bdrewery at FreeBSD.org
Tue May 19 19:10:40 UTC 2015


On 5/19/2015 1:44 PM, Jonathan Anderson wrote:
> Hi all,
> 
> Is there a mechanism for using the USE_GITHUB variable in a port that
> depends on submodules? For instance, the Rust port requires an embedded
> (and modified) version of LLVM, which it includes as a submodule. Right
> now I'm attempting to add the following to a `post-extract` rule:
> 
> post-extract:
>     cd ${WRKSRC} && \
>     git init && \
>     git remote add origin https://github.com/${GH_ACCOUNT}/${PORTNAME} && \
>     git fetch && \
>     git reset --hard ${PORTVERSION} && \
>     git submodule init && \
>     git submodule update --recursive
> 
> But this seems quite hackish! It would be great if submodules Just
> Worked... but alternatively, is there a USE_GITHUB_URL or somesuch that
> would check things out via Git instead of tarball to save me the `git
> init` through `git reset` steps?

There's not currently. However consider that using git for the fetch is
a potential security risk. You must ensure that a hash is checked out
and not a branch name. A branch would change hash on the next update and
the port would then be building an unknown version. It would really just
be best to avoid using git as an actual fetch mechanism. USE_GITHUB does
not.

You could just add a rust-llvm port that uses the modified llvm and have
rust depend on it for a build dependency.

Another alternative that others have employed is to just check all of
this out on freefall and make your own tarball. Then put that in your
~/public_distfiles and serve it in the port as MASTER_SITES= LOCAL/jonathan.

Or ask the upstream to do an actual release of their own with a real
tarball rather than asking people to use git.

-- 
Regards,
Bryan Drewery

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20150519/91ceacdc/attachment.sig>


More information about the freebsd-ports mailing list