nixpkgs/pkgs/servers/bazarr/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

57 lines
1.4 KiB
Nix
Raw Normal View History

2021-08-01 14:38:44 +03:00
{ stdenv, lib, fetchurl, makeWrapper, unzip, python3, unrar, ffmpeg, nixosTests }:
2020-05-10 13:26:22 +03:00
let
runtimeProgDeps = [
ffmpeg
unrar
];
in
2020-05-10 13:26:22 +03:00
stdenv.mkDerivation rec {
pname = "bazarr";
2022-12-05 16:01:33 +03:00
version = "1.1.3";
2020-05-10 13:26:22 +03:00
2021-08-01 14:38:44 +03:00
sourceRoot = ".";
2020-05-10 13:26:22 +03:00
src = fetchurl {
2021-08-01 14:38:44 +03:00
url = "https://github.com/morpheus65535/bazarr/releases/download/v${version}/bazarr.zip";
2022-12-05 16:01:33 +03:00
sha256 = "sha256-jt6E+VtD7JdPIJdWBkVrQyiNfT7vxSYz4kXrFQAdpXE=";
2020-05-10 13:26:22 +03:00
};
2021-08-01 14:38:44 +03:00
nativeBuildInputs = [ unzip makeWrapper ];
2020-05-10 13:26:22 +03:00
buildInputs = [
(python3.withPackages (ps: [ ps.lxml ps.numpy ps.gevent ps.gevent-websocket ]))
] ++ runtimeProgDeps;
2020-05-10 13:26:22 +03:00
installPhase = ''
runHook preInstall
mkdir -p "$out"/{bin,share/${pname}}
cp -r * "$out/share/${pname}"
# Add missing shebang and execute perms so that patchShebangs can do its
# thing.
sed -i "1i #!/usr/bin/env python3" "$out/share/${pname}/bazarr.py"
chmod +x "$out/share/${pname}/bazarr.py"
makeWrapper "$out/share/${pname}/bazarr.py" \
"$out/bin/bazarr" \
--suffix PATH : ${lib.makeBinPath runtimeProgDeps}
runHook postInstall
2020-05-10 13:26:22 +03:00
'';
passthru.tests = {
smoke-test = nixosTests.bazarr;
};
meta = with lib; {
description = "Subtitle manager for Sonarr and Radarr";
homepage = "https://www.bazarr.media/";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
2021-03-25 13:17:59 +03:00
license = licenses.gpl3Only;
2021-08-08 20:11:45 +03:00
maintainers = with maintainers; [ d-xo ];
2020-05-10 13:26:22 +03:00
platforms = platforms.all;
};
}