about summary refs log tree commit diff
path: root/pkgs/applications/networking/p2p/jesec-rtorrent
diff options
context:
space:
mode:
authorWinter <winter@winter.cafe>2022-04-21 19:26:44 -0400
committerWinter <winter@winter.cafe>2022-04-21 19:26:44 -0400
commit69e661230508bf2c4b7b8dbb0518de6c951986ce (patch)
tree06684fc5db88ed531feaa5107bed00fb18e902c7 /pkgs/applications/networking/p2p/jesec-rtorrent
parent659b91df0a8115c767b74b2667c2218e279c1c62 (diff)
{jesec-,}rtorrent: don't use package sets
Diffstat (limited to 'pkgs/applications/networking/p2p/jesec-rtorrent')
-rw-r--r--pkgs/applications/networking/p2p/jesec-rtorrent/default.nix65
-rw-r--r--pkgs/applications/networking/p2p/jesec-rtorrent/libtorrent.nix44
2 files changed, 109 insertions, 0 deletions
diff --git a/pkgs/applications/networking/p2p/jesec-rtorrent/default.nix b/pkgs/applications/networking/p2p/jesec-rtorrent/default.nix
new file mode 100644
index 0000000000000..7fe444228d374
--- /dev/null
+++ b/pkgs/applications/networking/p2p/jesec-rtorrent/default.nix
@@ -0,0 +1,65 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+, curl
+, gtest
+, libtorrent
+, ncurses
+, jsonRpcSupport ? true, nlohmann_json
+, xmlRpcSupport ? true, xmlrpc_c
+}:
+
+stdenv.mkDerivation rec {
+  pname = "jesec-rtorrent";
+  version = "0.9.8-r15";
+
+  src = fetchFromGitHub {
+    owner = "jesec";
+    repo = "rtorrent";
+    rev = "v${version}";
+    hash = "sha256-yYOw8wsiQd478JijLgPtEWsw2/ewd46re+t9D705rmk=";
+  };
+
+  nativeBuildInputs = [
+    cmake
+  ];
+
+  buildInputs = [
+    curl
+    libtorrent
+    ncurses
+  ]
+  ++ lib.optional jsonRpcSupport nlohmann_json
+  ++ lib.optional xmlRpcSupport xmlrpc_c;
+
+  cmakeFlags = [
+    "-DUSE_RUNTIME_CA_DETECTION=NO"
+  ]
+  ++ lib.optional (!jsonRpcSupport) "-DUSE_JSONRPC=NO"
+  ++ lib.optional (!xmlRpcSupport) "-DUSE_XMLRPC=NO";
+
+
+  doCheck = true;
+  checkInputs = [
+    gtest
+  ];
+
+  prePatch = ''
+    substituteInPlace src/main.cc \
+      --replace "/etc/rtorrent/rtorrent.rc" "${placeholder "out"}/etc/rtorrent/rtorrent.rc"
+  '';
+
+  postFixup = ''
+    mkdir -p $out/etc/rtorrent
+    cp $src/doc/rtorrent.rc $out/etc/rtorrent/rtorrent.rc
+  '';
+
+  meta = with lib; {
+    description = "An ncurses client for libtorrent, ideal for use with screen, tmux, or dtach (jesec's fork)";
+    homepage = "https://github.com/jesec/rtorrent";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ winter AndersonTorres ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/applications/networking/p2p/jesec-rtorrent/libtorrent.nix b/pkgs/applications/networking/p2p/jesec-rtorrent/libtorrent.nix
new file mode 100644
index 0000000000000..d46e4a159399a
--- /dev/null
+++ b/pkgs/applications/networking/p2p/jesec-rtorrent/libtorrent.nix
@@ -0,0 +1,44 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+, gtest
+, openssl
+, zlib
+}:
+
+stdenv.mkDerivation rec {
+  pname = "jesec-libtorrent";
+  version = "0.13.8-r3";
+
+  src = fetchFromGitHub {
+    owner = "jesec";
+    repo = "libtorrent";
+    rev = "v${version}";
+    hash = "sha256-S3DOKzXkvU+ZJxfrxwLXCVBnepzmiZ+3iiQqz084BEk=";
+  };
+
+  nativeBuildInputs = [
+    cmake
+  ];
+  buildInputs = [
+    openssl
+    zlib
+  ];
+
+  doCheck = true;
+  preCheck = ''
+    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$PWD
+  '';
+  checkInputs = [
+    gtest
+  ];
+
+  meta = with lib; {
+    homepage = "https://github.com/jesec/libtorrent";
+    description = "A BitTorrent library written in C++ for *nix, with focus on high performance and good code (jesec's fork)";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ winter AndersonTorres ];
+    platforms = platforms.linux;
+  };
+}