Page MenuHomeFreeBSD

D55580.diff
No OneTemporary

D55580.diff

diff --git a/documentation/content/en/books/porters-handbook/special/_index.adoc b/documentation/content/en/books/porters-handbook/special/_index.adoc
--- a/documentation/content/en/books/porters-handbook/special/_index.adoc
+++ b/documentation/content/en/books/porters-handbook/special/_index.adoc
@@ -990,6 +990,34 @@
will install `dnscrypt-proxy` to `${PREFIX}/sbin`.
====
+[[overriding-go-mod]]
+.Overriding go.mod in Modules Mode
+[example]
+====
+During the fetch phase, modules-aware mode (that is, `USES=go:modules`) obtains sources for dependent packages by fetching the port's [.filename]#go.mod# and then immediately running `go mod download` against it.
+Because the fetch phase occurs long before patching, regular patches in [.filename]#files/# are applied far too late to affect those dependency resolution and fetch steps.
+
+While patching the upstream [.filename]#go.mod# to alter dependencies isn't possible at this time, you can still *override* it by listing another [.filename]#go.mod# as a second distfile.
+
+[.programlisting]
+....
+PORTNAME= miller
+DISTVERSIONPREFIX= v
+DISTVERSION= 6.17.0
+CATEGORIES= textproc
+MASTER_SITES= https://raw.githubusercontent.com/johnkerl/${PORTNAME}/${DISTVERSIONFULL}/:gomod
+
+DISTFILES= go.mod:gomod
+....
+
+To override [.filename]#go.sum# as well, just add it to `DISTFILES`:
+
+[.programlisting]
+....
+DISTFILES= go.mod:gomod go.sum:gomod
+....
+====
+
[[using-cabal]]
=== Building Haskell Applications with `cabal`

File Metadata

Mime Type
text/plain
Expires
Mon, Mar 30, 12:55 PM (19 h, 14 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29125996
Default Alt Text
D55580.diff (1 KB)

Event Timeline