forked from mirrors/gomod2nix
buildGoApplication: add tags
argument
Simpler method of setting tags rather than using some combination of buildFlags, buildFlagsArray, preBuild, etc
Using `lib.concatStringsSep ","` as space separated tags are deprecated in go.
This is a port of b60dde0c1e
This commit is contained in:
parent
5913cf95d5
commit
f42a0cddb4
1 changed files with 2 additions and 1 deletions
|
@ -180,6 +180,7 @@ let
|
||||||
, allowGoReference ? false
|
, allowGoReference ? false
|
||||||
, meta ? { }
|
, meta ? { }
|
||||||
, passthru ? { }
|
, passthru ? { }
|
||||||
|
, tags ? [ ]
|
||||||
, ...
|
, ...
|
||||||
}@attrs:
|
}@attrs:
|
||||||
let
|
let
|
||||||
|
@ -260,7 +261,7 @@ let
|
||||||
echo "$d" | grep -q "\(/_\|examples\|Godeps\|testdata\)" && return 0
|
echo "$d" | grep -q "\(/_\|examples\|Godeps\|testdata\)" && return 0
|
||||||
[ -n "$excludedPackages" ] && echo "$d" | grep -q "$excludedPackages" && return 0
|
[ -n "$excludedPackages" ] && echo "$d" | grep -q "$excludedPackages" && return 0
|
||||||
local OUT
|
local OUT
|
||||||
if ! OUT="$(go $cmd $buildFlags "''${buildFlagsArray[@]}" ''${ldflags:+-ldflags="$ldflags"} -v -p $NIX_BUILD_CORES $d 2>&1)"; then
|
if ! OUT="$(go $cmd $buildFlags "''${buildFlagsArray[@]}" ''${tags:+-tags=${lib.concatStringsSep "," tags}} ''${ldflags:+-ldflags="$ldflags"} -v -p $NIX_BUILD_CORES $d 2>&1)"; then
|
||||||
if echo "$OUT" | grep -qE 'imports .*?: no Go files in'; then
|
if echo "$OUT" | grep -qE 'imports .*?: no Go files in'; then
|
||||||
echo "$OUT" >&2
|
echo "$OUT" >&2
|
||||||
return 1
|
return 1
|
||||||
|
|
Loading…
Reference in a new issue