make.go: don't build pk-mount on darwin, set osusergo, use modern comma-separated tags

Signed-off-by: Brad Fitzpatrick <brad@danga.com>
This commit is contained in:
Brad Fitzpatrick 2023-12-30 20:01:55 -08:00
parent 09cf7e948b
commit 20622c8a06
1 changed files with 5 additions and 5 deletions

10
make.go
View File

@ -116,15 +116,15 @@ func main() {
case "": case "":
// Add pk-mount to default build targets on OSes that support FUSE. // Add pk-mount to default build targets on OSes that support FUSE.
switch *buildOS { switch *buildOS {
case "linux", "darwin": case "linux":
targs = append(targs, "perkeep.org/cmd/pk-mount") targs = append(targs, "perkeep.org/cmd/pk-mount")
} }
default: default:
if *website { if *website {
log.Fatal("-targets and -website are mutually exclusive") log.Fatal("--targets and --website are mutually exclusive")
} }
if *camnetdns { if *camnetdns {
log.Fatal("-targets and -camnetdns are mutually exclusive") log.Fatal("--targets and --camnetdns are mutually exclusive")
} }
if t := strings.Split(*targets, ","); len(t) != 0 { if t := strings.Split(*targets, ","); len(t) != 0 {
targs = t targs = t
@ -153,7 +153,7 @@ func main() {
tags := []string{"purego"} // for cznic/zappy tags := []string{"purego"} // for cznic/zappy
if *static { if *static {
tags = append(tags, "netgo") tags = append(tags, "netgo", "osusergo")
} }
if *embedResources { if *embedResources {
tags = append(tags, "with_embed") tags = append(tags, "with_embed")
@ -179,7 +179,7 @@ func main() {
if ldFlags != "" { if ldFlags != "" {
baseArgs = append(baseArgs, "--ldflags="+ldFlags) baseArgs = append(baseArgs, "--ldflags="+ldFlags)
} }
baseArgs = append(baseArgs, "--tags="+strings.Join(tags, " ")) baseArgs = append(baseArgs, "--tags="+strings.Join(tags, ","))
// First install command: build just the final binaries, installed to a GOBIN // First install command: build just the final binaries, installed to a GOBIN
// under <perkeep_root>/bin: // under <perkeep_root>/bin: