blob: 68d73c37e0f39dce3c7d86e7819973221a5e8396 [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"
Brad Bishopd7bf8c12018-02-25 22:55:05 -05004LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e"
Brad Bishop6e60e8b2018-02-01 10:27:11 -05005
6DEPENDS = "\
7 oci-image-spec \
8 oci-runtime-spec \
9 go-digest \
10 go-errors \
11 spf13-cobra \
12 spf13-pflag \
13 "
14
Brad Bishopd7bf8c12018-02-25 22:55:05 -050015SRC_URI = "git://github.com/opencontainers/image-tools.git \
16 file://0001-image-manifest-Recursively-remove-pre-existing-entri.patch \
17 file://0002-image-manifest-Split-unpackLayerEntry-into-its-own-f.patch"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050018
Brad Bishopd7bf8c12018-02-25 22:55:05 -050019SRCREV = "4abe1a166f9be97e8e71b1bb4d7599cc29323011"
20PV = "0.2.0-dev+git${SRCPV}"
21GO_IMPORT = "import"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050022
23inherit goarch
24inherit go
25
26# This disables seccomp and apparmor, which are on by default in the
27# go package.
28EXTRA_OEMAKE="BUILDTAGS=''"
29
30do_compile() {
31 export GOARCH="${TARGET_GOARCH}"
32 export GOROOT="${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/go"
33 # Setup vendor directory so that it can be used in GOPATH.
34 #
35 # Go looks in a src directory under any directory in GOPATH but riddler
36 # uses 'vendor' instead of 'vendor/src'. We can fix this with a symlink.
37 #
38 # We also need to link in the ipallocator directory as that is not under
39 # a src directory.
Brad Bishopd7bf8c12018-02-25 22:55:05 -050040 ln -sfn . "${S}/src/import/vendor/src"
41 mkdir -p "${S}/src/import/vendor/src/github.com/opencontainers/image-tools/"
42 ln -sfn "${S}/src/import/image" "${S}/src/import/vendor/src/github.com/opencontainers/image-tools/image"
43 ln -sfn "${S}/src/import/version" "${S}/src/import/vendor/src/github.com/opencontainers/image-tools/version"
44 export GOPATH="${S}/src/import/vendor"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050045
46 # Pass the needed cflags/ldflags so that cgo
47 # can find the needed headers files and libraries
48 export CGO_ENABLED="1"
49 export CFLAGS=""
50 export LDFLAGS=""
51 export CGO_CFLAGS="${BUILDSDK_CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
52 export CGO_LDFLAGS="${BUILDSDK_LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050053 cd ${S}/src/import
Brad Bishop6e60e8b2018-02-01 10:27:11 -050054
Brad Bishopd7bf8c12018-02-25 22:55:05 -050055 oe_runmake tool
Brad Bishop6e60e8b2018-02-01 10:27:11 -050056}
57
58do_install() {
59 install -d ${D}/${sbindir}
Brad Bishopd7bf8c12018-02-25 22:55:05 -050060 install ${S}/src/import/oci-image-tool ${D}/${sbindir}/
Brad Bishop6e60e8b2018-02-01 10:27:11 -050061}
62
63INSANE_SKIP_${PN} += "ldflags"