Andrew Geissler | 028142b | 2023-05-05 11:29:21 -0500 | [diff] [blame] | 1 | DESCRIPTION = "etcd is a distributed key-value store for distributed systems" |
| 2 | HOMEPAGE = "https://etcd.io/" |
| 3 | |
| 4 | LICENSE = "Apache-2.0" |
| 5 | LIC_FILES_CHKSUM = "file://${S}/${GO_INSTALL}/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57" |
| 6 | |
| 7 | SRC_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 | |
| 13 | SRCREV = "215b53cf3b48ee761f4c40908b3874b2e5e95e9f" |
| 14 | UPSTREAM_CHECK_COMMITS = "1" |
| 15 | |
| 16 | GO_IMPORT = "go.etcd.io/etcd/v3" |
| 17 | GO_INSTALL = "src/${GO_IMPORT}/" |
| 18 | |
| 19 | RDEPENDS:${PN}-dev = " \ |
| 20 | bash \ |
| 21 | " |
| 22 | |
| 23 | export GO111MODULE="on" |
| 24 | |
| 25 | inherit go |
| 26 | |
| 27 | # Go based binaries do not handle being stripped |
| 28 | INHIBIT_PACKAGE_STRIP = "1" |
| 29 | INHIBIT_SYSROOT_STRIP = "1" |
| 30 | |
| 31 | # network is required by go to get dependent packages |
| 32 | do_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 |
| 39 | go_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 | |
| 52 | do_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 | |