summary refs log tree commit diff
path: root/pkgs/tools/misc/torrenttools
diff options
context:
space:
mode:
authorAzat Bahawi <azat@bahawi.net>2022-11-08 00:06:49 +0300
committerAzat Bahawi <azat@bahawi.net>2022-11-08 00:06:49 +0300
commit5d3c45798e0c5e0e2724518b4c4b29bde142d4ba (patch)
tree82ff2fd958f60dded81f61cf9e4e7ca821dbe906 /pkgs/tools/misc/torrenttools
parentfc9eb9627875ee6f523a88d93b130a253d416455 (diff)
downloadnixpkgs-5d3c45798e0c5e0e2724518b4c4b29bde142d4ba.tar
nixpkgs-5d3c45798e0c5e0e2724518b4c4b29bde142d4ba.tar.gz
nixpkgs-5d3c45798e0c5e0e2724518b4c4b29bde142d4ba.tar.bz2
nixpkgs-5d3c45798e0c5e0e2724518b4c4b29bde142d4ba.tar.lz
nixpkgs-5d3c45798e0c5e0e2724518b4c4b29bde142d4ba.tar.xz
nixpkgs-5d3c45798e0c5e0e2724518b4c4b29bde142d4ba.tar.zst
nixpkgs-5d3c45798e0c5e0e2724518b4c4b29bde142d4ba.zip
torrenttools: init at 0.6.2
Diffstat (limited to 'pkgs/tools/misc/torrenttools')
-rw-r--r--pkgs/tools/misc/torrenttools/default.nix99
1 files changed, 99 insertions, 0 deletions
diff --git a/pkgs/tools/misc/torrenttools/default.nix b/pkgs/tools/misc/torrenttools/default.nix
new file mode 100644
index 00000000000..8e9bbba4461
--- /dev/null
+++ b/pkgs/tools/misc/torrenttools/default.nix
@@ -0,0 +1,99 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, bencode
+, catch2
+, cli11
+, cmake
+, ctre
+, expected-lite
+, fmt
+, gsl-lite
+, howard-hinnant-date
+, libyamlcpp
+, ninja
+, nlohmann_json
+, openssl
+, re2
+, sigslot
+}:
+
+stdenv.mkDerivation rec {
+  pname = "torrenttools";
+  version = "0.6.2";
+
+  srcs = [
+    (fetchFromGitHub rec {
+      owner = "fbdtemme";
+      repo = "torrenttools";
+      rev = "v${version}";
+      hash = "sha256-3rAxw4JM5ruOn0ccKnpdCnUWUPTQOUvRYz8OKU/FpJ8=";
+      name = repo;
+    })
+    (fetchFromGitHub rec {
+      owner = "fbdtemme";
+      repo = "cliprogress";
+      rev = "a887519e360e44c1ef88ea4ef7df652ea049c502";
+      hash = "sha256-nVvzez5GB57qSj2SLaxdYlkSX8rRM06H2NnLQGCDWMg=";
+      name = repo;
+    })
+    (fetchFromGitHub rec {
+      owner = "fbdtemme";
+      repo = "dottorrent";
+      rev = "38ac810d6bb3628fd3ce49150c9fb641bb5e78cd";
+      hash = "sha256-0H9h0Hud0Fd64lY0pxQ96coDOEDr5wh8v1sNT1lBxb0=";
+      name = repo;
+    })
+    (fetchFromGitHub rec {
+      owner = "fbdtemme";
+      repo = "termcontrol";
+      rev = "c53eec4efe0e163871d9eb54dc074c25cd01abf0";
+      hash = "sha256-0j78QtEkhlssVivPl709o5Pf36TzhOZ6VHaqDiH0L0I=";
+      name = repo;
+    })
+  ];
+  sourceRoot = "torrenttools";
+
+  postUnpack = ''
+    cp -pr cliprogress torrenttools/external/cliprogress
+    cp -pr dottorrent torrenttools/external/dottorrent
+    cp -pr termcontrol torrenttools/external/termcontrol
+    chmod -R u+w -- "$sourceRoot"
+  '';
+
+  nativeBuildInputs = [
+    cmake
+    ninja
+  ];
+
+  buildInputs = [
+    bencode
+    catch2
+    cli11
+    ctre
+    expected-lite
+    fmt
+    gsl-lite
+    howard-hinnant-date
+    libyamlcpp
+    nlohmann_json
+    openssl
+    re2
+    sigslot
+  ];
+
+  cmakeFlags = [
+    "-DTORRENTTOOLS_BUILD_TESTS:BOOL=ON"
+    "-DTORRENTTOOLS_TBB:BOOL=OFF" # Our TBB doesn't expose a CMake module.
+  ];
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "A CLI tool for creating, inspecting and modifying BitTorrent metafiles";
+    homepage = "https://github.com/fbdtemme/torrenttools";
+    license = licenses.mit;
+    maintainers = with maintainers; [ azahi ];
+    platforms = platforms.unix;
+  };
+}