nixpkgs-suyu/pkgs/applications/blockchains/electrs/default.nix
2021-10-19 01:36:08 +02:00

39 lines
942 B
Nix

{ lib
, stdenv
, rustPlatform
, fetchFromGitHub
, llvmPackages
, rocksdb
, Security
}:
rustPlatform.buildRustPackage rec {
pname = "electrs";
version = "0.9.0";
src = fetchFromGitHub {
owner = "romanz";
repo = pname;
rev = "v${version}";
hash = "sha256-HrnHbjHyhhyEKadkGWH0WlgovJs77WGZ65R+Z4VduBE=";
};
cargoHash = "sha256-gOvfhlm6O4SjMhjMWzgEOjdk7Kx9J/zQUnlaRYXBiEI=";
# needed for librocksdb-sys
nativeBuildInputs = [ llvmPackages.clang ];
LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib";
# link rocksdb dynamically
ROCKSDB_INCLUDE_DIR = "${rocksdb}/include";
ROCKSDB_LIB_DIR = "${rocksdb}/lib";
buildInputs = lib.optionals stdenv.isDarwin [ Security ];
meta = with lib; {
description = "An efficient re-implementation of Electrum Server in Rust";
homepage = "https://github.com/romanz/electrs";
license = licenses.mit;
maintainers = with maintainers; [ prusnak ];
};
}