Porting a Go implementation: dealing with dependencies

Steve Wills swills at FreeBSD.org
Fri Nov 18 16:59:47 UTC 2016


Hi,

On 11/18/2016 10:35, Stefan Bethke wrote:
> I’m trying to create a port for Gitea
> (https://github.com/go-gitea/gitea). The basics seem easy enough, but
> I’m not sure how to deal with it’s dependencies.

Use the GH_* macros to fetch them. See:

https://www.freebsd.org/doc/en/books/porters-handbook/makefile-distfiles.html#makefile-master_sites-github-description

Or if the upstream vendors their deps like many do these days you can
use the GH_SUBDIR macro to put them in the proper place.

There are examples to look at if that helps, see sysutils/consul as one
that has vendored deps or sysutils/serf for one that doesn't.

> 
> After downloading tag 0.97, I start building with
> 
> do-build:
> 	(cd ${GO_WRKSRC} ; ${SETENV} ${GO_ENV} go build)
> 
> The result is a long list of unfulfilled dependencies:
> $ sudo make
> ===>  License APACHE20 accepted by the user
> ===>   gitea-0.9.97 depends on file: /usr/local/sbin/pkg - found
> ===> Fetching all distfiles required by gitea-0.9.97 for building
> ===>  Extracting for gitea-0.9.97
> => SHA256 Checksum OK for go-gitea-gitea-v0.9.97_GH0.tar.gz.
> ===>  Patching for gitea-0.9.97
> ===>   gitea-0.9.97 depends on executable: git - found
> ===>   gitea-0.9.97 depends on file: /usr/local/bin/go - found
> ===>   gitea-0.9.97 depends on executable: gmake - found
> ===>  Configuring for gitea-0.9.97
> ===>  Building for gitea-0.9.97
> (cd /var/ports/work/home/vagrant/gitea/work/src/github.com/go-gitea/gitea ; /usr/bin/env GOPATH="/var/ports/work/home/vagrant/gitea/work:/usr/local/share/go"  CGO_CFLAGS="-I/usr/local/include"  CGO_LDFLAGS="-L/usr/local/lib"  GOBIN="" go build)
> cmd/dump.go:16:2: cannot find package "github.com/Unknwon/cae/zip" in any of:
> 	/usr/local/go/src/github.com/Unknwon/cae/zip (from $GOROOT)
> 	/var/ports/work/home/vagrant/gitea/work/src/github.com/Unknwon/cae/zip (from $GOPATH)
> 	/usr/local/share/go/src/github.com/Unknwon/cae/zip
> cmd/serve.go:16:2: cannot find package "github.com/Unknwon/com" in any of:
> 	/usr/local/go/src/github.com/Unknwon/com (from $GOROOT)
> 	/var/ports/work/home/vagrant/gitea/work/src/github.com/Unknwon/com (from $GOPATH)
> 	/usr/local/share/go/src/github.com/Unknwon/com
>> 
> Very few, if any, are available as ports.  I could use go get to download these, but I think that’s not how it’s supposed to work with a port.
> 

Yep, see above. And it's best not to add the deps as separate ports.

Steve

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


More information about the freebsd-ports mailing list