How to handle go dependencies

Eugene Grosbein eugen at grosbein.net
Sat Jun 22 14:12:47 UTC 2019


22.06.2019 16:58, Matthias Fechner wrote:

> Dear all,
> 
> I just prepare the gitlab-ce upgrade to version 12.0.0.
> But I have some problem with a package that uses go to compile.
> 
> The new version of devel/gitaly has changed the way the package is defined.
> They removed now all files from the vendor/ folder and add dependencies
> in a `go.mod` file.
> 
> If I now build the port it tries to fetch the files while no network
> access is allowed.
> 
> What is the correct way to getting these dependencies fetched and
> correctly included into the work-source in the fetch step using go?

That's not easy question. You may find it useful to check out
existing port sysutils/fusefs-webdavfs that successfully deals
with several dependencies located at Github (pborman/getopt and bazil/fuse).

Tricky part is in the post-patch: target of port's Makefile
that creates ${GETOPT_WRKSRCDIR} and ${FUSE_WRKSRCDIR} directories
and symlinks real paths for extracted dependencies into needed names
under ${GETOPT_WRKSRCDIR} and ${FUSE_WRKSRCDIR}.

Another dependency "golang.org/x/net/context" was integrated into golang itself
as "context" since go-1.7 so the port uses REINPLACE_CMD to patch the name in source files.



More information about the freebsd-ports mailing list