[macports-ports] branch master updated: sift: new port, replacement for 'grep' built in go

Mojca Miklavec mojca at macports.org
Mon Nov 13 07:27:33 UTC 2017


On 12 November 2017 at 21:52, Ryan Schmidt wrote:
> On Nov 11, 2017, at 15:15, Emre S╠žafak wrote:
>> Mojca Miklavec (mojca) pushed a commit to branch master
>> in repository macports-ports.
>>
>> +homepage            http://sift-tool.org
>
> Since the http URL redirects to the https URL, you should list the https URL here to avoid redirects.

Thanks, fixed.

>> +set crypto_hash     2faea14
>> +set nbreader_hash   7cef48da76dca6a496faa7fe63e39ed665cbd219
>> +set flags_version   1.3.0
>> +
>> +master_sites        https://github.com/svent/sift/archive:sift \
>> +                    https://github.com/jessevdk/go-flags/archive:flags \
>> +                    https://github.com/svent/go-nbreader/archive:nbreader \
>> +                    https://raw.githubusercontent.com/golang/crypto/${crypto_hash}/ssh/terminal:crypto
>> +
>> +distfiles           v${version}.zip:sift \
>> +                    v${flags_version}.zip:flags \
>> +                    ${nbreader_hash}.zip:nbreader \
>
> You have a sift distfile named "v0.9.0.zip" and a go-flags distfile named "v1.3.0.zip". If we mirror these distfiles, what happens in a year, or however long it takes sift to reach version 1.3.0?

We could probably change dist_subdir. Ideally I would like to rename
the distfiles (and also get rid of fetching the dependencies for
building a single package as this is not really sustainable in the
long run).

>> +                    terminal.go:crypto \
>> +                    util_bsd.go:crypto \
>> +                    util.go:crypto
>
> Unversioned distfiles are bad. Is there no versioned tarball of this you could have the port download instead?

https://github.com/golang/crypto

Given that they apparently made no release, the best we could do is
use git hashes. Ideally we would install this as a package. Less
ideally we could fetch the full zip / complete package instead of
individual files.

A few things that could be of help here:
- if github portgroup would support fetching from more than one repository
- if we could store tarballs for different files to multiple distfile
directories
- rename the distfile on the fly (for example easily change v0.9.0.zip
into sift-0.9.9)

Now, I'm totally aware that this packaging is less than ideal, but the
PR has been open since February, nearly a year. If the binary is
considered useful, we should at least try to use workarounds if good
core support (in this case for "go") is not there yet.

I had some time to go through PRs and since this worked, I merged it
despite many less-than-optimal solutions.

> https://trac.macports.org/wiki/PortfileRecipes#unversioned-distfiles
>
> Better yet, is there no single tarball you could download that would contain everything? If not, please suggest to the developers that they offer one.

I strongly suspect that the need to download all these bits and pieces
is just a consequence of our lack of support for go. Theoretically we
should only need to download sift and the rest should be merely build
dependencies. But we probably need some knowledgeable user of "go" to
help us figure out how to properly do our setup.

I would suggest to open a new ticket for these kind of issues.

Some discussion could also happen at the initial PR
(https://github.com/macports/macports-ports/pull/328), the only
problem is that it's hidden now by default, so more difficult to spot.

>> +universal_variant   no
>> +use_configure       no
>
> By the way, "univeral_variant no" is set automatically when you set "use_configure no".

OK, I removed it.

>> +build.cmd           go
>
> You should use the absolute path to the binary, ${prefix}/bin/go.

Fixed, thanks for spotting.

Mojca


More information about the macports-dev mailing list