blob: 346b305f2c1a2ed3129f0a3b1d19cf8cfb038c0c [file] [log] [blame]
Andrew Geissler028142b2023-05-05 11:29:21 -05001DESCRIPTION = "etcd is a distributed key-value store for distributed systems"
2HOMEPAGE = "https://etcd.io/"
3
4LICENSE = "Apache-2.0"
5LIC_FILES_CHKSUM = "file://${S}/${GO_INSTALL}/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"
6
7SRC_URI = " \
8 git://github.com/etcd-io/etcd;branch=release-3.5;protocol=https \
9 file://0001-xxhash-bump-to-v2.1.2.patch;patchdir=src/${GO_IMPORT} \
10 file://0001-test_lib.sh-remove-gobin-requirement-during-build.patch;patchdir=src/${GO_IMPORT} \
11"
12
13SRCREV = "215b53cf3b48ee761f4c40908b3874b2e5e95e9f"
14UPSTREAM_CHECK_COMMITS = "1"
15
16GO_IMPORT = "go.etcd.io/etcd/v3"
17GO_INSTALL = "src/${GO_IMPORT}/"
18
19RDEPENDS:${PN}-dev = " \
20 bash \
21"
22
23export GO111MODULE="on"
24
25inherit go
26
27# Go based binaries do not handle being stripped
28INHIBIT_PACKAGE_STRIP = "1"
29INHIBIT_SYSROOT_STRIP = "1"
30
31# network is required by go to get dependent packages
32do_compile[network] = "1"
33
34# Need to build etcd out of where it is extracted to
35# Need to directly call build script vs. "make build"
36# because "make build" executes the generated binaries
37# at the end of the build which do not run correctly
38# when cross compiling for another machine
39go_do_compile:prepend() {
40 cd ${GO_INSTALL}
41 ./build.sh
42
43
44 # Lots of discussion in go community about how it sets packages to
45 # read-only by default -> https://github.com/golang/go/issues/31481
46 # etcd is going to need some upstream work to support it.
47 # For now, set the packages which are read-only back to
48 # writeable so things like "bitbake -c cleanall etcd" will work.
49 chmod u+w -R ${WORKDIR}/build/pkg/mod
50}
51
52do_install:append() {
53 install -d ${D}${bindir}/
54 install -m 0755 ${D}/usr/lib/go/src/go.etcd.io/etcd/v3/bin/etcd ${D}${bindir}
55 install -m 0755 ${D}/usr/lib/go/src/go.etcd.io/etcd/v3/bin/etcdctl ${D}${bindir}
56 install -m 0755 ${D}/usr/lib/go/src/go.etcd.io/etcd/v3/bin/etcdutl ${D}${bindir}
57}
58