9833d56c24
Done with the help of https://github.com/Mindavi/nixpkgs-mark-broken Tool is still WIP but this is one of the first results. I manually audited the results and removed some results that were not valid. Note that some of these packages maybe should have more constrained platforms set instead of broken set, but I think not being perfectly correct is better than just keep trying to build all these things and never succeeding. Some observations: - Some darwin builds require XCode tools - aarch64-linux builds sometimes suffer from using gcc9 - gcc9 is getting older and misses some new libraries/features - Sometimes tools try to do system detection or expect some explicit settings for platforms that are not x86_64-linux
90 lines
2.2 KiB
Nix
90 lines
2.2 KiB
Nix
# largely inspired from https://github.com/saber-hq/saber-overlay/blob/master/packages/solana/solana.nix
|
|
|
|
{ stdenv
|
|
, fetchFromGitHub
|
|
, lib
|
|
, rustPlatform
|
|
, IOKit
|
|
, Security
|
|
, AppKit
|
|
, pkg-config
|
|
, udev
|
|
, zlib
|
|
, protobuf
|
|
, clang
|
|
, llvm
|
|
, openssl
|
|
, libclang
|
|
, rustfmt
|
|
, perl
|
|
, hidapi
|
|
, solanaPkgs ? [
|
|
"solana"
|
|
"solana-bench-tps"
|
|
"solana-faucet"
|
|
"solana-gossip"
|
|
"solana-install"
|
|
"solana-keygen"
|
|
"solana-ledger-tool"
|
|
"solana-log-analyzer"
|
|
"solana-net-shaper"
|
|
"solana-sys-tuner"
|
|
"solana-validator"
|
|
"cargo-build-bpf"
|
|
"cargo-test-bpf"
|
|
"solana-dos"
|
|
"solana-install-init"
|
|
"solana-stake-accounts"
|
|
"solana-test-validator"
|
|
"solana-tokens"
|
|
"solana-watchtower"
|
|
] ++ [
|
|
# XXX: Ensure `solana-genesis` is built LAST!
|
|
# See https://github.com/solana-labs/solana/issues/5826
|
|
"solana-genesis"
|
|
]
|
|
}:
|
|
let
|
|
pinData = lib.importJSON ./pin.json;
|
|
version = pinData.version;
|
|
sha256 = pinData.sha256;
|
|
cargoSha256 = pinData.cargoSha256;
|
|
in
|
|
rustPlatform.buildRustPackage rec {
|
|
pname = "solana-validator";
|
|
inherit version;
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "solana-labs";
|
|
repo = "solana";
|
|
rev = "v${version}";
|
|
inherit sha256;
|
|
};
|
|
|
|
# partly inspired by https://github.com/obsidiansystems/solana-bridges/blob/develop/default.nix#L29
|
|
inherit cargoSha256;
|
|
verifyCargoDeps = true;
|
|
|
|
cargoBuildFlags = builtins.map (n: "--bin=${n}") solanaPkgs;
|
|
|
|
# weird errors. see https://github.com/NixOS/nixpkgs/issues/52447#issuecomment-852079285
|
|
# LLVM_CONFIG_PATH = "${llvm}/bin/llvm-config";
|
|
|
|
nativeBuildInputs = [ pkg-config protobuf rustfmt perl rustPlatform.bindgenHook ];
|
|
buildInputs =
|
|
[ openssl zlib libclang hidapi ] ++ (lib.optionals stdenv.isLinux [ udev ]);
|
|
strictDeps = true;
|
|
|
|
doCheck = false;
|
|
|
|
meta = with lib; {
|
|
description = "Web-Scale Blockchain for fast, secure, scalable, decentralized apps and marketplaces. ";
|
|
homepage = "https://solana.com";
|
|
license = licenses.asl20;
|
|
maintainers = with maintainers; [ adjacentresearch ];
|
|
platforms = platforms.unix;
|
|
# never built on aarch64-darwin, x86_64-darwin since first introduction in nixpkgs
|
|
broken = stdenv.isDarwin;
|
|
};
|
|
passthru.updateScript = ./update.sh;
|
|
}
|