Commit graph

26 commits

Author SHA1 Message Date
bsiegert
f3c2f4934f Mark go-package.mk as deprecated.
Module-based builds are the default way to build software in Go as of Go
1.16. go-package.mk implements the older GOPATH-based build type, which
will go away in one of the next Go releases (probably in early 2022).
2021-05-08 15:55:04 +00:00
joerg
818d6be53f Support UNLIMIT_RESOURCES for go packages. 2020-03-30 19:33:13 +00:00
maya
4947727f41 Forcibly turn off Go module support.
We don't currently build any packages using modules, and the switch to
newer versions of Go has resulted in the default changing to modules
being sometimes enabled.
This now causes random packages to begin fetching from the Internet during
builds, which goes against pkgsrc policy.

Doesn't seem to harm the ability to build a random subset of the Go packages
in pkgsrc.
2020-02-18 18:02:58 +00:00
rillig
6fdd655b2d lang/go: update _VARGROUPS in go-package.mk, small refactoring 2019-09-10 20:19:54 +00:00
jperkin
ce8d9dd117 go: Introduce support for GO_DEPS.
This supports packages that require a large number of go-based dependencies,
treating them as additional distfiles and built inline as part of the package
build.  The print-go-deps target is helpful to generate the list of GO_DEPS
required for each package by parsing the Gopkg.lock file in the extracted
sources.

Thanks to rillig@ for various suggestions and comments.
2019-05-15 18:00:03 +00:00
rillig
858c6cfd69 mk/misc: make configuration for show-all targets more configurable
Up to now, there was a central list of variable name patterns that
defined whether a variable was printed as a sorted list, as a list or as
a single value.

Now each variable group decides on its own which of the variables are
printed in which way, using the usual glob patterns. This is more
flexible since different files sometimes differ in their naming
conventions.

Two variable groups are added: license (for everything related to
LICENSE) and go (for lang/go).
2018-11-30 18:38:19 +00:00
leot
0dcdf0f37d go: Improve PRINT_PLIST_AWK patterns and avoid possible double definition
- Move GO_PLATFORM definition in lang/go/version.mk in order that also lang/go*
  packages can (re)use it
- Change PRINT_PLIST_AWK pattern that replace all ${GO_PLATFORM} and apply it
  only when ${GO_PLATFORM} is a directory (between two "/").  There are only
  3 exceptions to that in lang/go14.
  Move it to version.mk so lang/go* PLIST can be mostly automatically
  generated.

These changes should help to avoid (most) manual editing of
lang/go*/PLIST.

Discussed with and thanks to <bsiegert>!
2018-10-26 13:49:23 +00:00
bsiegert
4d3929e1d2 Correct definition of GOTOOLDIR, remove PREFIX.
GOTOOLDIR was not updated to use the versioned go directories.
2018-10-14 18:15:34 +00:00
bsiegert
7064d10572 Move most of the version selection logic into version.mk.
Provide a new variable, GO_PACKAGE_DEP, with the correct dependency on
the user-selected Go version, to be used for fixing syncthing and friends.
2018-09-22 19:44:21 +00:00
bsiegert
b3aec47289 Use lang/go111, not lang/go, for package builds.
This moves builds of packages using Go off the unversioned lang/go package
and onto Go 1.11 or Go 1.9 (on NetBSD 6) by default.

There is a new, user-settable variable GO_VERSION_DEFAULT.

