blob: 61b68b5ffc2b847cb89ae47de75ae238ffb806e1 [file] [log] [blame]
Brad Bishop6e60e8b2018-02-01 10:27:11 -05001HOMEPAGE = "https://github.com/opencontainers/runtime-tools"
2SUMMARY = "oci-runtime-tool is a collection of tools for working with the OCI runtime specification"
3LICENSE = "GPLv2"
Brad Bishopd7bf8c12018-02-25 22:55:05 -05004LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=b355a61a394a504dacde901c958f662c"
Brad Bishop6e60e8b2018-02-01 10:27:11 -05005
Brad Bishopd7bf8c12018-02-25 22:55:05 -05006SRC_URI = "git://github.com/opencontainers/runtime-tools.git \
7 file://0001-Revert-implement-add-set-function-for-hooks-items.patch \
8 "
Brad Bishop6e60e8b2018-02-01 10:27:11 -05009
Brad Bishopd7bf8c12018-02-25 22:55:05 -050010SRCREV = "6e7da8148f4de2c9e9c9d3b345576898d4f412cb"
11PV = "0.1.0+git${SRCPV}"
12GO_IMPORT = "import"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050013
Brad Bishopd7bf8c12018-02-25 22:55:05 -050014INSANE_SKIP_${PN} += "ldflags"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050015
16inherit goarch
17inherit go
18
19do_compile() {
20 export GOARCH="${TARGET_GOARCH}"
21 export GOROOT="${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/go"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050022 export GOPATH="${S}/src/import:${S}/src/import/vendor"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050023
24 # Pass the needed cflags/ldflags so that cgo
25 # can find the needed headers files and libraries
26 export CGO_ENABLED="1"
27 export CFLAGS=""
28 export LDFLAGS=""
29 export CGO_CFLAGS="${BUILDSDK_CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
30 export CGO_LDFLAGS="${BUILDSDK_LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
31
Brad Bishopd7bf8c12018-02-25 22:55:05 -050032 # link fixups for compilation
33 rm -f ${S}/src/import/vendor/src
34 ln -sf ./ ${S}/src/import/vendor/src
35 mkdir -p ${S}/src/import/vendor/github.com/opencontainers/runtime-tools
36 ln -sf ../../../../generate ${S}/src/import/vendor/github.com/opencontainers/runtime-tools/generate
37 ln -sf ../../../../validate ${S}/src/import/vendor/github.com/opencontainers/runtime-tools/validate
38 ln -sf ../../../../cmd ${S}/src/import/vendor/github.com/opencontainers/runtime-tools/cmd
39 ln -sf ../../../../error ${S}/src/import/vendor/github.com/opencontainers/runtime-tools/error
40 ln -sf ../../../../specerror ${S}/src/import/vendor/github.com/opencontainers/runtime-tools/specerror
41 cd ${S}/src/import
42
Brad Bishop6e60e8b2018-02-01 10:27:11 -050043 oe_runmake
44}
45
46do_install() {
47 install -d ${D}/${sbindir}
Brad Bishopd7bf8c12018-02-25 22:55:05 -050048 install ${S}/src/import/oci-runtime-tool ${D}/${sbindir}/oci-runtime-tool
Brad Bishop6e60e8b2018-02-01 10:27:11 -050049}
Brad Bishopd7bf8c12018-02-25 22:55:05 -050050
51deltask compile_ptest_base
52