2021-12-06 16:07:01 +00:00
|
|
|
{ lib
|
2020-05-15 21:57:56 +00:00
|
|
|
, buildGoModule
|
2020-08-20 17:08:02 +00:00
|
|
|
, bzip2
|
2024-09-19 14:19:46 +00:00
|
|
|
, fetchFromGitHub
|
2020-04-24 23:36:52 +00:00
|
|
|
, lz4
|
2024-09-19 14:19:46 +00:00
|
|
|
, nixosTests
|
|
|
|
, pkg-config
|
|
|
|
, rocksdb_7_10
|
2020-08-20 17:08:02 +00:00
|
|
|
, snappy
|
2024-09-19 14:19:46 +00:00
|
|
|
, stdenv
|
2020-08-20 17:08:02 +00:00
|
|
|
, zeromq
|
|
|
|
, zlib
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
let
|
2024-09-19 14:19:46 +00:00
|
|
|
rocksdb = rocksdb_7_10;
|
2021-12-06 16:07:01 +00:00
|
|
|
in
|
2020-05-15 21:57:56 +00:00
|
|
|
buildGoModule rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "blockbook";
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "0.4.0";
|
|
|
|
commit = "b227dfe";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "trezor";
|
|
|
|
repo = "blockbook";
|
|
|
|
rev = "v${version}";
|
2024-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-98tp3QYaHfhVIiJ4xkA3bUanXwK1q05t+YNroFtBUxE=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
proxyVendor = true;
|
|
|
|
|
|
|
|
vendorHash = "sha256-n03eWWy+58KAbYnKxI3/ulWIpmR+ivtImQSqbe2kpYU=";
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
buildInputs = [ bzip2 lz4 rocksdb snappy zeromq zlib ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-08-27 14:25:00 +00:00
|
|
|
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"
|
|
|
|
];
|
2020-05-15 21:57:56 +00:00
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
tags = [ "rocksdb_7_10" ];
|
2021-12-06 16:07:01 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
CGO_LDFLAGS = [
|
|
|
|
"-L${stdenv.cc.cc.lib}/lib"
|
|
|
|
"-lrocksdb"
|
|
|
|
"-lz"
|
|
|
|
"-lbz2"
|
|
|
|
"-lsnappy"
|
|
|
|
"-llz4"
|
|
|
|
"-lm"
|
|
|
|
"-lstdc++"
|
|
|
|
];
|
|
|
|
|
2024-09-26 11:04:55 +00:00
|
|
|
preBuild = lib.optionalString stdenv.hostPlatform.isDarwin ''
|
2020-04-24 23:36:52 +00:00
|
|
|
ulimit -n 8192
|
|
|
|
'';
|
|
|
|
|
2020-05-03 17:38:23 +00:00
|
|
|
subPackages = [ "." ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-07-18 16:06:22 +00:00
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/share/
|
|
|
|
cp -r $src/static/templates/ $out/share/
|
|
|
|
cp -r $src/static/css/ $out/share/
|
|
|
|
'';
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
passthru.tests = {
|
|
|
|
smoke-test = nixosTests.blockbook-frontend;
|
|
|
|
};
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Trezor address/account balance backend";
|
|
|
|
homepage = "https://github.com/trezor/blockbook";
|
2024-04-21 15:54:59 +00:00
|
|
|
license = licenses.agpl3Only;
|
2020-08-20 17:08:02 +00:00
|
|
|
maintainers = with maintainers; [ mmahut _1000101 ];
|
|
|
|
platforms = platforms.unix;
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "blockbook";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|