Skip to content

Commit 2860ca4

Browse files
authored
Merge pull request docker#283 from crazy-max/fix-osx-min-version
osxkeychain: match min macos version for xx
2 parents bdd92dd + 5944f8a commit 2860ca4

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ RUN --mount=type=bind,target=. \
120120
--mount=type=bind,source=/tmp/.version,target=/tmp/.version,from=version \
121121
--mount=type=bind,source=/tmp/.revision,target=/tmp/.revision,from=version <<EOT
122122
set -ex
123+
export MACOSX_VERSION_MIN=$(make print-MACOSX_DEPLOYMENT_TARGET)
123124
xx-go --wrap
124125
go install std
125126
make build-osxkeychain build-pass PACKAGE=$PACKAGE VERSION=$(cat /tmp/.version) REVISION=$(cat /tmp/.revision) DESTDIR=/out

Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ BUILDX_CMD ?= docker buildx
99
DESTDIR ?= ./bin/build
1010
COVERAGEDIR ?= ./bin/coverage
1111

12+
# 10.11 is the minimum supported version for osxkeychain
13+
export MACOSX_DEPLOYMENT_TARGET = 10.11
14+
ifeq "$(shell go env GOOS)" "darwin"
15+
export CGO_CFLAGS = -mmacosx-version-min=$(MACOSX_DEPLOYMENT_TARGET)
16+
endif
17+
1218
.PHONY: all
1319
all: cross
1420

@@ -75,3 +81,6 @@ vendor:
7581
rm -rf ./vendor
7682
cp -R "$($@_TMP_OUT)"/* .
7783
rm -rf "$($@_TMP_OUT)"
84+
85+
.PHONY: print-%
86+
print-%: ; @echo $($*)

osxkeychain/osxkeychain_darwin.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package osxkeychain
22

33
/*
4-
#cgo CFLAGS: -x objective-c -mmacosx-version-min=10.11
5-
#cgo LDFLAGS: -framework Security -framework Foundation -mmacosx-version-min=10.11
4+
#cgo CFLAGS: -x objective-c
5+
#cgo LDFLAGS: -framework Security -framework Foundation
66
77
#include "osxkeychain_darwin.h"
88
#include <stdlib.h>

0 commit comments

Comments
 (0)