SUMMARY = "Multiplexing library for Golang"
HOMEPAGE = "https://github.com/hashicorp/yamux"
LICENSE = "MPL-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=2dd1a9ecf92cd5617f128808f9b85b44"

PKG_NAME = "github.com/hashicorp/yamux"
SRC_URI = "git://${PKG_NAME}.git"
SRCREV = "b2e55852ddaf823a85c67f798080eb7d08acd71d"

S = "${WORKDIR}/git"

do_install() {
    install -d ${D}${prefix}/local/go/src/${PKG_NAME}
    cp -a ${S}/* ${D}${prefix}/local/go/src/${PKG_NAME}/
}

SYSROOT_PREPROCESS_FUNCS += "yamux_sysroot_preprocess"

yamux_sysroot_preprocess () {
    install -d ${SYSROOT_DESTDIR}${prefix}/local/go/src/${PKG_NAME}
    cp -a ${D}${prefix}/local/go/src/${PKG_NAME} ${SYSROOT_DESTDIR}${prefix}/local/go/src/$(dirname ${PKG_NAME})
}

FILES_${PN} += "${prefix}/local/go/src/${PKG_NAME}/*"

Add bitbake recipe to build yamux
yamux: Add bitbake recipe to build yamux

Yamux is a multiplexing library for go. It is part of the dependency
tree needed to build consul.

Signed-off-by: Christopher Braga <ecd7259f54548716af2f59ce4d8c3af5ea2e9f00@windriver.com>
