Patrick Williams | e69d235 | 2017-02-23 20:56:04 -0600 | [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 | # Note: this rev is before the required protocol field, update when all components |
| 6 | # have been updated to match. |
| 7 | SRCREV = "1cdaa709f151b61cee2bdaa09d8e5d2b58a8ba72" |
| 8 | SRC_URI = "\ |
| 9 | git://github.com/opencontainers/runc;branch=master \ |
| 10 | " |
| 11 | |
| 12 | # Apache-2.0 for containerd |
| 13 | LICENSE = "Apache-2.0" |
| 14 | LIC_FILES_CHKSUM = "file://LICENSE;md5=435b266b3899aa8a959f17d41c56def8" |
| 15 | |
| 16 | S = "${WORKDIR}/git" |
| 17 | |
| 18 | RUNC_VERSION = "1.0.0-rc1" |
| 19 | PV = "${RUNC_VERSION}+git${SRCREV}" |
| 20 | |
| 21 | DEPENDS = "go-cross \ |
| 22 | " |
| 23 | RRECOMMENDS_${PN} = "lxc docker" |
| 24 | |
| 25 | LIBCONTAINER_PACKAGE="github.com/opencontainers/runc/libcontainer" |
| 26 | |
| 27 | do_configure[noexec] = "1" |
| 28 | EXTRA_OEMAKE="BUILDTAGS=''" |
| 29 | |
| 30 | inherit go-osarchmap |
| 31 | |
| 32 | do_compile() { |
| 33 | export GOARCH="${TARGET_GOARCH}" |
| 34 | |
| 35 | # Set GOPATH. See 'PACKAGERS.md'. Don't rely on |
| 36 | # docker to download its dependencies but rather |
| 37 | # use dependencies packaged independently. |
| 38 | cd ${S} |
| 39 | rm -rf .gopath |
| 40 | dname=`dirname "${LIBCONTAINER_PACKAGE}"` |
| 41 | bname=`basename "${LIBCONTAINER_PACKAGE}"` |
| 42 | mkdir -p .gopath/src/${dname} |
| 43 | |
| 44 | (cd .gopath/src/${dname}; ln -sf ../../../../../${bname} ${bname}) |
| 45 | export GOPATH="${S}/.gopath:${S}/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go" |
| 46 | cd - |
| 47 | |
| 48 | # Pass the needed cflags/ldflags so that cgo |
| 49 | # can find the needed headers files and libraries |
| 50 | export CGO_ENABLED="1" |
| 51 | export CGO_CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_TARGET}" |
| 52 | export CGO_LDFLAGS="${LDFLAGS} --sysroot=${STAGING_DIR_TARGET}" |
| 53 | export CFLAGS="" |
| 54 | export LDFLAGS="" |
| 55 | |
| 56 | oe_runmake static |
| 57 | } |
| 58 | |
| 59 | do_install() { |
| 60 | mkdir -p ${D}/${bindir} |
| 61 | |
| 62 | cp ${S}/runc ${D}/${bindir}/runc |
| 63 | ln -sf runc ${D}/${bindir}/docker-runc |
| 64 | } |
| 65 | |
| 66 | INHIBIT_PACKAGE_STRIP = "1" |