Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 1 | HOMEPAGE = "https://github.com/jfrazelle/riddler" |
| 2 | SUMMARY = "Convert `docker inspect` to opencontainers (OCI compatible) runc spec." |
| 3 | LICENSE = "MIT" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 4 | LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=20ce4c6a4f32d6ee4a68e3a7506db3f1" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 5 | |
| 6 | SRC_URI = "git://github.com/jfrazelle/riddler;branch=master" |
| 7 | SRCREV = "23befa0b232877b5b502b828e24161d801bd67f6" |
| 8 | PV = "0.1.0+git${SRCPV}" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 9 | GO_IMPORT = "import" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 10 | |
| 11 | S = "${WORKDIR}/git" |
| 12 | |
| 13 | inherit goarch |
| 14 | inherit go |
| 15 | |
| 16 | # This disables seccomp and apparmor, which are on by default in the |
| 17 | # go package. |
| 18 | EXTRA_OEMAKE="BUILDTAGS=''" |
| 19 | |
| 20 | do_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 Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 30 | 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 Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 34 | |
| 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 Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 42 | cd ${S}/src/import |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 43 | |
| 44 | oe_runmake static |
| 45 | } |
| 46 | |
| 47 | do_install() { |
| 48 | install -d ${D}/${sbindir} |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 49 | install ${S}/src/import/riddler ${D}/${sbindir}/riddler |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 50 | } |