blob: 4808547b15a8f3cf53e51b1546380cfac332e31d [file] [log] [blame]
Brad Bishop6e60e8b2018-02-01 10:27:11 -05001HOMEPAGE = "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# Apache-2.0 for containerd
6LICENSE = "Apache-2.0"
7LIC_FILES_CHKSUM = "file://LICENSE;md5=435b266b3899aa8a959f17d41c56def8"
8
9S = "${WORKDIR}/git"
10
11PV = "${RUNC_VERSION}+git${SRCREV}"
12
13inherit go
14RRECOMMENDS_${PN} = "lxc docker"
15
16LIBCONTAINER_PACKAGE="github.com/opencontainers/runc/libcontainer"
17
18do_configure[noexec] = "1"
19EXTRA_OEMAKE="BUILDTAGS=''"
20
21inherit goarch
22
23do_compile() {
24 export GOARCH="${TARGET_GOARCH}"
25 export GOROOT="${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/go"
26 # Set GOPATH. See 'PACKAGERS.md'. Don't rely on
27 # docker to download its dependencies but rather
28 # use dependencies packaged independently.
29 cd ${S}
30 rm -rf .gopath
31 dname=`dirname "${LIBCONTAINER_PACKAGE}"`
32 bname=`basename "${LIBCONTAINER_PACKAGE}"`
33 mkdir -p .gopath/src/${dname}
34
35 (cd .gopath/src/${dname}; ln -sf ../../../../../${bname} ${bname})
36 export GOPATH="${S}/.gopath:${S}/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go"
37 export GOROOT="${STAGING_DIR_NATIVE}/${nonarch_libdir}/${HOST_SYS}/go"
38 cd -
39
40 # Pass the needed cflags/ldflags so that cgo
41 # can find the needed headers files and libraries
42 export CGO_ENABLED="1"
43 export CGO_CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
44 export CGO_LDFLAGS="${LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
45 export CFLAGS=""
46 export LDFLAGS=""
47
48 oe_runmake static
49}
50
51do_install() {
52 mkdir -p ${D}/${bindir}
53
54 cp ${S}/runc ${D}/${bindir}/runc
55 ln -sf runc ${D}/${bindir}/docker-runc
56}
57
58INHIBIT_PACKAGE_STRIP = "1"