fix: filebot
This commit is contained in:
parent
5191597f63
commit
b02acb5b60
7 changed files with 79 additions and 150 deletions
|
|
@ -7,6 +7,7 @@ self: super: {
|
|||
ai-mailer = self.callPackage ../pkgs/ai-mailer.nix { };
|
||||
mautrix-mattermost = self.callPackage ../pkgs/mautrix-mattermost { };
|
||||
claude-code = self.callPackage ../pkgs/claude-code { claude-code = super.claude-code; };
|
||||
filebot = self.callPackage ../pkgs/filebot { filebot = super.filebot; };
|
||||
|
||||
# Python packages
|
||||
python3 = super.python3.override {
|
||||
|
|
@ -46,33 +47,35 @@ self: super: {
|
|||
in
|
||||
super.invidious.overrideAttrs (oldAttrs: {
|
||||
inherit version src;
|
||||
postPatch = let
|
||||
branchTemplate = ''{{ "#{`git branch | sed -n '/* /s///p'`.strip}" }}'';
|
||||
commitTemplate = ''{{ "#{`git rev-list HEAD --max-count=1 --abbrev-commit`.strip}" }}'';
|
||||
versionTemplate = ''{{ "#{`git log -1 --format=%ci | awk '{print $1}' | sed s/-/./g`.strip}" }}'';
|
||||
tagTemplate = ''{{ "#{`git tag --points-at HEAD`.strip}" }}'';
|
||||
assetCommitTemplate = ''{{ "#{`git rev-list HEAD --max-count=1 --abbrev-commit -- assets`.strip}" }}'';
|
||||
in ''
|
||||
for d in ${videojs}/*; do ln -s "$d" assets/videojs; done
|
||||
postPatch =
|
||||
let
|
||||
branchTemplate = ''{{ "#{`git branch | sed -n '/* /s///p'`.strip}" }}'';
|
||||
commitTemplate = ''{{ "#{`git rev-list HEAD --max-count=1 --abbrev-commit`.strip}" }}'';
|
||||
versionTemplate = ''{{ "#{`git log -1 --format=%ci | awk '{print $1}' | sed s/-/./g`.strip}" }}'';
|
||||
tagTemplate = ''{{ "#{`git tag --points-at HEAD`.strip}" }}'';
|
||||
assetCommitTemplate = ''{{ "#{`git rev-list HEAD --max-count=1 --abbrev-commit -- assets`.strip}" }}'';
|
||||
in
|
||||
''
|
||||
for d in ${videojs}/*; do ln -s "$d" assets/videojs; done
|
||||
|
||||
substituteInPlace src/invidious.cr \
|
||||
--replace-fail ${super.lib.escapeShellArg branchTemplate} '"master"' \
|
||||
--replace-fail ${super.lib.escapeShellArg commitTemplate} '"${commit}"' \
|
||||
--replace-fail ${super.lib.escapeShellArg versionTemplate} '"${date}"' \
|
||||
--replace-fail ${super.lib.escapeShellArg tagTemplate} '""' \
|
||||
--replace-fail ${super.lib.escapeShellArg assetCommitTemplate} '"${commit}"'
|
||||
substituteInPlace src/invidious.cr \
|
||||
--replace-fail ${super.lib.escapeShellArg branchTemplate} '"master"' \
|
||||
--replace-fail ${super.lib.escapeShellArg commitTemplate} '"${commit}"' \
|
||||
--replace-fail ${super.lib.escapeShellArg versionTemplate} '"${date}"' \
|
||||
--replace-fail ${super.lib.escapeShellArg tagTemplate} '""' \
|
||||
--replace-fail ${super.lib.escapeShellArg assetCommitTemplate} '"${commit}"'
|
||||
|
||||
substituteInPlace src/invidious.cr \
|
||||
--replace-fail 'public_folder "assets"' 'public_folder "${placeholder "out"}/share/invidious/assets"'
|
||||
substituteInPlace src/invidious/helpers/i18n.cr \
|
||||
--replace-fail 'File.read("locales/' 'File.read("${placeholder "out"}/share/invidious/locales/'
|
||||
substituteInPlace src/invidious.cr \
|
||||
--replace-fail 'public_folder "assets"' 'public_folder "${placeholder "out"}/share/invidious/assets"'
|
||||
substituteInPlace src/invidious/helpers/i18n.cr \
|
||||
--replace-fail 'File.read("locales/' 'File.read("${placeholder "out"}/share/invidious/locales/'
|
||||
|
||||
substituteInPlace src/invidious/database/base.cr \
|
||||
--replace-fail 'config/sql' '${placeholder "out"}/share/invidious/config/sql'
|
||||
substituteInPlace src/invidious/database/base.cr \
|
||||
--replace-fail 'config/sql' '${placeholder "out"}/share/invidious/config/sql'
|
||||
|
||||
substituteInPlace src/invidious/user/captcha.cr \
|
||||
--replace-fail 'Process.run(%(rsvg-convert' 'Process.run(%(${super.lib.getBin super.librsvg}/bin/rsvg-convert'
|
||||
'';
|
||||
substituteInPlace src/invidious/user/captcha.cr \
|
||||
--replace-fail 'Process.run(%(rsvg-convert' 'Process.run(%(${super.lib.getBin super.librsvg}/bin/rsvg-convert'
|
||||
'';
|
||||
});
|
||||
|
||||
# vscode-insiders = (super.callPackage ../pkgs/vscode-insiders.nix { });
|
||||
|
|
|
|||
15
utils/pkgs/filebot/default.nix
Normal file
15
utils/pkgs/filebot/default.nix
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
{ fetchurl, filebot }:
|
||||
|
||||
# Override the nixpkgs filebot source URL.
|
||||
#
|
||||
# Upstream nixpkgs fetches from a single web.archive.org mirror which started
|
||||
# returning HTTP 429, breaking builds. The same tarball is still hosted at
|
||||
# get.filebot.net, so we swap the URL. The hash matches nixpkgs' pinned one
|
||||
# because archive.org captured a byte-identical copy. Run ./update.sh to
|
||||
# refresh if upstream re-uploads.
|
||||
filebot.overrideAttrs (oldAttrs: {
|
||||
src = fetchurl {
|
||||
url = "https://get.filebot.net/filebot/FileBot_${oldAttrs.version}/FileBot_${oldAttrs.version}-portable.tar.xz";
|
||||
hash = "sha256-OcXXKaZcBuP584SJWeQB+aaxO0kih6Oiud0Vm8e9kPo=";
|
||||
};
|
||||
})
|
||||
31
utils/pkgs/filebot/update.sh
Executable file
31
utils/pkgs/filebot/update.sh
Executable file
|
|
@ -0,0 +1,31 @@
|
|||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p curl cacert nix
|
||||
|
||||
set -euo pipefail
|
||||
cd "$(dirname "${BASH_SOURCE[0]}")"
|
||||
|
||||
# Discover latest upstream version (same logic as nixpkgs' genericUpdater).
|
||||
echo "Fetching latest FileBot version from filebot.net..."
|
||||
version=$(curl -fsSL https://www.filebot.net \
|
||||
| sed -rne 's,^.*FileBot_([0-9]+\.[0-9]+\.[0-9]+)-portable\.tar\.xz.*,\1,p' \
|
||||
| sort -uV | tail -n1)
|
||||
|
||||
# Allow pinning: ./update.sh --version 5.2.0
|
||||
if [ "${1:-}" = "--version" ] && [ -n "${2:-}" ]; then
|
||||
version="$2"
|
||||
fi
|
||||
|
||||
if [ -z "${version:-}" ]; then
|
||||
echo "Error: could not determine FileBot version" >&2
|
||||
exit 1
|
||||
fi
|
||||
echo "Version: $version"
|
||||
|
||||
url="https://get.filebot.net/filebot/FileBot_${version}/FileBot_${version}-portable.tar.xz"
|
||||
hash=$(nix-prefetch-url --type sha256 "$url")
|
||||
sri_hash=$(nix-hash --type sha256 --to-sri "$hash")
|
||||
echo "SRI hash: $sri_hash"
|
||||
|
||||
sed -i "s|hash = \"sha256-[A-Za-z0-9+/=]\{43,\}=\";|hash = \"$sri_hash\";|" default.nix
|
||||
|
||||
echo "Updated utils/pkgs/filebot/default.nix -> $sri_hash"
|
||||
Loading…
Add table
Add a link
Reference in a new issue