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" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 4 | LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 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 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 15 | SRC_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 Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 18 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 19 | SRCREV = "4abe1a166f9be97e8e71b1bb4d7599cc29323011" |
| 20 | PV = "0.2.0-dev+git${SRCPV}" |
| 21 | GO_IMPORT = "import" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 22 | |
| 23 | inherit goarch |
| 24 | inherit go |
| 25 | |
| 26 | # This disables seccomp and apparmor, which are on by default in the |
| 27 | # go package. |
| 28 | EXTRA_OEMAKE="BUILDTAGS=''" |
| 29 | |
| 30 | do_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 Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 40 | 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 Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 45 | |
| 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 Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 53 | cd ${S}/src/import |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 54 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 55 | oe_runmake tool |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 56 | } |
| 57 | |
| 58 | do_install() { |
| 59 | install -d ${D}/${sbindir} |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 60 | install ${S}/src/import/oci-image-tool ${D}/${sbindir}/ |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 61 | } |
| 62 | |
| 63 | INSANE_SKIP_${PN} += "ldflags" |