build: Add default purego tag to discosrv build

This commit is contained in:
Jakob Borg 2016-06-02 14:22:40 +02:00
parent 7a56e4a0e5
commit ff0cd413e6

View File

@ -47,6 +47,7 @@ type target struct {
binaryName string binaryName string
archiveFiles []archiveFile archiveFiles []archiveFile
debianFiles []archiveFile debianFiles []archiveFile
tags []string
} }
type archiveFile struct { type archiveFile struct {
@ -109,6 +110,7 @@ var targets = map[string]target{
{src: "cmd/discosrv/LICENSE", dst: "deb/usr/share/doc/discosrv/LICENSE.txt", perm: 0644}, {src: "cmd/discosrv/LICENSE", dst: "deb/usr/share/doc/discosrv/LICENSE.txt", perm: 0644},
{src: "AUTHORS", dst: "deb/usr/share/doc/discosrv/AUTHORS.txt", perm: 0644}, {src: "AUTHORS", dst: "deb/usr/share/doc/discosrv/AUTHORS.txt", perm: 0644},
}, },
tags: []string{"purego"},
}, },
"relaysrv": { "relaysrv": {
name: "relaysrv", name: "relaysrv",
@ -350,6 +352,8 @@ func bench(pkgs ...string) {
func install(target target, tags []string) { func install(target target, tags []string) {
lazyRebuildAssets() lazyRebuildAssets()
tags = append(target.tags, tags...)
cwd, err := os.Getwd() cwd, err := os.Getwd()
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
@ -372,6 +376,8 @@ func install(target target, tags []string) {
func build(target target, tags []string) { func build(target target, tags []string) {
lazyRebuildAssets() lazyRebuildAssets()
tags = append(target.tags, tags...)
rmr(target.binaryName) rmr(target.binaryName)
args := []string{"build", "-i", "-v", "-ldflags", ldflags()} args := []string{"build", "-i", "-v", "-ldflags", ldflags()}
if len(tags) > 0 { if len(tags) > 0 {