diff --git a/pkgs/by-name/vi/vivaldi-ffmpeg-codecs/package.nix b/pkgs/by-name/vi/vivaldi-ffmpeg-codecs/package.nix index d9e83ed91b10..b232d3bd6ad1 100644 --- a/pkgs/by-name/vi/vivaldi-ffmpeg-codecs/package.nix +++ b/pkgs/by-name/vi/vivaldi-ffmpeg-codecs/package.nix @@ -25,7 +25,7 @@ in stdenv.mkDerivation (finalAttrs: { pname = "chromium-codecs-ffmpeg-extra"; - version = "123075"; # Do not update by hand, use the update script + version = "0-unstable-2026-05-18"; # Do not update by hand, use the update script src = sources."${stdenv.hostPlatform.system}"; @@ -36,7 +36,7 @@ stdenv.mkDerivation (finalAttrs: { ''; installPhase = '' - install -vD chromium-ffmpeg-${finalAttrs.version}/chromium-ffmpeg/libffmpeg.so $out/lib/libffmpeg.so + install -vD chromium-ffmpeg-git-${lib.removePrefix "0-unstable-" finalAttrs.version}/chromium-ffmpeg/libffmpeg.so $out/lib/libffmpeg.so ''; passthru = { @@ -54,6 +54,7 @@ stdenv.mkDerivation (finalAttrs: { cawilliamson fptje sarahec + brw ]; platforms = [ "x86_64-linux" diff --git a/pkgs/by-name/vi/vivaldi-ffmpeg-codecs/update.sh b/pkgs/by-name/vi/vivaldi-ffmpeg-codecs/update.sh index e22fe0a6bdc4..9e5041c4ca7e 100755 --- a/pkgs/by-name/vi/vivaldi-ffmpeg-codecs/update.sh +++ b/pkgs/by-name/vi/vivaldi-ffmpeg-codecs/update.sh @@ -9,19 +9,19 @@ STABLE_RELEASES=$(echo $RELEASES | jq '.["channel-map"] | .[] | select(.channel function get_url() { local architecture=$1 - echo $(echo $STABLE_RELEASES | jq -r '. | select(.arch=="'${architecture}'") | .url') + echo $STABLE_RELEASES | jq -r '. | select(.arch=="'${architecture}'") | .url' } # TODO If nix ever supports sha3-384, we can get that from the JSON and use it for the download hash function get_source() { local url=$1 # returns the source path - echo $(nix-prefetch-url --print-path "$url" | tail -n 1) + nix-prefetch-url --print-path "$url" | tail -n 1 } function max_version() { local source=$1 - local versions="$(unsquashfs -l $source | awk -F- '$0 ~ "^squashfs-root/chromium-ffmpeg-[[:digit:]]+$" { print $NF }')" + local versions="$(unsquashfs -l $source | grep -Po '^squashfs-root/chromium-ffmpeg-git-\K[[:digit:]]{4}-[[:digit:]]{2}-[[:digit:]]{2}')" echo "$versions" | sort -V | tail -n 1 } @@ -32,16 +32,16 @@ function update_source() { local version=$4 local source_hash=$(nix-hash --type sha256 --flat --base32 "$source") local hash=$(nix-hash --to-sri --type sha256 "$source_hash") - update-source-version vivaldi-ffmpeg-codecs $version $hash "$url" --ignore-same-version --system=$platform --source-key="sources.$platform" + update-source-version "vivaldi-ffmpeg-codecs" "$version" "$hash" "$url" --ignore-same-version --system=$platform --source-key="sources.$platform" } -x86_url="$(get_url amd64)" +x86_url="$(get_url "amd64")" x86_source="$(get_source ${x86_url})" -x86_version="$(max_version ${x86_source})" +x86_version="0-unstable-$(max_version ${x86_source})" arm64_url="$(get_url "arm64")" arm64_source="$(get_source ${arm64_url})" -arm64_version="$(max_version ${arm64_source})" +arm64_version="0-unstable-$(max_version ${arm64_source})" currentVersion=$(nix eval --raw -f . vivaldi-ffmpeg-codecs.version) @@ -52,8 +52,8 @@ fi # If this fails too often, we can try using the lesser of the two versions for both # as the snap contains the last 4-5 versions. if [[ "$x86_version" != "$arm64_version" ]]; then - >&2 echo "Multiple chromium versions found: $x86_version (intel) and $arm64_version (arm); no update" - exit 1 + >&2 echo "Multiple chromium versions found: $x86_version (intel) and $arm64_version (arm); no update" + exit 1 fi update_source "x86_64-linux" "$x86_url" "$x86_source" "$x86_version"