blob: 9199cef958a22eed5199c2472132eaafed89e92f [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
Brad Bishop316dfdd2018-06-25 12:45:53 -040014inherit goarch
15
Brad Bishop6e60e8b2018-02-01 10:27:11 -050016RRECOMMENDS_${PN} = "lxc docker"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050017PROVIDES += "virtual/runc"
18RPROVIDES_${PN} = "virtual/runc"
19
20GO_IMPORT = "import"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050021
22LIBCONTAINER_PACKAGE="github.com/opencontainers/runc/libcontainer"
23
24do_configure[noexec] = "1"
Brad Bishop316dfdd2018-06-25 12:45:53 -040025EXTRA_OEMAKE="BUILDTAGS='' GO=${GO}"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050026
Brad Bishop6e60e8b2018-02-01 10:27:11 -050027do_compile() {
Brad Bishop6e60e8b2018-02-01 10:27:11 -050028 # Set GOPATH. See 'PACKAGERS.md'. Don't rely on
29 # docker to download its dependencies but rather
30 # use dependencies packaged independently.
Brad Bishopd7bf8c12018-02-25 22:55:05 -050031 cd ${S}/src/import
Brad Bishop6e60e8b2018-02-01 10:27:11 -050032 rm -rf .gopath
33 dname=`dirname "${LIBCONTAINER_PACKAGE}"`
34 bname=`basename "${LIBCONTAINER_PACKAGE}"`
35 mkdir -p .gopath/src/${dname}
36
37 (cd .gopath/src/${dname}; ln -sf ../../../../../${bname} ${bname})
Brad Bishopd7bf8c12018-02-25 22:55:05 -050038 export GOPATH="${S}/src/import/.gopath:${S}/src/import/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go"
39
40 # Fix up symlink for go-cross compiler
41 rm -f ${S}/src/import/vendor/src
42 ln -sf ./ ${S}/src/import/vendor/src
Brad Bishop6e60e8b2018-02-01 10:27:11 -050043
44 # Pass the needed cflags/ldflags so that cgo
45 # can find the needed headers files and libraries
46 export CGO_ENABLED="1"
47 export CGO_CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
48 export CGO_LDFLAGS="${LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
Brad Bishop316dfdd2018-06-25 12:45:53 -040049 export GO=${GO}
50
Brad Bishop6e60e8b2018-02-01 10:27:11 -050051 export CFLAGS=""
52 export LDFLAGS=""
53
Brad Bishop316dfdd2018-06-25 12:45:53 -040054 oe_runmake static
Brad Bishop6e60e8b2018-02-01 10:27:11 -050055}
56
57do_install() {
58 mkdir -p ${D}/${bindir}
59
Brad Bishopd7bf8c12018-02-25 22:55:05 -050060 cp ${S}/src/import/runc ${D}/${bindir}/runc
Brad Bishop6e60e8b2018-02-01 10:27:11 -050061 ln -sf runc ${D}/${bindir}/docker-runc
62}
63
64INHIBIT_PACKAGE_STRIP = "1"