Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 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 | # Apache-2.0 for containerd |
| 6 | LICENSE = "Apache-2.0" |
| 7 | LIC_FILES_CHKSUM = "file://LICENSE;md5=435b266b3899aa8a959f17d41c56def8" |
| 8 | |
| 9 | S = "${WORKDIR}/git" |
| 10 | |
| 11 | PV = "${RUNC_VERSION}+git${SRCREV}" |
| 12 | |
| 13 | inherit go |
| 14 | RRECOMMENDS_${PN} = "lxc docker" |
| 15 | |
| 16 | LIBCONTAINER_PACKAGE="github.com/opencontainers/runc/libcontainer" |
| 17 | |
| 18 | do_configure[noexec] = "1" |
| 19 | EXTRA_OEMAKE="BUILDTAGS=''" |
| 20 | |
| 21 | inherit goarch |
| 22 | |
| 23 | do_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 | |
| 51 | do_install() { |
| 52 | mkdir -p ${D}/${bindir} |
| 53 | |
| 54 | cp ${S}/runc ${D}/${bindir}/runc |
| 55 | ln -sf runc ${D}/${bindir}/docker-runc |
| 56 | } |
| 57 | |
| 58 | INHIBIT_PACKAGE_STRIP = "1" |