nixpkgs/pkgs/tools/networking/p2p/jesec-rtorrent/rtorrent.nix

66 lines
1.4 KiB
Nix
Raw Normal View History

2021-05-07 00:57:02 +02:00
{ lib
, stdenv
, fetchFromGitHub
, cmake
, curl
2021-05-07 00:57:02 +02:00
, gtest
, libtorrent
2021-05-07 00:57:02 +02:00
, ncurses
, jsonRpcSupport ? true, nlohmann_json
, xmlRpcSupport ? true, xmlrpc_c
2021-05-07 00:57:02 +02:00
}:
2021-05-07 00:57:02 +02:00
stdenv.mkDerivation rec {
pname = "jesec-rtorrent";
version = "0.9.8-r15";
2021-05-07 00:57:02 +02:00
src = fetchFromGitHub {
owner = "jesec";
repo = "rtorrent";
rev = "v${version}";
hash = "sha256-yYOw8wsiQd478JijLgPtEWsw2/ewd46re+t9D705rmk=";
2021-05-07 00:57:02 +02:00
};
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";
2021-05-07 00:57:02 +02:00
doCheck = true;
checkInputs = [
gtest
];
2021-05-07 00:57:02 +02:00
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;
2021-11-29 02:06:53 +01:00
maintainers = with maintainers; [ winter AndersonTorres ];
2021-05-07 00:57:02 +02:00
platforms = platforms.linux;
};
}