1{
2 lib,
3 rustPlatform,
4 fetchFromGitHub,
5 stdenv,
6 installShellFiles,
7}:
8
9rustPlatform.buildRustPackage rec {
10 pname = "fclones";
11 version = "0.35.0";
12
13 src = fetchFromGitHub {
14 owner = "pkolaczk";
15 repo = pname;
16 rev = "v${version}";
17 hash = "sha256-OCRfJh6vfAkL86J1GuLgfs57from3fx0NS1Bh1+/oXE=";
18 };
19
20 cargoHash = "sha256-aEjsBhm0iPysA1Wz1Ea7rtX0g/yH/rklUkYV/Elxcq8=";
21
22 nativeBuildInputs = [ installShellFiles ];
23
24 # device::test_physical_device_name test fails on Darwin
25 doCheck = !stdenv.hostPlatform.isDarwin;
26
27 checkFlags = [
28 # ofborg sometimes fails with "Resource temporarily unavailable"
29 "--skip=cache::test::return_none_if_different_transform_was_used"
30 ];
31
32 postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
33 # setting PATH required so completion script doesn't use full path
34 export PATH="$PATH:$out/bin"
35 installShellCompletion --cmd $pname \
36 --bash <(fclones complete bash) \
37 --fish <(fclones complete fish) \
38 --zsh <(fclones complete zsh)
39 '';
40
41 meta = with lib; {
42 description = "Efficient Duplicate File Finder and Remover";
43 homepage = "https://github.com/pkolaczk/fclones";
44 changelog = "https://github.com/pkolaczk/fclones/releases/tag/${src.rev}";
45 license = licenses.mit;
46 maintainers = with maintainers; [
47 cyounkins
48 figsoda
49 ];
50 mainProgram = "fclones";
51 };
52}