nixpkgs/pkgs/by-name/bl/blockbook/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

82 lines
1.6 KiB
Nix

{ lib
, buildGoModule
, bzip2
, fetchFromGitHub
, lz4
, nixosTests
, pkg-config
, rocksdb_7_10
, snappy
, stdenv
, zeromq
, zlib
}:
let
rocksdb = rocksdb_7_10;
in
buildGoModule rec {
pname = "blockbook";
version = "0.4.0";
commit = "b227dfe";
src = fetchFromGitHub {
owner = "trezor";
repo = "blockbook";
rev = "v${version}";
hash = "sha256-98tp3QYaHfhVIiJ4xkA3bUanXwK1q05t+YNroFtBUxE=";
};
proxyVendor = true;
vendorHash = "sha256-n03eWWy+58KAbYnKxI3/ulWIpmR+ivtImQSqbe2kpYU=";
nativeBuildInputs = [ pkg-config ];
buildInputs = [ bzip2 lz4 rocksdb snappy zeromq zlib ];
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"
];
tags = [ "rocksdb_7_10" ];
CGO_LDFLAGS = [
"-L${lib.getLib stdenv.cc.cc}/lib"
"-lrocksdb"
"-lz"
"-lbz2"
"-lsnappy"
"-llz4"
"-lm"
"-lstdc++"
];
preBuild = lib.optionalString stdenv.hostPlatform.isDarwin ''
ulimit -n 8192
'';
subPackages = [ "." ];
postInstall = ''
mkdir -p $out/share/
cp -r $src/static/templates/ $out/share/
cp -r $src/static/css/ $out/share/
'';
passthru.tests = {
smoke-test = nixosTests.blockbook-frontend;
};
meta = with lib; {
description = "Trezor address/account balance backend";
homepage = "https://github.com/trezor/blockbook";
license = licenses.agpl3Only;
maintainers = with maintainers; [ mmahut _1000101 ];
platforms = platforms.unix;
mainProgram = "blockbook";
};
}