2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv
|
2023-08-22 20:05:09 +00:00
|
|
|
, coreutils
|
2020-09-25 04:45:31 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, python3
|
2024-01-13 08:15:51 +00:00
|
|
|
, par2cmdline-turbo
|
2020-09-25 04:45:31 +00:00
|
|
|
, unzip
|
|
|
|
, unrar
|
|
|
|
, p7zip
|
2023-08-22 20:05:09 +00:00
|
|
|
, util-linux
|
2020-09-25 04:45:31 +00:00
|
|
|
, makeWrapper
|
2021-12-19 01:06:50 +00:00
|
|
|
, nixosTests
|
2020-09-25 04:45:31 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
2022-06-16 17:23:12 +00:00
|
|
|
pythonEnv = python3.withPackages(ps: with ps; [
|
2023-08-22 20:05:09 +00:00
|
|
|
babelfish
|
|
|
|
cffi
|
2020-09-25 04:45:31 +00:00
|
|
|
chardet
|
|
|
|
cheetah3
|
2023-08-22 20:05:09 +00:00
|
|
|
cheroot
|
2020-09-25 04:45:31 +00:00
|
|
|
cherrypy
|
|
|
|
configobj
|
2023-08-22 20:05:09 +00:00
|
|
|
cryptography
|
2020-09-25 04:45:31 +00:00
|
|
|
feedparser
|
2021-12-19 01:06:50 +00:00
|
|
|
guessit
|
2023-08-22 20:05:09 +00:00
|
|
|
jaraco-classes
|
|
|
|
jaraco-collections
|
|
|
|
jaraco-context
|
|
|
|
jaraco-functools
|
|
|
|
jaraco-text
|
|
|
|
more-itertools
|
|
|
|
notify2
|
|
|
|
orjson
|
|
|
|
portend
|
|
|
|
puremagic
|
|
|
|
pycparser
|
2022-02-10 20:34:41 +00:00
|
|
|
pysocks
|
2023-08-22 20:05:09 +00:00
|
|
|
python-dateutil
|
|
|
|
pytz
|
|
|
|
rebulk
|
|
|
|
sabctools
|
|
|
|
sabyenc3
|
|
|
|
sgmllib3k
|
|
|
|
six
|
|
|
|
tempora
|
2024-01-25 14:12:00 +00:00
|
|
|
zc-lockfile
|
2020-09-25 04:45:31 +00:00
|
|
|
]);
|
2024-01-13 08:15:51 +00:00
|
|
|
path = lib.makeBinPath [ coreutils par2cmdline-turbo unrar unzip p7zip util-linux ];
|
2020-04-24 23:36:52 +00:00
|
|
|
in stdenv.mkDerivation rec {
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "4.2.3";
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "sabnzbd";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = pname;
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2024-04-21 15:54:59 +00:00
|
|
|
sha256 = "sha256-DM+sgrb7Zvtvp0th8GlOloSBcD8mG1RYyM91+uvCOgU=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
buildInputs = [ pythonEnv ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
2021-06-28 23:13:55 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
mkdir -p $out
|
|
|
|
cp -R * $out/
|
|
|
|
mkdir $out/bin
|
|
|
|
echo "${pythonEnv}/bin/python $out/SABnzbd.py \$*" > $out/bin/sabnzbd
|
|
|
|
chmod +x $out/bin/sabnzbd
|
|
|
|
wrapProgram $out/bin/sabnzbd --set PATH ${path}
|
2021-06-28 23:13:55 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-12-19 01:06:50 +00:00
|
|
|
passthru.tests = {
|
|
|
|
smoke-test = nixosTests.sabnzbd;
|
|
|
|
};
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Usenet NZB downloader, par2 repairer and auto extracting server";
|
|
|
|
homepage = "https://sabnzbd.org";
|
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
platforms = platforms.linux;
|
2023-08-22 20:05:09 +00:00
|
|
|
maintainers = with lib.maintainers; [ fridh jojosch adamcstephens ];
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "sabnzbd";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|