2022-12-07 12:40:29 +00:00
|
|
|
{ stdenv, lib, fetchurl, makeWrapper, unzip, python3, unar, ffmpeg, nixosTests }:
|
2020-05-10 10:26:22 +00:00
|
|
|
|
2022-11-04 12:27:35 +00:00
|
|
|
let
|
|
|
|
runtimeProgDeps = [
|
|
|
|
ffmpeg
|
2022-12-07 12:40:29 +00:00
|
|
|
unar
|
2022-11-04 12:27:35 +00:00
|
|
|
];
|
|
|
|
in
|
2020-05-10 10:26:22 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "bazarr";
|
2024-02-20 08:59:32 +00:00
|
|
|
version = "1.4.2";
|
2020-05-10 10:26:22 +00:00
|
|
|
|
2021-08-01 11:38:44 +00:00
|
|
|
sourceRoot = ".";
|
|
|
|
|
2020-05-10 10:26:22 +00:00
|
|
|
src = fetchurl {
|
2021-08-01 11:38:44 +00:00
|
|
|
url = "https://github.com/morpheus65535/bazarr/releases/download/v${version}/bazarr.zip";
|
2024-02-20 08:59:32 +00:00
|
|
|
sha256 = "sha256-1OqbCyQmA33ZvyCE11ZSyVwEgyym0Y0EX6qx3g71lnQ=";
|
2020-05-10 10:26:22 +00:00
|
|
|
};
|
|
|
|
|
2021-08-01 11:38:44 +00:00
|
|
|
nativeBuildInputs = [ unzip makeWrapper ];
|
2020-05-10 10:26:22 +00:00
|
|
|
|
2022-11-04 12:27:35 +00:00
|
|
|
buildInputs = [
|
2023-08-26 17:58:08 +00:00
|
|
|
(python3.withPackages (ps: [
|
|
|
|
ps.lxml
|
|
|
|
ps.numpy
|
|
|
|
ps.gevent
|
|
|
|
ps.gevent-websocket
|
|
|
|
ps.pillow
|
|
|
|
ps.setuptools
|
|
|
|
]))
|
2022-11-04 12:27:35 +00:00
|
|
|
] ++ runtimeProgDeps;
|
|
|
|
|
2020-05-10 10:26:22 +00:00
|
|
|
installPhase = ''
|
2022-11-04 12:27:35 +00:00
|
|
|
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 10:26:22 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
passthru.tests = {
|
|
|
|
smoke-test = nixosTests.bazarr;
|
|
|
|
};
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Subtitle manager for Sonarr and Radarr";
|
|
|
|
homepage = "https://www.bazarr.media/";
|
2022-09-05 10:22:27 +00:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
2021-03-25 10:17:59 +00:00
|
|
|
license = licenses.gpl3Only;
|
2021-08-08 17:11:45 +00:00
|
|
|
maintainers = with maintainers; [ d-xo ];
|
2023-11-10 14:07:34 +00:00
|
|
|
mainProgram = "bazarr";
|
2020-05-10 10:26:22 +00:00
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|