diff options
Diffstat (limited to 'recipes-containers/runc')
-rw-r--r-- | recipes-containers/runc/runc_git.bb | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/recipes-containers/runc/runc_git.bb b/recipes-containers/runc/runc_git.bb new file mode 100644 index 00000000..30a46403 --- /dev/null +++ b/recipes-containers/runc/runc_git.bb | |||
@@ -0,0 +1,71 @@ | |||
1 | HOMEPAGE = "https://github.com/opencontainers/runc" | ||
2 | SUMMARY = "runc container cli tools" | ||
3 | DESCRIPTION = "runc is a CLI tool for spawning and running containers according to the OCI specification." | ||
4 | |||
5 | # Note: this rev is before the required protocol field, update when all components | ||
6 | # have been updated to match. | ||
7 | SRCREV = "baf6536d6259209c3edfa2b22237af82942d3dfa" | ||
8 | SRC_URI = "\ | ||
9 | git://github.com/opencontainers/runc;branch=master \ | ||
10 | " | ||
11 | |||
12 | # Apache-2.0 for containerd | ||
13 | LICENSE = "Apache-2.0" | ||
14 | LIC_FILES_CHKSUM = "file://LICENSE;md5=435b266b3899aa8a959f17d41c56def8" | ||
15 | |||
16 | S = "${WORKDIR}/git" | ||
17 | |||
18 | RUNC_VERSION = "0.1.1" | ||
19 | PV = "${RUNC_VERSION}+git${SRCREV}" | ||
20 | |||
21 | DEPENDS = "go-cross \ | ||
22 | " | ||
23 | RRECOMMENDS_${PN} = "lxc docker" | ||
24 | |||
25 | LIBCONTAINER_PACKAGE="github.com/opencontainers/runc/libcontainer" | ||
26 | |||
27 | do_configure[noexec] = "1" | ||
28 | EXTRA_OEMAKE="BUILDTAGS=''" | ||
29 | |||
30 | do_compile() { | ||
31 | export GOARCH="${TARGET_ARCH}" | ||
32 | # supported amd64, 386, arm arm64 | ||
33 | if [ "${TARGET_ARCH}" = "x86_64" ]; then | ||
34 | export GOARCH="amd64" | ||
35 | fi | ||
36 | if [ "${TARGET_ARCH}" = "aarch64" ]; then | ||
37 | export GOARCH="arm64" | ||
38 | fi | ||
39 | |||
40 | # Set GOPATH. See 'PACKAGERS.md'. Don't rely on | ||
41 | # docker to download its dependencies but rather | ||
42 | # use dependencies packaged independently. | ||
43 | cd ${S} | ||
44 | rm -rf .gopath | ||
45 | dname=`dirname "${LIBCONTAINER_PACKAGE}"` | ||
46 | bname=`basename "${LIBCONTAINER_PACKAGE}"` | ||
47 | mkdir -p .gopath/src/${dname} | ||
48 | |||
49 | (cd .gopath/src/${dname}; ln -sf ../../../../../${bname} ${bname}) | ||
50 | export GOPATH="${S}/.gopath:${S}/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go" | ||
51 | cd - | ||
52 | |||
53 | # Pass the needed cflags/ldflags so that cgo | ||
54 | # can find the needed headers files and libraries | ||
55 | export CGO_ENABLED="1" | ||
56 | export CFLAGS="" | ||
57 | export LDFLAGS="" | ||
58 | export CGO_CFLAGS="${BUILDSDK_CFLAGS} --sysroot=${STAGING_DIR_TARGET}" | ||
59 | export CGO_LDFLAGS="${BUILDSDK_LDFLAGS} --sysroot=${STAGING_DIR_TARGET}" | ||
60 | |||
61 | oe_runmake static | ||
62 | } | ||
63 | |||
64 | do_install() { | ||
65 | mkdir -p ${D}/${bindir} | ||
66 | |||
67 | cp ${S}/runc ${D}/${bindir}/runc | ||
68 | ln -sf runc ${D}/${bindir}/docker-runc | ||
69 | } | ||
70 | |||
71 | INHIBIT_PACKAGE_STRIP = "1" | ||