summaryrefslogtreecommitdiffstats
path: root/recipes-containers
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-containers')
-rw-r--r--recipes-containers/runc/runc_git.bb71
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 @@
1HOMEPAGE = "https://github.com/opencontainers/runc"
2SUMMARY = "runc container cli tools"
3DESCRIPTION = "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.
7SRCREV = "baf6536d6259209c3edfa2b22237af82942d3dfa"
8SRC_URI = "\
9 git://github.com/opencontainers/runc;branch=master \
10 "
11
12# Apache-2.0 for containerd
13LICENSE = "Apache-2.0"
14LIC_FILES_CHKSUM = "file://LICENSE;md5=435b266b3899aa8a959f17d41c56def8"
15
16S = "${WORKDIR}/git"
17
18RUNC_VERSION = "0.1.1"
19PV = "${RUNC_VERSION}+git${SRCREV}"
20
21DEPENDS = "go-cross \
22 "
23RRECOMMENDS_${PN} = "lxc docker"
24
25LIBCONTAINER_PACKAGE="github.com/opencontainers/runc/libcontainer"
26
27do_configure[noexec] = "1"
28EXTRA_OEMAKE="BUILDTAGS=''"
29
30do_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
64do_install() {
65 mkdir -p ${D}/${bindir}
66
67 cp ${S}/runc ${D}/${bindir}/runc
68 ln -sf runc ${D}/${bindir}/docker-runc
69}
70
71INHIBIT_PACKAGE_STRIP = "1"