1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-04 19:45:54 +00:00
nixpkgs/pkgs/servers/blockbook/default.nix

58 lines
1.3 KiB
Nix
Raw Normal View History

{ stdenv
2020-04-22 22:09:47 +01:00
, buildGoModule
2019-07-06 22:08:55 +01:00
, lib
, fetchFromGitHub
, rocksdb
, bzip2
, zlib
, packr
, snappy
, pkg-config
, zeromq
, lz4
}:
2020-04-22 22:09:47 +01:00
buildGoModule rec {
2019-07-06 22:08:55 +01:00
pname = "blockbook";
2020-04-22 22:09:47 +01:00
version = "0.3.3";
commit = "b6961ca";
2019-07-06 22:08:55 +01:00
src = fetchFromGitHub {
owner = "trezor";
repo = "blockbook";
rev = "v${version}";
2020-04-22 22:09:47 +01:00
sha256 = "01nb4if2dix2h95xvqvafil325jjw2a4v1izb9mad0cjqcf8rk6n";
2019-07-06 22:08:55 +01:00
};
2020-04-22 22:09:47 +01:00
modSha256 = "1zp06mpkxaxykw8pr679fg9dd7039qj13j5lknxp7hr8dga0jvpy";
2019-07-06 22:08:55 +01:00
buildInputs = [ bzip2 zlib snappy zeromq lz4 ];
nativeBuildInputs = [ pkg-config packr ];
2020-04-22 22:09:47 +01:00
buildFlagsArray = ''
-ldflags=
-X github.com/trezor/blockbook/common.version=${version}
-X github.com/trezor/blockbook/common.gitcommit=${commit}
-X github.com/trezor/blockbook/common.buildDate=unknown
'';
preBuild = lib.optionalString stdenv.isDarwin ''
ulimit -n 8192
'' + ''
2019-07-06 22:08:55 +01:00
export CGO_CFLAGS="-I${rocksdb}/include"
export CGO_LDFLAGS="-L${rocksdb}/lib -lrocksdb -lstdc++ -lm -lz -lbz2 -lsnappy -llz4"
packr clean && packr
'';
2020-04-27 11:16:16 +01:00
subPackages = [ "." ];
2019-07-06 22:08:55 +01:00
meta = with lib; {
description = "Trezor address/account balance backend";
homepage = "https://github.com/trezor/blockbook";
license = licenses.agpl3;
2020-04-22 22:09:47 +01:00
maintainers = with maintainers; [ mmahut maintainers."1000101" ];
platforms = remove "aarch64-linux" platforms.unix;
2019-07-06 22:08:55 +01:00
};
}