5pkgs: init vendored jesec-rtorrent

This commit is contained in:
makefu 2025-01-30 21:53:49 +01:00
parent 40e6fd0418
commit 478938fe0b
No known key found for this signature in database
GPG key ID: 36F7711F3FC0F225
3 changed files with 127 additions and 0 deletions

View file

@ -47,6 +47,7 @@ in {
liveproxy = prev.pkgs.python3Packages.callPackage ./custom/liveproxy {};
mediawiki-matrix-bot = prev.pkgs.python3Packages.callPackage ./custom/mediawiki-matrix-bot {};
hydra-check = prev.pkgs.python3Packages.callPackage ./custom/hydra-check {};
jesec-rtorrent = prev.pkgs.callPackage ./jesec-rtorrent {};
pwqgen-ger = prev.pkgs.passwdqc-utils.override {
wordset-file = prev.pkgs.fetchurl {
urls = [

View file

@ -0,0 +1,77 @@
{
lib,
callPackage,
stdenv,
fetchFromGitHub,
cmake,
curl,
gtest,
ncurses,
jsonRpcSupport ? true,
nlohmann_json,
xmlRpcSupport ? true,
xmlrpc_c,
}:
let
libtorrent = callPackage ./libtorrent.nix {};
in
stdenv.mkDerivation rec {
pname = "jesec-rtorrent";
version = "0.9.8-r16-unstable-2023-07-21";
src = fetchFromGitHub {
owner = "jesec";
repo = "rtorrent";
rev = "199e8f85244c8eb1c30163d51755570ad86139bb";
hash = "sha256-AWWOvvUNNOIbNiwY/uz55iKt8A0YuMsyWGjaLgKUOCY=";
};
passthru = {
inherit libtorrent;
};
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;
nativeCheckInputs = [
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 = "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 ];
platforms = platforms.linux;
mainProgram = "rtorrent";
};
}

View file

@ -0,0 +1,49 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
gtest,
openssl,
zlib,
}:
stdenv.mkDerivation rec {
pname = "jesec-libtorrent";
version = "0.13.8-r4-unstable-2023-07-04";
src = fetchFromGitHub {
owner = "jesec";
repo = "libtorrent";
rev = "35d844d4d78a671f8840fe6ae973ebb39a0e8f34";
hash = "sha256-H2oUW9iC2pIUSmP9j0U4RfzO1uiIEWVmeZAfF3Ca48k=";
};
nativeBuildInputs = [
cmake
];
buildInputs = [
openssl
zlib
];
# Disabled because a test is flaky; see https://github.com/jesec/libtorrent/issues/4.
# doCheck = true;
preCheck = ''
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$PWD
'';
nativeCheckInputs = [
gtest
];
meta = with lib; {
homepage = "https://github.com/jesec/libtorrent";
description = "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 ];
platforms = platforms.linux;
};
}