Page MenuHomeFreeBSD

D55580.id172905.diff
No OneTemporary

D55580.id172905.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`.
====
+[[go-ex3]]
+.Overriding go.mod in Modules Mode
+[example]
+====
+Modules-aware mode (that is, `USES=go:modules`) determines which packages to download by inspecting `go.mod` immediately after fetching it.
+Patching occurs after sources have been fetched and extracted, so a regular patch in `files/` would apply to `go.mod` (and/or `go.sum`) too late.
+
+While patching the upstream `go.mod` to alter dependencies is impossible, you can still *override* it by adding another `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 `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
Sun, Mar 1, 1:26 AM (12 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29088520
Default Alt Text
D55580.id172905.diff (1 KB)

Event Timeline