2022-03-16 19:08:48 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
2022-05-25 22:52:40 +00:00
|
|
|
, libxcb
|
2022-12-21 22:40:23 +00:00
|
|
|
, installShellFiles
|
2022-05-25 22:52:40 +00:00
|
|
|
, Security
|
|
|
|
, AppKit
|
2022-03-16 19:08:48 +00:00
|
|
|
}:
|
|
|
|
rustPlatform.buildRustPackage rec {
|
2022-04-30 00:29:54 +00:00
|
|
|
pname = "magic-wormhole-rs";
|
2022-12-21 22:40:23 +00:00
|
|
|
version = "0.6.0";
|
2022-03-16 19:08:48 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "magic-wormhole";
|
|
|
|
repo = "magic-wormhole.rs";
|
|
|
|
rev = version;
|
2022-12-21 22:40:23 +00:00
|
|
|
sha256 = "sha256-gNHtlbYWQvgboIG++N1680a4ql66PTF45DJGz521zzk=";
|
2022-03-16 19:08:48 +00:00
|
|
|
};
|
|
|
|
|
2022-12-21 22:40:23 +00:00
|
|
|
cargoSha256 = "sha256-powJrbVVBWtIg0CV7ZdhaVIQA+VhEPtPCts7f8Sl1VY=";
|
2022-05-25 22:52:40 +00:00
|
|
|
|
|
|
|
buildInputs = [ libxcb ]
|
|
|
|
++ lib.optionals stdenv.isDarwin [ Security AppKit ];
|
2022-03-16 19:08:48 +00:00
|
|
|
|
2022-12-21 22:40:23 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2022-03-16 19:08:48 +00:00
|
|
|
# all tests involve networking and are bound fail
|
|
|
|
doCheck = false;
|
|
|
|
|
2022-12-21 22:40:23 +00:00
|
|
|
postInstall = ''
|
|
|
|
installShellCompletion --cmd wormhole-rs \
|
|
|
|
--bash <($out/bin/wormhole-rs completion bash) \
|
|
|
|
--fish <($out/bin/wormhole-rs completion fish) \
|
|
|
|
--zsh <($out/bin/wormhole-rs completion zsh)
|
|
|
|
'';
|
|
|
|
|
2022-03-16 19:08:48 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Rust implementation of Magic Wormhole, with new features and enhancements";
|
|
|
|
homepage = "https://github.com/magic-wormhole/magic-wormhole.rs";
|
2022-05-25 22:52:40 +00:00
|
|
|
changelog = "https://github.com/magic-wormhole/magic-wormhole.rs/raw/${version}/changelog.md";
|
2022-03-16 19:08:48 +00:00
|
|
|
license = licenses.eupl12;
|
|
|
|
maintainers = with maintainers; [ zeri piegames ];
|
2022-05-25 22:52:40 +00:00
|
|
|
mainProgram = "wormhole-rs";
|
2022-03-16 19:08:48 +00:00
|
|
|
};
|
|
|
|
}
|