Help with a Portfile
Mojca Miklavec
mojca at macports.org
Sun Jan 13 11:27:33 UTC 2019
Dear Eric,
On Sun, 13 Jan 2019 at 11:04, iEFdev wrote:
>
> I'd like to get some help with a Portfile, and have a couple of questions.
>
> 1: When using git.setup, with a commit as the 3'rd var, like: github.setup Foo Bar a1b2c3d4
>
> I didn't get it to work (download), but I could use it with: fetch.type git
>
> How does that work with checksum (when cloning repo)? The function looks disabled though. I installs fine with (or without) any number. Not sure it's the right way to go - it doesn't feel right.
When you use github.setup, a tarball is fetched directly from the
GitHub server, without resorting to git in any way, and works as if
you fetched the sources from elsewhere.
When you use git directly, the checksums are (sadly) not yet verified.
If you fetch from a particular commit in git, the shasum should
usually give you sufficient reliability (to some extent), while if you
use master (or any other branch for that matter), you would not get
reliable contents anyway, and it's highly discouraged to fetch from a
branch as you never know what could break and when.
This is admittedly suboptimal. Rainer did some 80% of the work, see
https://trac.macports.org/ticket/16373
or the corresponding branch (vcs-fetch) in macports-base, but he might
need a push to complete the work, test and merge the code :) :) :)
> 2: I tried to use: patch.dir ${worksrcpath}/path/to, but then it tried to download the file specified in: patchfiles.
>
> Is it possible to use an existing dir in the downloaded source folder? …or does the patches have to go into the Files dir, for example?
I recently stumbled into a wall myself when trying to do something
less conventional with patch files [1]. I ended up running patch
manually which is heavily suboptimal and it could help to modify the
base a bit to better support a scenario of having an extracted patch
file somewhere or the disk that's not exactly files/, but I don't know
what exactly you scenario is. MacPorts would happily support applying
a patch from a .bz2 file located somewhere online, for example. Where
did you get the patch file from / how?
Mojca
[1] https://github.com/macports/macports-ports/pull/3336
More information about the macports-dev
mailing list