Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / servers / etcd / 3.5.nix
bloba7507f1dd23779de6a0277514516d514e265e713
1 { lib, buildGoModule, fetchFromGitHub, symlinkJoin, nixosTests }:
3 let
4   version = "3.5.9";
6   src = fetchFromGitHub {
7     owner = "etcd-io";
8     repo = "etcd";
9     rev = "v${version}";
10     hash = "sha256-Vp8U49fp0FowIuSSvbrMWjAKG2oDO1o0qO4izSnTR3U=";
11   };
13   CGO_ENABLED = 0;
15   meta = with lib; {
16     description = "Distributed reliable key-value store for the most critical data of a distributed system";
17     license = licenses.asl20;
18     homepage = "https://etcd.io/";
19     maintainers = with maintainers; [ offline endocrimes ];
20     platforms = platforms.darwin ++ platforms.linux;
21   };
23   etcdserver = buildGoModule rec {
24     pname = "etcdserver";
26     inherit CGO_ENABLED meta src version;
28     vendorHash = "sha256-vu5VKHnDbvxSd8qpIFy0bA88IIXLaQ5S8dVUJEwnKJA=";
30     modRoot = "./server";
32     preInstall = ''
33       mv $GOPATH/bin/{server,etcd}
34     '';
36     # We set the GitSHA to `GitNotFound` to match official build scripts when
37     # git is unavailable. This is to avoid doing a full Git Checkout of etcd.
38     # User facing version numbers are still available in the binary, just not
39     # the sha it was built from.
40     ldflags = [ "-X go.etcd.io/etcd/api/v3/version.GitSHA=GitNotFound" ];
41   };
43   etcdutl = buildGoModule rec {
44     pname = "etcdutl";
46     inherit CGO_ENABLED meta src version;
48     vendorHash = "sha256-i60rKCmbEXkdFOZk2dTbG5EtYKb5eCBSyMcsTtnvATs=";
50     modRoot = "./etcdutl";
51   };
53   etcdctl = buildGoModule rec {
54     pname = "etcdctl";
56     inherit CGO_ENABLED meta src version;
58     vendorHash = "sha256-awl/4kuOjspMVEwfANWK0oi3RId6ERsFkdluiRaaXlA=";
60     modRoot = "./etcdctl";
61   };
63 symlinkJoin {
64   name = "etcd-${version}";
66   inherit meta version;
68   passthru = {
69     inherit etcdserver etcdutl etcdctl;
70     tests = { inherit (nixosTests) etcd etcd-cluster; };
71   };
73   paths = [
74     etcdserver
75     etcdutl
76     etcdctl
77   ];