lol
1{ lib
2, stdenv
3, fetchFromGitHub
4, bencode
5, catch2
6, cli11
7, cmake
8, ctre
9, expected-lite
10, fmt
11, gsl-lite
12, howard-hinnant-date
13, libyamlcpp
14, ninja
15, nlohmann_json
16, openssl
17, re2
18, sigslot
19}:
20
21stdenv.mkDerivation rec {
22 pname = "torrenttools";
23 version = "0.6.2";
24
25 srcs = [
26 (fetchFromGitHub rec {
27 owner = "fbdtemme";
28 repo = "torrenttools";
29 rev = "v${version}";
30 hash = "sha256-3rAxw4JM5ruOn0ccKnpdCnUWUPTQOUvRYz8OKU/FpJ8=";
31 name = repo;
32 })
33 (fetchFromGitHub rec {
34 owner = "fbdtemme";
35 repo = "cliprogress";
36 rev = "a887519e360e44c1ef88ea4ef7df652ea049c502";
37 hash = "sha256-nVvzez5GB57qSj2SLaxdYlkSX8rRM06H2NnLQGCDWMg=";
38 name = repo;
39 })
40 (fetchFromGitHub rec {
41 owner = "fbdtemme";
42 repo = "dottorrent";
43 rev = "38ac810d6bb3628fd3ce49150c9fb641bb5e78cd";
44 hash = "sha256-0H9h0Hud0Fd64lY0pxQ96coDOEDr5wh8v1sNT1lBxb0=";
45 name = repo;
46 })
47 (fetchFromGitHub rec {
48 owner = "fbdtemme";
49 repo = "termcontrol";
50 rev = "c53eec4efe0e163871d9eb54dc074c25cd01abf0";
51 hash = "sha256-0j78QtEkhlssVivPl709o5Pf36TzhOZ6VHaqDiH0L0I=";
52 name = repo;
53 })
54 ];
55 sourceRoot = "torrenttools";
56
57 postUnpack = ''
58 cp -pr cliprogress torrenttools/external/cliprogress
59 cp -pr dottorrent torrenttools/external/dottorrent
60 cp -pr termcontrol torrenttools/external/termcontrol
61 chmod -R u+w -- "$sourceRoot"
62 '';
63
64 nativeBuildInputs = [
65 cmake
66 ninja
67 ];
68
69 buildInputs = [
70 bencode
71 catch2
72 cli11
73 ctre
74 expected-lite
75 fmt
76 gsl-lite
77 howard-hinnant-date
78 libyamlcpp
79 nlohmann_json
80 openssl
81 re2
82 sigslot
83 ];
84
85 cmakeFlags = [
86 "-DTORRENTTOOLS_BUILD_TESTS:BOOL=ON"
87 "-DTORRENTTOOLS_TBB:BOOL=OFF" # Our TBB doesn't expose a CMake module.
88 ];
89
90 doCheck = true;
91
92 meta = with lib; {
93 description = "A CLI tool for creating, inspecting and modifying BitTorrent metafiles";
94 homepage = "https://github.com/fbdtemme/torrenttools";
95 license = licenses.mit;
96 maintainers = with maintainers; [ azahi ];
97 platforms = platforms.unix;
98 };
99}