Remove osx cross compilation in favor of homebrew

This commit is contained in:
Adrian Macneil 2015-12-03 01:13:39 -08:00
parent ff85c92b98
commit b74629e5be
3 changed files with 9 additions and 41 deletions

View file

@ -8,23 +8,6 @@ RUN dpkg --add-architecture i386 && \
apt-get install -y libc6-dev-i386 && \
rm -rf /var/lib/apt/lists/*
# osx cross compilation
# ref: https://github.com/karalabe/xgo/blob/master/docker/base/Dockerfile
ENV OSX_SDK_FILE MacOSX10.9.sdk.tar.xz
ENV OSX_SDK_SHA256 ac7ccfd8dee95d9811ce50cdc154c8ec7181c51652b5a434445475af62c4fedb
RUN cd /opt && \
git clone https://github.com/tpoechtrager/osxcross.git && \
cd osxcross && \
sed -i -e 's|-march=native||g' ./build_clang.sh ./wrapper/build.sh && \
apt-get update && \
./tools/get_dependencies.sh && \
rm -rf /var/lib/apt/lists/* && \
curl -fSL -o ./tarballs/$OSX_SDK_FILE \
https://s3.amazonaws.com/andrew-osx-sdks/$OSX_SDK_FILE && \
echo "$OSX_SDK_SHA256 ./tarballs/$OSX_SDK_FILE" | sha256sum -c - && \
UNATTENDED=1 OSX_VERSION_MIN=10.6 ./build.sh
ENV PATH /opt/osxcross/target/bin:$PATH
# development dependencies
RUN go get \
github.com/golang/lint/golint \

View file

@ -1,4 +1,4 @@
DOCKER := docker-compose run dbmate
DC := docker-compose
all: clean container lint test build
@ -6,15 +6,16 @@ clean:
rm -rf dist
container:
docker-compose build
$(DC) build
lint:
$(DOCKER) golint
$(DOCKER) go vet
$(DOCKER) errcheck
$(DC) run dbmate golint
$(DC) run dbmate go vet
$(DC) run dbmate errcheck
test:
$(DOCKER) go test -v
$(DC) run dbmate go test -v
build:
docker-compose run dbmate ./build.sh
build: clean
$(DC) run -e GOARCH=386 dbmate go build -o dist/dbmate-linux-i386
$(DC) run -e GOARCH=amd64 dbmate go build -o dist/dbmate-linux-amd64

View file

@ -1,16 +0,0 @@
#!/bin/sh
# this script is intended to run inside the docker container
# e.g. docker-compose run dbmate ./build.sh
set -ex
BUILD_FLAGS="-ldflags -s"
GOOS=linux GOARCH=386 go build $BUILD_FLAGS \
-o dist/dbmate-linux-i386
GOOS=linux GOARCH=amd64 go build $BUILD_FLAGS \
-o dist/dbmate-linux-amd64
GOOS=darwin GOARCH=386 CC=o32-clang CXX=o32-clang++ go build $BUILD_FLAGS \
-o dist/dbmate-osx-i386
GOOS=darwin GOARCH=amd64 CC=o64-clang CXX=o64-clang++ go build $BUILD_FLAGS \
-o dist/dbmate-osx-amd64