osx cross

Fix CI build

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: a408fb0a61
Component: cli
This commit is contained in:
Daniel Nephin
2017-05-12 12:07:57 -04:00
parent fa3049db08
commit 71ca4e1c02
10 changed files with 77 additions and 43 deletions

View File

@ -6,4 +6,6 @@ export BUILDDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
SHELL=/bin/bash parallel ::: \
"$BUILDDIR/linux-cross" \
"$BUILDDIR/windows"
"$BUILDDIR/windows" \
"$BUILDDIR/osx" \
;

View File

@ -0,0 +1,20 @@
#!/usr/bin/env bash
#
# Build an osx binary from linux
#
set -eu -o pipefail
source ./scripts/build/.variables
export CGO_ENABLED=1
export GOOS=darwin
export GOARCH=amd64
export CC=o64-clang
export LDFLAGS='-linkmode external -s'
export LDFLAGS_STATIC_DOCKER='-extld='${CC}
# Override TARGET
export TARGET="build/docker-$GOOS-$GOARCH"
go build -o "${TARGET}" -tags pkcs11 --ldflags "${LDFLAGS}" "${SOURCE}"

View File

@ -13,7 +13,7 @@ export GOOS=windows
export GOARCH=amd64
# Override TARGET
export TARGET="build/docker-windows-amd64"
export TARGET="build/docker-$GOOS-$GOARCH"
# TODO: -tags pkcs11
go build -o "${TARGET}" --ldflags "${LDFLAGS}" "${SOURCE}"