Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 1 | HOMEPAGE = "https://github.com/opencontainers/image-tools" |
| 2 | SUMMARY = "A collection of tools for working with the OCI image format specification" |
| 3 | LICENSE = "Apache-2" |
| 4 | LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" |
| 5 | |
| 6 | DEPENDS = "\ |
| 7 | oci-image-spec \ |
| 8 | oci-runtime-spec \ |
| 9 | go-digest \ |
| 10 | go-errors \ |
| 11 | spf13-cobra \ |
| 12 | spf13-pflag \ |
| 13 | " |
| 14 | |
| 15 | SRC_URI = "git://github.com/opencontainers/image-tools.git" |
| 16 | SRCREV = "a358e03fde4e3628bf9fb7656bf643b63f975636" |
| 17 | PV = "0.1.0+git${SRCPV}" |
| 18 | |
| 19 | S = "${WORKDIR}/git" |
| 20 | |
| 21 | inherit goarch |
| 22 | inherit go |
| 23 | |
| 24 | # This disables seccomp and apparmor, which are on by default in the |
| 25 | # go package. |
| 26 | EXTRA_OEMAKE="BUILDTAGS=''" |
| 27 | |
| 28 | do_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 | |
| 54 | do_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 | |
| 61 | INSANE_SKIP_${PN} += "ldflags" |