NOTE: not all Go packages completely implement this yet. For example,
net/syncthing does its own thing. This will be fixed.
2018-09-21 20:35:56 +00:00
minskim
3c98ee4bc1 lang/go: Improve PRINT_PLIST_AWK for Go packages
Go packages create ${PREFIX}/bin and ${PREFIX}/gopkg even when they
don't install anything in them. This change sets PRINT_PLIST_AWK to
ignore such empty directories.
2018-09-15 00:31:11 +00:00
leot
9bb7fe2aa4 lang/go/go-package: Honor MAKE_ENV and set GOCACHE under WRKDIR
Previously GOCACHE was not passed as environment variable and hence
during the build of packages the cache was stored in `${GO} env
GOCACHE' (${XDG_CACHE_HOME} if defined or ${HOME}/.cache).

Pass GOCACHE so that all cached file will ends up under ${WRKDIR}.

While here also pass both GOPATH and GOCACHE via MAKE_ENV.

Thanks to Antonio Huete Jimenez for spotting this problem!

Discussed and ok by <bsiegert>, thanks!
2018-08-29 10:11:57 +00:00
bsiegert
d979c8c930 Move definition of $GO to version.mk.
We have some packages, like mongodb-tools, that cannot include go-package.mk
but need to call the go tool.
2018-07-08 13:53:42 +00:00
bsiegert
0d0cd33b44 Use the non-symlinked go tool for package builds.
Otherwise, you will not be able to build Go code in pkgsrc if you do not
have pkg_alternatives installed.

Introduce a variable (user-settable for now) GOVERSSUFFIX.
$GO is now the Go tool with full path.

leot@ convinced me to go full Python (e.g. one directory per major version,
GO_VERSION_ACCEPTED etc.) but that will be another series of commits.
2018-07-08 12:55:00 +00:00
leot
ba0f38d8c1 go/go-package.mk: Avoid to print (all) entries in print-PLIST unconditionally
Previously all lines (matching or not /${GO_PLATFORM}/) were printed
unconditionally and could interfere with other PRINT_PLIST_AWKs used by always
printing every line in `print-PLIST' phase.

Avoid that by limiting the pattern of PRINT_PLIST_AWK in go-package.mk.
2018-06-05 15:42:20 +00:00
rillig
b49622e6fc lang/go: add examples to the go-package.mk documentation 2018-01-27 15:49:30 +00:00
bsiegert
104ebade01 Do not take the basename of GO_DIST_BASE when it is overridden. Needed for
fixing PR pkg/52081.
2017-03-20 22:33:21 +00:00
bsiegert
29a93ae278 Add more ".if !target" guards around targets defined by go-package.mk,
to allow overriding.
2017-03-15 19:48:40 +00:00
rillig
ebe9605566 Made Go packages testable and cleaned up shell commands
Prevented the error message "*** Error 1 (ignored) ***" during installation
by using || instead of &&.

Shell commands are hidden during normal operation.

Go packages can be tested using "bmake test".

ok @bsiegert
2016-01-23 12:42:57 +00:00
bsiegert
1726914d23 Real buildlink support for Go, hacked with wiz@.
Go packages now define a set of files to buildlink in their buildlink3.mk.
go-packages.mk no longer looks in ${PREFIX}/gopkg during the build. This
should also fix the spurious issues with rebuilds of .a files during bulk
builds of Go packages.
2015-12-29 21:47:48 +00:00
wiz
44ebc0bb83 Document variables this mk file provides.
Ok bsiegert@
2015-12-27 19:41:10 +00:00
bsiegert
c99d17568d Actually define the GO_PLATFORM var before using it. Fixes PLIST generation
for Go packages.
2015-05-11 13:25:35 +00:00
bsiegert
7510a80529 go-package.mk: add an awk fragment for print-PLIST to replace GO_PLATFORM.
After a similar patch by hiramatsu@ for ocaml.mk.
2015-05-03 15:35:54 +00:00
bsiegert
9a7bee3121 Add pax to USE_TOOLS. 2015-03-10 21:52:10 +00:00
bsiegert
90b4a70bfb Add definition for GOTOOLDIR.
This is needed for the go-tools package.
2015-01-13 21:35:13 +00:00
bsiegert
e1bf55736f Add infrastructure for compiling software written in Go to pkgsrc. This
used to be in wip/go.
2015-01-02 14:04:00 +00:00