blob: 9f7fe6b4bf1f588dbba018c50b55501ff94b9c35 [file] [log] [blame]
Brad Bishop6e60e8b2018-02-01 10:27:11 -05001HOMEPAGE = "https://github.com/jfrazelle/riddler"
2SUMMARY = "Convert `docker inspect` to opencontainers (OCI compatible) runc spec."
3LICENSE = "MIT"
Brad Bishopd7bf8c12018-02-25 22:55:05 -05004LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=20ce4c6a4f32d6ee4a68e3a7506db3f1"
Brad Bishop6e60e8b2018-02-01 10:27:11 -05005
6SRC_URI = "git://github.com/jfrazelle/riddler;branch=master"
7SRCREV = "23befa0b232877b5b502b828e24161d801bd67f6"
8PV = "0.1.0+git${SRCPV}"
Brad Bishopd7bf8c12018-02-25 22:55:05 -05009GO_IMPORT = "import"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050010
11S = "${WORKDIR}/git"
12
13inherit goarch
14inherit go
15
16# This disables seccomp and apparmor, which are on by default in the
17# go package.
18EXTRA_OEMAKE="BUILDTAGS=''"
19
20do_compile() {
21 export GOARCH="${TARGET_GOARCH}"
22 export GOROOT="${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/go"
23 # Setup vendor directory so that it can be used in GOPATH.
24 #
25 # Go looks in a src directory under any directory in GOPATH but riddler
26 # uses 'vendor' instead of 'vendor/src'. We can fix this with a symlink.
27 #
28 # We also need to link in the ipallocator directory as that is not under
29 # a src directory.
Brad Bishopd7bf8c12018-02-25 22:55:05 -050030 ln -sfn . "${S}/src/import/vendor/src"
31 mkdir -p "${S}/src/import/vendor/src/github.com/jessfraz/riddler"
32 ln -sfn "${S}/src/import/parse" "${S}/src/import/vendor/src/github.com/jessfraz/riddler/parse"
33 export GOPATH="${S}/src/import/vendor"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050034
35 # Pass the needed cflags/ldflags so that cgo
36 # can find the needed headers files and libraries
37 export CGO_ENABLED="1"
38 export CFLAGS=""
39 export LDFLAGS=""
40 export CGO_CFLAGS="${BUILDSDK_CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
41 export CGO_LDFLAGS="${BUILDSDK_LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050042 cd ${S}/src/import
Brad Bishop6e60e8b2018-02-01 10:27:11 -050043
44 oe_runmake static
45}
46
47do_install() {
48 install -d ${D}/${sbindir}
Brad Bishopd7bf8c12018-02-25 22:55:05 -050049 install ${S}/src/import/riddler ${D}/${sbindir}/riddler
Brad Bishop6e60e8b2018-02-01 10:27:11 -050050}