Andrew Geissler 4cd2006c6b etcd: remove gobin requirement for build
This tool is installed as a part of the build process (build.sh sources
test_lib.sh)

This tool has been removed in the latest etcd main branch. Installing it
as a part of the build process breaks bitbake (it doesn't allow
downloading of packages once in the build steps).

This tool is not needed to build etcd (it appears to be used for some
optional test cases).

The following upstream commit removes the use of gobin in the main
branch, but it's not clear to me if the alternative of just running "go
install" will fix this issue. Fundamentally etcd allows package install
during build and bitbake does not:
900fc8dd7e

Upstream-Status: Inappropriate

Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2023-05-02 14:16:58 -07:00

59 lines
1.9 KiB
BlitzBasic

DESCRIPTION = "etcd is a distributed key-value store for distributed systems"
HOMEPAGE = "https://etcd.io/"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${S}/${GO_INSTALL}/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"
SRC_URI = " \
git://github.com/etcd-io/etcd;branch=release-3.5;protocol=https \
file://0001-xxhash-bump-to-v2.1.2.patch;patchdir=src/${GO_IMPORT} \
file://0001-test_lib.sh-remove-gobin-requirement-during-build.patch;patchdir=src/${GO_IMPORT} \
"
SRCREV = "215b53cf3b48ee761f4c40908b3874b2e5e95e9f"
UPSTREAM_CHECK_COMMITS = "1"
GO_IMPORT = "go.etcd.io/etcd/v3"
GO_INSTALL = "src/${GO_IMPORT}/"
RDEPENDS:${PN}-dev = " \
bash \
"
export GO111MODULE="on"
inherit go
# Go based binaries do not handle being stripped
INHIBIT_PACKAGE_STRIP = "1"
INHIBIT_SYSROOT_STRIP = "1"
# network is required by go to get dependent packages
do_compile[network] = "1"
# Need to build etcd out of where it is extracted to
# Need to directly call build script vs. "make build"
# because "make build" executes the generated binaries
# at the end of the build which do not run correctly
# when cross compiling for another machine
go_do_compile:prepend() {
cd ${GO_INSTALL}
./build.sh
# Lots of discussion in go community about how it sets packages to
# read-only by default -> https://github.com/golang/go/issues/31481
# etcd is going to need some upstream work to support it.
# For now, set the packages which are read-only back to
# writeable so things like "bitbake -c cleanall etcd" will work.
chmod u+w -R ${WORKDIR}/build/pkg/mod
}
do_install:append() {
install -d ${D}${bindir}/
install -m 0755 ${D}/usr/lib/go/src/go.etcd.io/etcd/v3/bin/etcd ${D}${bindir}
install -m 0755 ${D}/usr/lib/go/src/go.etcd.io/etcd/v3/bin/etcdctl ${D}${bindir}
install -m 0755 ${D}/usr/lib/go/src/go.etcd.io/etcd/v3/bin/etcdutl ${D}${bindir}
}