diff options
| -rw-r--r-- | recipes-containers/kubernetes/kubernetes_git.bb | 36 |
1 files changed, 12 insertions, 24 deletions
diff --git a/recipes-containers/kubernetes/kubernetes_git.bb b/recipes-containers/kubernetes/kubernetes_git.bb index 5b4c3a91..0aa7c009 100644 --- a/recipes-containers/kubernetes/kubernetes_git.bb +++ b/recipes-containers/kubernetes/kubernetes_git.bb | |||
| @@ -5,8 +5,6 @@ applications across multiple hosts, providing basic mechanisms for deployment, \ | |||
| 5 | maintenance, and scaling of applications. \ | 5 | maintenance, and scaling of applications. \ |
| 6 | " | 6 | " |
| 7 | 7 | ||
| 8 | # Note: 1.11+ requires go 1.10.2+, so the following must be set | ||
| 9 | # in your configuration: GOVERSION = "1.10%" | ||
| 10 | PV = "v1.16.0-alpha+git${SRCREV_kubernetes}" | 8 | PV = "v1.16.0-alpha+git${SRCREV_kubernetes}" |
| 11 | SRCREV_kubernetes = "7054e3ead7e1a00ca6ac3ec47ea355b76061a35a" | 9 | SRCREV_kubernetes = "7054e3ead7e1a00ca6ac3ec47ea355b76061a35a" |
| 12 | 10 | ||
| @@ -31,39 +29,29 @@ inherit goarch | |||
| 31 | COMPATIBLE_HOST = '(x86_64.*|arm.*|aarch64.*)-linux' | 29 | COMPATIBLE_HOST = '(x86_64.*|arm.*|aarch64.*)-linux' |
| 32 | 30 | ||
| 33 | do_compile() { | 31 | do_compile() { |
| 34 | export GOARCH="${TARGET_GOARCH}" | ||
| 35 | export GOOS="${TARGET_GOOS}" | ||
| 36 | export GOROOT="${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/go" | ||
| 37 | export GOPATH="${S}/src/import:${S}/src/import/vendor" | ||
| 38 | |||
| 39 | # Pass the needed cflags/ldflags so that cgo | ||
| 40 | # can find the needed headers files and libraries | ||
| 41 | export CGO_ENABLED="1" | ||
| 42 | export CFLAGS="" | ||
| 43 | export LDFLAGS="" | ||
| 44 | export CGO_CFLAGS="${BUILDSDK_CFLAGS} --sysroot=${STAGING_DIR_TARGET}" | ||
| 45 | export CGO_LDFLAGS="${BUILDSDK_LDFLAGS} --sysroot=${STAGING_DIR_TARGET}" | ||
| 46 | |||
| 47 | # link fixups for compilation | 32 | # link fixups for compilation |
| 48 | rm -f ${S}/src/import/vendor/src | 33 | rm -f ${S}/src/import/vendor/src |
| 49 | ln -sf ./ ${S}/src/import/vendor/src | 34 | ln -sf ./ ${S}/src/import/vendor/src |
| 50 | 35 | ||
| 51 | export GOPATH="${S}/src/import/.gopath:${S}/src/import/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go" | 36 | export GOPATH="${S}/src/import/.gopath:${S}/src/import/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go" |
| 52 | export GOROOT="${STAGING_DIR_NATIVE}/${nonarch_libdir}/${HOST_SYS}/go" | ||
| 53 | |||
| 54 | # Pass the needed cflags/ldflags so that cgo | ||
| 55 | # can find the needed headers files and libraries | ||
| 56 | export CGO_ENABLED="1" | ||
| 57 | export CGO_CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_TARGET}" | ||
| 58 | export CGO_LDFLAGS="${LDFLAGS} --sysroot=${STAGING_DIR_TARGET}" | ||
| 59 | |||
| 60 | cd ${S}/src/import | 37 | cd ${S}/src/import |
| 38 | |||
| 61 | # Build the host tools first, using the host compiler | 39 | # Build the host tools first, using the host compiler |
| 62 | export GOARCH="${BUILD_GOARCH}" | 40 | export GOARCH="${BUILD_GOARCH}" |
| 41 | # Pass the needed cflags/ldflags so that cgo can find the needed headers files and libraries | ||
| 42 | export CGO_ENABLED="1" | ||
| 43 | export CFLAGS="" | ||
| 44 | export LDFLAGS="" | ||
| 45 | export CGO_CFLAGS="${BUILDSDK_CFLAGS} --sysroot=${STAGING_DIR_TARGET}" | ||
| 46 | export CGO_LDFLAGS="${BUILDSDK_LDFLAGS} --sysroot=${STAGING_DIR_TARGET}" | ||
| 63 | make generated_files KUBE_BUILD_PLATFORMS="${HOST_GOOS}/${BUILD_GOARCH}" | 47 | make generated_files KUBE_BUILD_PLATFORMS="${HOST_GOOS}/${BUILD_GOARCH}" |
| 64 | 48 | ||
| 65 | # Reset GOARCH to the target one | 49 | # Build the target binaries |
| 66 | export GOARCH="${TARGET_GOARCH}" | 50 | export GOARCH="${TARGET_GOARCH}" |
| 51 | # Pass the needed cflags/ldflags so that cgo can find the needed headers files and libraries | ||
| 52 | export CGO_ENABLED="1" | ||
| 53 | export CGO_CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_TARGET}" | ||
| 54 | export CGO_LDFLAGS="${LDFLAGS} --sysroot=${STAGING_DIR_TARGET}" | ||
| 67 | # to limit what is built, use 'WHAT', i.e. make WHAT=cmd/kubelet | 55 | # to limit what is built, use 'WHAT', i.e. make WHAT=cmd/kubelet |
| 68 | make cross KUBE_BUILD_PLATFORMS=${GOOS}/${GOARCH} | 56 | make cross KUBE_BUILD_PLATFORMS=${GOOS}/${GOARCH} |
| 69 | } | 57 | } |
