blob: 0179103092b57cf15062dd697755fb9e76ca4650 [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"
Brad Bishopd7bf8c12018-02-25 22:55:05 -05007LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=435b266b3899aa8a959f17d41c56def8"
Brad Bishop6e60e8b2018-02-01 10:27:11 -05008
9S = "${WORKDIR}/git"
10
Brad Bishopd7bf8c12018-02-25 22:55:05 -050011PV = "${RUNC_VERSION}+git${SRCPV}"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050012
13inherit go
14RRECOMMENDS_${PN} = "lxc docker"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050015PROVIDES += "virtual/runc"
16RPROVIDES_${PN} = "virtual/runc"
17
18GO_IMPORT = "import"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050019
20LIBCONTAINER_PACKAGE="github.com/opencontainers/runc/libcontainer"
21
22do_configure[noexec] = "1"
23EXTRA_OEMAKE="BUILDTAGS=''"
24
Brad Bishop6e60e8b2018-02-01 10:27:11 -050025do_compile() {
Brad Bishop6e60e8b2018-02-01 10:27:11 -050026 # Set GOPATH. See 'PACKAGERS.md'. Don't rely on
27 # docker to download its dependencies but rather
28 # use dependencies packaged independently.
Brad Bishopd7bf8c12018-02-25 22:55:05 -050029 cd ${S}/src/import
Brad Bishop6e60e8b2018-02-01 10:27:11 -050030 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})
Brad Bishopd7bf8c12018-02-25 22:55:05 -050036 export GOPATH="${S}/src/import/.gopath:${S}/src/import/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go"
37
38 # Fix up symlink for go-cross compiler
39 rm -f ${S}/src/import/vendor/src
40 ln -sf ./ ${S}/src/import/vendor/src
Brad Bishop6e60e8b2018-02-01 10:27:11 -050041
42 # Pass the needed cflags/ldflags so that cgo
43 # can find the needed headers files and libraries
44 export CGO_ENABLED="1"
45 export CGO_CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
46 export CGO_LDFLAGS="${LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
47 export CFLAGS=""
48 export LDFLAGS=""
49
50 oe_runmake static
51}
52
53do_install() {
54 mkdir -p ${D}/${bindir}
55
Brad Bishopd7bf8c12018-02-25 22:55:05 -050056 cp ${S}/src/import/runc ${D}/${bindir}/runc
Brad Bishop6e60e8b2018-02-01 10:27:11 -050057 ln -sf runc ${D}/${bindir}/docker-runc
58}
59
60INHIBIT_PACKAGE_STRIP = "1"