nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 rustPlatform,
5 fetchFromGitHub,
6 openssl,
7 libiconv,
8 udev,
9 pkg-config,
10 protobuf,
11 buildPackages,
12}:
13
14rustPlatform.buildRustPackage rec {
15 pname = "quill";
16 version = "0.5.3";
17
18 src = fetchFromGitHub {
19 owner = "dfinity";
20 repo = "quill";
21 rev = "v${version}";
22 hash = "sha256-lCDKM9zzGcey4oWp6imiHvGSNRor0xhlmlhRkSXFLlU=";
23 };
24
25 ic = fetchFromGitHub {
26 owner = "dfinity";
27 repo = "ic";
28 rev = "2f9ae6bf5eafed03599fd29475100aca9f78ae81";
29 hash = "sha256-QWJFsWZ9miWN4ql4xFXMQM1Y71nzgGCL57yAa0j7ch4=";
30 };
31
32 registry = "file://local-registry";
33
34 preBuild = ''
35 export REGISTRY_TRANSPORT_PROTO_INCLUDES=${ic}/rs/registry/transport/proto
36 export IC_BASE_TYPES_PROTO_INCLUDES=${ic}/rs/types/base_types/proto
37 export IC_PROTOBUF_PROTO_INCLUDES=${ic}/rs/protobuf/def
38 export IC_NNS_COMMON_PROTO_INCLUDES=${ic}/rs/nns/common/proto
39 export IC_ICRC1_ARCHIVE_WASM_PATH=${ic}/rs/rosetta-api/icrc1/wasm/ic-icrc1-archive.wasm.gz
40 export LEDGER_ARCHIVE_NODE_CANISTER_WASM_PATH=${ic}/rs/rosetta-api/icp_ledger/wasm/ledger-archive-node-canister.wasm
41 cp ${ic}/rs/rosetta-api/icp_ledger/ledger.did /build/quill-${version}-vendor/ledger.did
42 export PROTOC=${buildPackages.protobuf}/bin/protoc
43 export OPENSSL_DIR=${openssl.dev}
44 export OPENSSL_LIB_DIR=${lib.getLib openssl}/lib
45 '';
46
47 cargoHash = "sha256-rpsbQYA6RBYSo2g+YhYG02CYlboRQvIwMqPAybayCOs=";
48
49 nativeBuildInputs = [
50 pkg-config
51 protobuf
52 ];
53 buildInputs = [
54 openssl
55 udev
56 ]
57 ++ lib.optionals stdenv.hostPlatform.isDarwin [
58 libiconv
59 ];
60
61 meta = {
62 homepage = "https://github.com/dfinity/quill";
63 changelog = "https://github.com/dfinity/quill/releases/tag/v${version}";
64 description = "Minimalistic ledger and governance toolkit for cold wallets on the Internet Computer";
65 mainProgram = "quill";
66 license = lib.licenses.asl20;
67 maintainers = with lib.maintainers; [ imalison ];
68 };
69}