2024-07-27 06:49:29 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
coreutils,
|
|
|
|
fetchFromGitHub,
|
|
|
|
fetchPypi,
|
|
|
|
python3,
|
|
|
|
par2cmdline-turbo,
|
|
|
|
unzip,
|
|
|
|
unrar,
|
|
|
|
p7zip,
|
|
|
|
util-linux,
|
|
|
|
makeWrapper,
|
|
|
|
nixosTests,
|
2020-09-25 04:45:31 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
2024-07-27 06:49:29 +00:00
|
|
|
sabctoolsVersion = "8.2.0";
|
|
|
|
sabctoolsHash = "sha256-dOMNZoKWQxHJt6yHiNKVtpnYvLJkK8nktOm+djsSTcM=";
|
|
|
|
|
|
|
|
pythonEnv = python3.withPackages (
|
|
|
|
ps: with ps; [
|
|
|
|
apprise
|
|
|
|
babelfish
|
|
|
|
cffi
|
|
|
|
chardet
|
|
|
|
cheetah3
|
|
|
|
cheroot
|
|
|
|
cherrypy
|
|
|
|
configobj
|
|
|
|
cryptography
|
|
|
|
feedparser
|
|
|
|
guessit
|
|
|
|
jaraco-classes
|
|
|
|
jaraco-collections
|
|
|
|
jaraco-context
|
|
|
|
jaraco-functools
|
|
|
|
jaraco-text
|
|
|
|
more-itertools
|
|
|
|
notify2
|
|
|
|
orjson
|
|
|
|
portend
|
|
|
|
puremagic
|
|
|
|
pycparser
|
|
|
|
pysocks
|
|
|
|
python-dateutil
|
|
|
|
pytz
|
|
|
|
rebulk
|
|
|
|
# sabnzbd requires a specific version of sabctools
|
|
|
|
(sabctools.overridePythonAttrs (old: {
|
|
|
|
version = sabctoolsVersion;
|
|
|
|
src = fetchPypi {
|
|
|
|
pname = "sabctools";
|
|
|
|
version = sabctoolsVersion;
|
|
|
|
hash = sabctoolsHash;
|
|
|
|
};
|
|
|
|
}))
|
|
|
|
sabyenc3
|
|
|
|
sgmllib3k
|
|
|
|
six
|
|
|
|
tempora
|
|
|
|
zc-lockfile
|
|
|
|
]
|
|
|
|
);
|
|
|
|
path = lib.makeBinPath [
|
|
|
|
coreutils
|
|
|
|
par2cmdline-turbo
|
|
|
|
unrar
|
|
|
|
unzip
|
|
|
|
p7zip
|
|
|
|
util-linux
|
|
|
|
];
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
2024-06-05 15:53:02 +00:00
|
|
|
version = "4.3.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "sabnzbd";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = pname;
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2024-06-05 15:53:02 +00:00
|
|
|
sha256 = "sha256-EJf5yTyGbWqS9qaCWdxnJqaSFzVu3h5N3CGGzAEsBtI=";
|
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
|
|
|
'';
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
passthru = {
|
|
|
|
tests.smoke-test = nixosTests.sabnzbd;
|
|
|
|
updateScript = ./update.sh;
|
2021-12-19 01:06:50 +00:00
|
|
|
};
|
|
|
|
|
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;
|
2024-07-27 06:49:29 +00:00
|
|
|
maintainers = with lib.maintainers; [
|
|
|
|
jojosch
|
|
|
|
adamcstephens
|
|
|
|
];
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "sabnzbd";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|