From 07e7d46e0c7ea23ad30ed7b55b040886dee94852 Mon Sep 17 00:00:00 2001 From: AndersonTorres Date: Thu, 21 Oct 2021 15:55:10 -0300 Subject: [PATCH] jesec-rtorrent: create subtree RTorrent uses a companion library, libtorrent, and they should be synchronized along the releases. They act like a small package set. Therefore it is a good idea to treat them the same way in Nixpkgs code. This commit should not change much of the things, because no code besides rtorrent uses libtorrent. (Yes, this the same message from rakshasa-rtorrent commit.) --- pkgs/tools/networking/p2p/jesec-rtorrent/default.nix | 9 +++++++++ .../default.nix => jesec-rtorrent/libtorrent.nix} | 2 +- .../default.nix => jesec-rtorrent/rtorrent.nix} | 6 +++--- pkgs/top-level/all-packages.nix | 10 +++++++--- 4 files changed, 20 insertions(+), 7 deletions(-) create mode 100644 pkgs/tools/networking/p2p/jesec-rtorrent/default.nix rename pkgs/tools/networking/p2p/{libtorrent-jesec/default.nix => jesec-rtorrent/libtorrent.nix} (97%) rename pkgs/tools/networking/p2p/{rtorrent-jesec/default.nix => jesec-rtorrent/rtorrent.nix} (93%) diff --git a/pkgs/tools/networking/p2p/jesec-rtorrent/default.nix b/pkgs/tools/networking/p2p/jesec-rtorrent/default.nix new file mode 100644 index 000000000000..56fec5333fc7 --- /dev/null +++ b/pkgs/tools/networking/p2p/jesec-rtorrent/default.nix @@ -0,0 +1,9 @@ +{ lib +, pkgs +, callPackage +}: + +rec { + libtorrent = callPackage ./libtorrent.nix { }; + rtorrent = callPackage ./rtorrent.nix { }; +} diff --git a/pkgs/tools/networking/p2p/libtorrent-jesec/default.nix b/pkgs/tools/networking/p2p/jesec-rtorrent/libtorrent.nix similarity index 97% rename from pkgs/tools/networking/p2p/libtorrent-jesec/default.nix rename to pkgs/tools/networking/p2p/jesec-rtorrent/libtorrent.nix index 0fd16f4799d6..15fa7616e9ba 100644 --- a/pkgs/tools/networking/p2p/libtorrent-jesec/default.nix +++ b/pkgs/tools/networking/p2p/jesec-rtorrent/libtorrent.nix @@ -1,7 +1,7 @@ { lib, stdenv, fetchFromGitHub, fetchpatch, cmake, gtest, openssl, zlib }: stdenv.mkDerivation rec { - pname = "libtorrent-jesec"; + pname = "jesec-libtorrent"; version = "0.13.8-r2"; src = fetchFromGitHub { diff --git a/pkgs/tools/networking/p2p/rtorrent-jesec/default.nix b/pkgs/tools/networking/p2p/jesec-rtorrent/rtorrent.nix similarity index 93% rename from pkgs/tools/networking/p2p/rtorrent-jesec/default.nix rename to pkgs/tools/networking/p2p/jesec-rtorrent/rtorrent.nix index eeff6e91399d..26eb390440d2 100644 --- a/pkgs/tools/networking/p2p/rtorrent-jesec/default.nix +++ b/pkgs/tools/networking/p2p/jesec-rtorrent/rtorrent.nix @@ -3,7 +3,7 @@ , fetchFromGitHub , cmake , gtest -, libtorrent-jesec +, libtorrent , curl , ncurses , xmlrpc_c @@ -15,7 +15,7 @@ let inherit (lib) optional; in stdenv.mkDerivation rec { - pname = "rtorrent-jesec"; + pname = "jesec-rtorrent"; version = "0.9.8-r14"; src = fetchFromGitHub { @@ -26,7 +26,7 @@ stdenv.mkDerivation rec { }; nativeBuildInputs = [ cmake ]; - buildInputs = [ libtorrent-jesec curl ncurses ] + buildInputs = [ libtorrent curl ncurses ] ++ optional xmlRpcSupport xmlrpc_c ++ optional jsonRpcSupport nlohmann_json; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 6d309850045f..e335275eda10 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7166,7 +7166,13 @@ with pkgs; libtorrent = callPackage ../tools/networking/p2p/libtorrent { }; - libtorrent-jesec = callPackage ../tools/networking/p2p/libtorrent-jesec { }; + jesec-rtorrent = recurseIntoAttrs + (callPackage ../tools/networking/p2p/jesec-rtorrent { + callPackage = newScope pkgs.jesec-rtorrent; + }); + + rtorrent-jesec = jesec-rtorrent.rtorrent; + libtorrent-jesec = jesec-rtorrent.libtorrent; libmpack = callPackage ../development/libraries/libmpack { }; @@ -9004,8 +9010,6 @@ with pkgs; rtorrent = callPackage ../tools/networking/p2p/rtorrent { }; - rtorrent-jesec = callPackage ../tools/networking/p2p/rtorrent-jesec { }; - rubber = callPackage ../tools/typesetting/rubber { }; rubocop = rubyPackages.rubocop;