21 url = "https://search.maven.org/remotecontent?filepath=com/googlecode/lanterna/lanterna/3.1.1/lanterna-3.1.1.jar";
22 hash = "sha256-7zxCeXYW5v9ritnvkwRpPKdgSptCmkT3HJOaNgQHUmQ=";
25 stdenv.mkDerivation (finalAttrs: {
30 url = "https://web.archive.org/web/20230917142929/https://get.filebot.net/filebot/FileBot_${finalAttrs.version}/FileBot_${finalAttrs.version}-portable.tar.xz";
31 hash = "sha256-fwyo9J5O728xxWHWvq63bTJMV4IAMAHZR0yr3Pb6d7U=";
34 unpackPhase = "tar xvf $src";
51 # replace lanterna.jar to be able to specify `com.googlecode.lanterna.terminal.UnixTerminal.sttyCommand`
52 cp ${lanterna} jar/lanterna.jar
57 mkdir -p $out/opt $out/bin
58 # Since FileBot has dependencies on relative paths between files, all required files are copied to the same location as is.
59 cp -r filebot.sh lib/ jar/ $out/opt/
60 # Filebot writes to $APP_DATA, which fails due to read-only filesystem. Using current user .local directory instead.
61 substituteInPlace $out/opt/filebot.sh \
62 --replace 'APP_DATA="$FILEBOT_HOME/data/$(id -u)"' 'APP_DATA=''${XDG_DATA_HOME:-$HOME/.local/share}/filebot/data' \
63 --replace '$FILEBOT_HOME/data/.license' '$APP_DATA/.license' \
64 --replace '-jar "$FILEBOT_HOME/jar/filebot.jar"' '-Dcom.googlecode.lanterna.terminal.UnixTerminal.sttyCommand=${coreutils}/bin/stty -jar "$FILEBOT_HOME/jar/filebot.jar"'
65 wrapProgram $out/opt/filebot.sh \
66 --prefix PATH : ${lib.makeBinPath [ openjdk17 ]}
67 # Expose the binary in bin to make runnable.
68 ln -s $out/opt/filebot.sh $out/bin/filebot
71 passthru.updateScript = genericUpdater {
72 versionLister = writeShellScript "filebot-versionLister" ''
73 curl -s https://www.filebot.net \
74 | sed -rne 's,^.*FileBot_([0-9]*\.[0-9]+\.[0-9]+)-portable.tar.xz.*,\1,p'
79 description = "Ultimate TV and Movie Renamer";
81 FileBot is the ultimate tool for organizing and renaming your Movies, TV
82 Shows and Anime as well as fetching subtitles and artwork. It's smart and
85 homepage = "https://filebot.net";
86 changelog = "https://www.filebot.net/forums/viewforum.php?f=7";
87 sourceProvenance = with sourceTypes; [
91 license = licenses.unfreeRedistributable;
92 maintainers = with maintainers; [
96 platforms = platforms.linux;
97 mainProgram = "filebot";