diff options
Diffstat (limited to 'recipes-containers/containerd/containerd.inc')
| -rw-r--r-- | recipes-containers/containerd/containerd.inc | 64 |
1 files changed, 36 insertions, 28 deletions
diff --git a/recipes-containers/containerd/containerd.inc b/recipes-containers/containerd/containerd.inc index e7a37192..9f66e46e 100644 --- a/recipes-containers/containerd/containerd.inc +++ b/recipes-containers/containerd/containerd.inc | |||
| @@ -6,7 +6,7 @@ DESCRIPTION = "containerd is a daemon to control runC, built for performance and | |||
| 6 | 6 | ||
| 7 | # Apache-2.0 for containerd | 7 | # Apache-2.0 for containerd |
| 8 | LICENSE = "Apache-2.0" | 8 | LICENSE = "Apache-2.0" |
| 9 | LIC_FILES_CHKSUM = "file://LICENSE.code;md5=aadc30f9c14d876ded7bedc0afd2d3d7" | 9 | LIC_FILES_CHKSUM = "file://src/import/LICENSE.code;md5=aadc30f9c14d876ded7bedc0afd2d3d7" |
| 10 | 10 | ||
| 11 | SRC_URI += "file://containerd.service" | 11 | SRC_URI += "file://containerd.service" |
| 12 | 12 | ||
| @@ -17,6 +17,8 @@ PV = "${CONTAINERD_VERSION}+git${SRCREV}" | |||
| 17 | inherit go | 17 | inherit go |
| 18 | inherit goarch | 18 | inherit goarch |
| 19 | 19 | ||
| 20 | GO_IMPORT = "import" | ||
| 21 | |||
| 20 | RRECOMMENDS_${PN} = "lxc docker" | 22 | RRECOMMENDS_${PN} = "lxc docker" |
| 21 | CONTAINERD_PKG="github.com/containerd/containerd" | 23 | CONTAINERD_PKG="github.com/containerd/containerd" |
| 22 | 24 | ||
| @@ -25,30 +27,35 @@ INSANE_SKIP_${PN} += "ldflags" | |||
| 25 | do_configure[noexec] = "1" | 27 | do_configure[noexec] = "1" |
| 26 | 28 | ||
| 27 | do_compile() { | 29 | do_compile() { |
| 28 | # Set GOPATH. See 'PACKAGERS.md'. Don't rely on | 30 | export GOARCH="${TARGET_GOARCH}" |
| 29 | # docker to download its dependencies but rather | 31 | |
| 30 | # use dependencies packaged independently. | 32 | # link fixups for compilation |
| 31 | cd ${S} | 33 | rm -f ${S}/src/import/vendor/src |
| 32 | rm -rf .gopath | 34 | ln -sf ./ ${S}/src/import/vendor/src |
| 33 | mkdir -p .gopath/src/"$(dirname "${CONTAINERD_PKG}")" | 35 | |
| 34 | ln -sf ../../../.. .gopath/src/"${CONTAINERD_PKG}" | 36 | mkdir -p ${S}/src/import/vendor/src/github.com/containerd/containerd/ |
| 35 | 37 | # without this, the stress test parts of the build fail | |
| 36 | export GOPATH="${WORKDIR}/git/" | 38 | cp ${S}/src/import/*.go ${S}/src/import/vendor/src/github.com/containerd/containerd |
| 37 | export GOROOT="${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/go" | 39 | |
| 38 | 40 | for c in content errdefs fs images mount snapshots linux api runtimes defaults progress \ | |
| 39 | # Pass the needed cflags/ldflags so that cgo | 41 | protobuf reference diff platforms runtime remotes version archive dialer gc metadata \ |
| 40 | # can find the needed headers files and libraries | 42 | metrics filters identifiers labels leases plugin server services \ |
| 41 | export GOARCH="${TARGET_GOARCH}" | 43 | cmd cio containers namespaces oci events log reaper sys rootfs; do |
| 42 | export CGO_ENABLED="1" | 44 | ln -sfn ${S}/src/import/${c} ${S}/src/import/vendor/github.com/containerd/containerd/${c} |
| 43 | export CFLAGS="" | 45 | done |
| 44 | export LDFLAGS="" | 46 | |
| 45 | export CGO_CFLAGS="${BUILDSDK_CFLAGS} --sysroot=${STAGING_DIR_TARGET}" | 47 | export GOPATH="${S}/src/import/.gopath:${S}/src/import/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go" |
| 46 | export CGO_LDFLAGS="${BUILDSDK_LDFLAGS} --sysroot=${STAGING_DIR_TARGET}" | 48 | export GOROOT="${STAGING_DIR_NATIVE}/${nonarch_libdir}/${HOST_SYS}/go" |
| 47 | export GO_GCFLAGS="" | 49 | |
| 48 | export CC_FOR_TARGET="${TARGET_PREFIX}gcc ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}" | 50 | # Pass the needed cflags/ldflags so that cgo |
| 49 | export CXX_FOR_TARGET="${TARGET_PREFIX}g++ ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}" | 51 | # can find the needed headers files and libraries |
| 50 | 52 | export CGO_ENABLED="1" | |
| 51 | oe_runmake static | 53 | export CGO_CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_TARGET}" |
| 54 | export CGO_LDFLAGS="${LDFLAGS} --sysroot=${STAGING_DIR_TARGET}" | ||
| 55 | export BUILDTAGS="no_btrfs static_build netgo" | ||
| 56 | |||
| 57 | cd ${S}/src/import | ||
| 58 | oe_runmake binaries | ||
| 52 | } | 59 | } |
| 53 | 60 | ||
| 54 | # Note: disabled for now, since docker is launching containerd | 61 | # Note: disabled for now, since docker is launching containerd |
| @@ -59,9 +66,9 @@ do_compile() { | |||
| 59 | do_install() { | 66 | do_install() { |
| 60 | mkdir -p ${D}/${bindir} | 67 | mkdir -p ${D}/${bindir} |
| 61 | 68 | ||
| 62 | cp ${S}/bin/containerd ${D}/${bindir}/containerd | 69 | cp ${S}/src/import/bin/containerd ${D}/${bindir}/containerd |
| 63 | cp ${S}/bin/containerd-shim ${D}/${bindir}/containerd-shim | 70 | cp ${S}/src/import/bin/containerd-shim ${D}/${bindir}/containerd-shim |
| 64 | cp ${S}/bin/ctr ${D}/${bindir}/containerd-ctr | 71 | cp ${S}/src/import/bin/ctr ${D}/${bindir}/containerd-ctr |
| 65 | 72 | ||
| 66 | ln -sf containerd ${D}/${bindir}/docker-containerd | 73 | ln -sf containerd ${D}/${bindir}/docker-containerd |
| 67 | ln -sf containerd-shim ${D}/${bindir}/docker-containerd-shim | 74 | ln -sf containerd-shim ${D}/${bindir}/docker-containerd-shim |
| @@ -78,3 +85,4 @@ do_install() { | |||
| 78 | FILES_${PN} += "${systemd_system_unitdir}/*" | 85 | FILES_${PN} += "${systemd_system_unitdir}/*" |
| 79 | 86 | ||
| 80 | INHIBIT_PACKAGE_STRIP = "1" | 87 | INHIBIT_PACKAGE_STRIP = "1" |
| 88 | INSANE_SKIP_${PN} += "ldflags already-stripped" | ||
