2021-01-11 08:54:33 +01:00
|
|
|
{ lib, stdenv, fetchurl, openjdk11, makeWrapper, autoPatchelfHook
|
2020-09-08 23:51:57 +02:00
|
|
|
, zlib, libzen, libmediainfo, curl, libmms, glib
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
# FileBot requires libcurl-gnutls.so to build
|
|
|
|
curlWithGnuTls = curl.override { gnutlsSupport = true; sslSupport = false; };
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "filebot";
|
2020-11-01 11:56:06 +01:00
|
|
|
version = "4.9.2";
|
2020-09-08 23:51:57 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://get.filebot.net/filebot/FileBot_${version}/FileBot_${version}-portable.tar.xz";
|
2020-11-01 11:56:06 +01:00
|
|
|
sha256 = "0hcyam8l0fzc9fnp1dpawk0s3rwhfph78w99y7zlcv5l4l4h04lz";
|
2020-09-08 23:51:57 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
unpackPhase = "tar xvf $src";
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper autoPatchelfHook ];
|
|
|
|
|
|
|
|
buildInputs = [ zlib libzen libmediainfo curlWithGnuTls libmms glib ];
|
|
|
|
|
|
|
|
dontBuild = true;
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/opt $out/bin
|
|
|
|
# Since FileBot has dependencies on relative paths between files, all required files are copied to the same location as is.
|
|
|
|
cp -r filebot.sh lib/ jar/ $out/opt/
|
|
|
|
# Filebot writes to $APP_DATA, which fails due to read-only filesystem. Using current user .local directory instead.
|
|
|
|
substituteInPlace $out/opt/filebot.sh \
|
2020-11-01 11:56:06 +01:00
|
|
|
--replace 'APP_DATA="$FILEBOT_HOME/data/$(id -u)"' 'APP_DATA=''${XDG_DATA_HOME:-$HOME/.local/share}/filebot/data' \
|
2020-09-08 23:51:57 +02:00
|
|
|
--replace '$FILEBOT_HOME/data/.license' '$APP_DATA/.license'
|
|
|
|
wrapProgram $out/opt/filebot.sh \
|
2021-01-15 06:42:41 +01:00
|
|
|
--prefix PATH : ${lib.makeBinPath [ openjdk11 ]}
|
2020-09-08 23:51:57 +02:00
|
|
|
# Expose the binary in bin to make runnable.
|
|
|
|
ln -s $out/opt/filebot.sh $out/bin/filebot
|
|
|
|
'';
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2020-09-08 23:51:57 +02:00
|
|
|
description = "The ultimate TV and Movie Renamer";
|
|
|
|
longDescription = ''
|
|
|
|
FileBot is the ultimate tool for organizing and renaming your Movies, TV
|
|
|
|
Shows and Anime as well as fetching subtitles and artwork. It's smart and
|
|
|
|
just works.
|
|
|
|
'';
|
|
|
|
homepage = "https://filebot.net";
|
|
|
|
changelog = "https://www.filebot.net/forums/viewforum.php?f=7";
|
|
|
|
license = licenses.unfreeRedistributable;
|
|
|
|
maintainers = with maintainers; [ gleber felschr ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|