blob: 807ee26c66b1db3fbc0996abf689e9837a9a303c [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 \
Brad Bishop316dfdd2018-06-25 12:45:53 -040017 file://0002-image-manifest-Split-unpackLayerEntry-into-its-own-f.patch \
18 file://0001-config-make-Config.User-mapping-errors-a-warning.patch"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050019
Brad Bishopd7bf8c12018-02-25 22:55:05 -050020SRCREV = "4abe1a166f9be97e8e71b1bb4d7599cc29323011"
21PV = "0.2.0-dev+git${SRCPV}"
22GO_IMPORT = "import"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050023
24inherit goarch
25inherit go
26
27# This disables seccomp and apparmor, which are on by default in the
28# go package.
29EXTRA_OEMAKE="BUILDTAGS=''"
30
31do_compile() {
32 export GOARCH="${TARGET_GOARCH}"
33 export GOROOT="${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/go"
34 # Setup vendor directory so that it can be used in GOPATH.
35 #
36 # Go looks in a src directory under any directory in GOPATH but riddler
37 # uses 'vendor' instead of 'vendor/src'. We can fix this with a symlink.
38 #
39 # We also need to link in the ipallocator directory as that is not under
40 # a src directory.
Brad Bishopd7bf8c12018-02-25 22:55:05 -050041 ln -sfn . "${S}/src/import/vendor/src"
42 mkdir -p "${S}/src/import/vendor/src/github.com/opencontainers/image-tools/"
43 ln -sfn "${S}/src/import/image" "${S}/src/import/vendor/src/github.com/opencontainers/image-tools/image"
44 ln -sfn "${S}/src/import/version" "${S}/src/import/vendor/src/github.com/opencontainers/image-tools/version"
45 export GOPATH="${S}/src/import/vendor"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050046
47 # Pass the needed cflags/ldflags so that cgo
48 # can find the needed headers files and libraries
49 export CGO_ENABLED="1"
50 export CFLAGS=""
51 export LDFLAGS=""
52 export CGO_CFLAGS="${BUILDSDK_CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
53 export CGO_LDFLAGS="${BUILDSDK_LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050054 cd ${S}/src/import
Brad Bishop6e60e8b2018-02-01 10:27:11 -050055
Brad Bishopd7bf8c12018-02-25 22:55:05 -050056 oe_runmake tool
Brad Bishop6e60e8b2018-02-01 10:27:11 -050057}
58
59do_install() {
60 install -d ${D}/${sbindir}
Brad Bishopd7bf8c12018-02-25 22:55:05 -050061 install ${S}/src/import/oci-image-tool ${D}/${sbindir}/
Brad Bishop6e60e8b2018-02-01 10:27:11 -050062}
63
64INSANE_SKIP_${PN} += "ldflags"