nixpkgs/pkgs/servers/couchpotato/default.nix

45 lines
1.1 KiB
Nix
Raw Normal View History

2021-09-19 13:25:37 +00:00
{ fetchFromGitHub, python2Packages, lib }:
2017-01-16 11:52:29 +00:00
2019-11-13 15:08:56 +00:00
with python2Packages;
2017-01-16 11:52:29 +00:00
buildPythonApplication rec {
pname = "couchpotato";
2017-01-16 11:52:29 +00:00
version = "3.0.1";
disabled = isPy3k;
2021-09-19 13:25:37 +00:00
src = fetchFromGitHub {
owner = "CouchPotato";
repo = "CouchPotatoServer";
rev = "build/${version}";
hash = "sha256-0k8MqLnqYjhHPE9/jncTFIj1T4F2aXU4mXdeEimDB7M=";
2017-01-16 11:52:29 +00:00
};
format = "other";
postPatch = ''
substituteInPlace CouchPotato.py --replace "dirname(os.path.abspath(__file__))" "os.path.join(dirname(os.path.abspath(__file__)), '../${python.sitePackages}')"
'';
installPhase = ''
mkdir -p $out/bin/
mkdir -p $out/${python.sitePackages}/
cp -r libs/* $out/${python.sitePackages}/
cp -r couchpotato $out/${python.sitePackages}/
cp CouchPotato.py $out/bin/couchpotato
chmod +x $out/bin/*
'';
postFixup = ''
wrapProgram "$out/bin/couchpotato" --set PYTHONPATH "$PYTHONPATH:$out/${python.sitePackages}"
2017-01-16 11:52:29 +00:00
'';
meta = {
description = "Automatic movie downloading via NZBs and torrents";
license = lib.licenses.gpl3;
homepage = "https://couchpota.to/";
2017-01-16 11:52:29 +00:00
maintainers = with lib.maintainers; [ fadenb ];
};
}