

Supporting Go Modules in pkgsrc (Part 2) · benzblog
source link: https://bentsukun.ch/posts/go-mod-support-2/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

30 Apr 2019, 20:19
This announcement dropped today:
I realized that this is the missing piece for supporting Go modules in pkgsrc.
If you go back and reread the “fetch” section in Supporting Go Modules in
pkgsrc, it seems a bit awkward compared to a standard fetch action. The
reason is that go mod download
re-packs the source into its own zip format
archive.
The module proxy (https://proxy.golang.org/) solves this problem and enables a
simple solution for modules, very similar to lang/rust/cargo.mk. Basically,
a target similar to show-cargo-depends
that outputs a Makefile fragment
containing the names of modules that the current package depends upon. All
these become distfiles fetched from a hypothetical $MASTER_SITES_GOPROXY
.
Crucially, this means that the distfiles do not have to be stored in a
LOCAL_PORTS
subdirectory but can use the normal fetch infrastructure.
Now all that remains is implementing this :) There is some more time to do
that: Go 1.13 (to be released some time in summer) will use module support by
default. What’s more, a bunch of new software (including the various
golang.org/x/*
repositories) has go.mod
files these days, using
module-based builds by default.
Recommend
-
9
./security/tor-browser, Tor Browser based on Firefox[ ] [ ] [ ] [ Required by ] [
-
8
29 Dec 2018, 13:12 Go 1.11 introduced a new way of building Go code that no longer needs a GOPATH at all. In due cou...
-
7
04 Jul 2020, 14:53 Like many ARM CPUs, the one in the Pinebook Pro has a “big.LITTLE” architecture, where some cores are more pow...
-
10
20 Jun 2020, 18:09 If you buy a Pinebook Pro now, it comes with Manjaro Linux on the internal eMMC storage. Let’s install NetBSD...
-
10
31 May 2020, 16:04 Note: This post was written on the Pinebook Pro :) After seeing it in action at FOSDEM (from a...
-
11
03 Feb 2020, 11:30 I am part of the pkgsrc releng (release engineering) team. My main task there is handling pull-ups into the st...
-
13
15 Jul 2019, 20:44 This is a transcript of the talk I gave at pkgsrcCon 2019 in...
-
11
In a few weeks, on the weekend of July 13 and 14, the annual pkgsrc conference, pkgsrcCon 2019, will take place in Cambridge, UK. Whether you are a user or deve...
-
15
07 Nov 2021, 11:27 The BSD build system in general, and pkgsrc in particular, have a large number of Makefiles ending in .mk. Recently, I was looking at a commit messa...
-
4
This weekend, I made a series of somewhat unusual changes to pkgsrc. I removed a bunch of Go packages. Why? Because of Go modules. What are Go modules? Since my series of design-ish blog posts(
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK