blob: 29a892664e3330f1319ed5a00a27502c4ee5709c [file] [log] [blame]
Brad Bishop6e60e8b2018-02-01 10:27:11 -05001HOMEPAGE = "https://github.com/opencontainers/image-tools"
2SUMMARY = "A collection of tools for working with the OCI image format specification"
3LICENSE = "Apache-2"
4LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e"
5
6DEPENDS = "\
7 oci-image-spec \
8 oci-runtime-spec \
9 go-digest \
10 go-errors \
11 spf13-cobra \
12 spf13-pflag \
13 "
14
15SRC_URI = "git://github.com/opencontainers/image-tools.git"
16SRCREV = "a358e03fde4e3628bf9fb7656bf643b63f975636"
17PV = "0.1.0+git${SRCPV}"
18
19S = "${WORKDIR}/git"
20
21inherit goarch
22inherit go
23
24# This disables seccomp and apparmor, which are on by default in the
25# go package.
26EXTRA_OEMAKE="BUILDTAGS=''"
27
28do_compile() {
29 export GOARCH="${TARGET_GOARCH}"
30 export GOROOT="${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/go"
31 # Setup vendor directory so that it can be used in GOPATH.
32 #
33 # Go looks in a src directory under any directory in GOPATH but riddler
34 # uses 'vendor' instead of 'vendor/src'. We can fix this with a symlink.
35 #
36 # We also need to link in the ipallocator directory as that is not under
37 # a src directory.
38 ln -sfn . "${S}/vendor/src"
39 mkdir -p "${S}/vendor/src/github.com/opencontainers/image-tools/"
40 ln -sfn "${S}/image" "${S}/vendor/src/github.com/opencontainers/image-tools/image"
41 export GOPATH="${S}/vendor"
42
43 # Pass the needed cflags/ldflags so that cgo
44 # can find the needed headers files and libraries
45 export CGO_ENABLED="1"
46 export CFLAGS=""
47 export LDFLAGS=""
48 export CGO_CFLAGS="${BUILDSDK_CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
49 export CGO_LDFLAGS="${BUILDSDK_LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
50
51 oe_runmake tools
52}
53
54do_install() {
55 install -d ${D}/${sbindir}
56 install ${S}/oci-create-runtime-bundle ${D}/${sbindir}/
57 install ${S}/oci-image-validate ${D}/${sbindir}/
58 install ${S}/oci-unpack ${D}/${sbindir}/
59}
60
61INSANE_SKIP_${PN} += "ldflags"