biglybt: 3.5.0.0 -> 3.6.0.0
[NixPkgs.git] / pkgs / applications / blockchains / lnd / default.nix
blob73bd7f3afc27666289c0b824c4b0df22d1c69066
1 { buildGoModule
2 , fetchFromGitHub
3 , lib
4 , tags ? [ "autopilotrpc" "signrpc" "walletrpc" "chainrpc" "invoicesrpc" "watchtowerrpc" "routerrpc" "monitoring" "kvdb_postgres" "kvdb_etcd" ]
5 }:
7 buildGoModule rec {
8   pname = "lnd";
9   version = "0.17.4-beta";
11   src = fetchFromGitHub {
12     owner = "lightningnetwork";
13     repo = "lnd";
14     rev = "v${version}";
15     hash = "sha256-O6cGK4UMKrZpYqtghjjqqLBStLG5GEi/Q5liR557I8s=";
16   };
18   vendorHash = "sha256-eaQmM5bfsUmzTiUALX543VBQRJK+TqW2i28npwSrn3Q=";
20   subPackages = [ "cmd/lncli" "cmd/lnd" ];
22   preBuild = let
23     buildVars = {
24       RawTags = lib.concatStringsSep "," tags;
25       GoVersion = "$(go version | egrep -o 'go[0-9]+[.][^ ]*')";
26     };
27     buildVarsFlags = lib.concatStringsSep " " (lib.mapAttrsToList (k: v: "-X github.com/lightningnetwork/lnd/build.${k}=${v}") buildVars);
28   in
29   lib.optionalString (tags != []) ''
30     buildFlagsArray+=("-tags=${lib.concatStringsSep " " tags}")
31     buildFlagsArray+=("-ldflags=${buildVarsFlags}")
32   '';
34   meta = with lib; {
35     description = "Lightning Network Daemon";
36     homepage = "https://github.com/lightningnetwork/lnd";
37     license = licenses.mit;
38     maintainers = with maintainers; [ cypherpunk2140 prusnak ];
39   };