···5 rustPlatform,
6 udev,
7 protobuf,
8- rocksdb_8_3,
9 installShellFiles,
10 pkg-config,
11 openssl,
12 nix-update-script,
13 versionCheckHook,
00014 # Taken from https://github.com/solana-labs/solana/blob/master/scripts/cargo-install-all.sh#L84
15 solanaPkgs ? [
16- "cargo-build-bpf"
17- "cargo-test-bpf"
18 "cargo-build-sbf"
19 "cargo-test-sbf"
20 "solana"
21 "solana-bench-tps"
22 "solana-faucet"
23 "solana-gossip"
24- "solana-install"
25 "solana-keygen"
26- "solana-ledger-tool"
27 "solana-log-analyzer"
28 "solana-net-shaper"
29- "solana-validator"
30 "solana-test-validator"
31 ]
32 ++ [
···36 ],
37}:
38let
39- version = "1.18.26";
40- hash = "sha256-sJ0Zn5GMi64/S8zqomL/dYRVW8SOQWsP+bpcdatJC0A=";
41- rocksdb = rocksdb_8_3;
42in
43rustPlatform.buildRustPackage rec {
44 pname = "solana-cli";
45 inherit version;
4647 src = fetchFromGitHub {
48- owner = "solana-labs";
49- repo = "solana";
50 tag = "v${version}";
51 inherit hash;
52 };
5354- # The `crossbeam-epoch@0.9.5` crate used by the solana crates is their own fork,
55- # which exists due to performance-related reasons.
56- # The `solana-cli` build fails because this forked `crossbeam-epoch` crate contains a
57- # symlink that points outside of the crate into the root of the repository.
58- # This characteristic already existed in upstream `crossbeam-epoch@0.9.5`.
59- #
60- # As `buildRustPackage` vendors the dependencies of the `solana-cli` during the `buildPhase`,
61- # which occurs after the `patchPhase`, this `crossbeam-epoch` is not patchable in this build.
62- # The remaining solution is to make use of `cargoPatches` to remove the fork and bump to `crossbeam-epoch@0.9.16`,
63- # which is the first version that removed the `build.rs`.
64- cargoPatches = [ ./crossbeam-epoch.patch ];
65-66- cargoHash = "sha256-adzcLrOiUUYhz57gme/hEmD4E3kVcKCp0/jSoavZfjw=";
6768 strictDeps = true;
69 cargoBuildFlags = builtins.map (n: "--bin=${n}") solanaPkgs;
007071 # Even tho the tests work, a shit ton of them try to connect to a local RPC
72 # or access internet in other ways, eventually failing due to Nix sandbox.
···82 ];
83 buildInputs = [
84 openssl
0085 rustPlatform.bindgenHook
86 ]
87 ++ lib.optionals stdenv.hostPlatform.isLinux [ udev ];
···97 --bash <($out/bin/solana completion --shell bash) \
98 --fish <($out/bin/solana completion --shell fish)
99100- mkdir -p $out/bin/sdk/bpf
101- cp -a ./sdk/bpf/* $out/bin/sdk/bpf/
102- mkdir -p $out/bin/sdk/sbf
103- cp -a ./sdk/sbf/* $out/bin/sdk/sbf
104 mkdir -p $out/bin/deps
105 find . -name libsolana_program.dylib -exec cp {} $out/bin/deps \;
106 find . -name libsolana_program.rlib -exec cp {} $out/bin/deps \;
···126 netfox
127 happysalada
128 aikooo7
0129 ];
130 platforms = platforms.unix;
131 };