vivaldi-ffmpeg-codecs: vivaldi-ffmpeg-codecs: 115541 -> 119239; add aarch64-linux (#398013)

authored by Gaétan Lepage and committed by GitHub 270ec701 fe24d852

+106 -45
-41
pkgs/applications/networking/browsers/vivaldi/ffmpeg-codecs.nix
··· 1 - { 2 - squashfsTools, 3 - fetchurl, 4 - lib, 5 - stdenv, 6 - }: 7 - 8 - # This derivation roughly follows the update-ffmpeg script that ships with the official Vivaldi 9 - # downloads at https://vivaldi.com/download/ 10 - stdenv.mkDerivation rec { 11 - pname = "chromium-codecs-ffmpeg-extra"; 12 - version = "115541"; 13 - 14 - src = fetchurl { 15 - url = "https://api.snapcraft.io/api/v1/snaps/download/XXzVIXswXKHqlUATPqGCj2w2l7BxosS8_41.snap"; 16 - hash = "sha256-a1peHhku+OaGvPyChvLdh6/7zT+v8OHNwt60QUq7VvU="; 17 - }; 18 - 19 - buildInputs = [ squashfsTools ]; 20 - 21 - unpackPhase = '' 22 - unsquashfs -dest . $src 23 - ''; 24 - 25 - installPhase = '' 26 - install -vD chromium-ffmpeg-${version}/chromium-ffmpeg/libffmpeg.so $out/lib/libffmpeg.so 27 - ''; 28 - 29 - meta = with lib; { 30 - description = "Additional support for proprietary codecs for Vivaldi"; 31 - homepage = "https://ffmpeg.org/"; 32 - sourceProvenance = with sourceTypes; [ binaryNativeCode ]; 33 - license = licenses.lgpl21; 34 - maintainers = with maintainers; [ 35 - betaboon 36 - cawilliamson 37 - fptje 38 - ]; 39 - platforms = [ "x86_64-linux" ]; 40 - }; 41 - }
+62
pkgs/by-name/vi/vivaldi-ffmpeg-codecs/package.nix
··· 1 + { 2 + fetchurl, 3 + lib, 4 + squashfsTools, 5 + stdenv, 6 + }: 7 + 8 + # This derivation roughly follows the update-ffmpeg script that ships with the official Vivaldi 9 + # downloads at https://vivaldi.com/download/ 10 + 11 + let 12 + sources = { 13 + x86_64-linux = fetchurl { 14 + url = "https://api.snapcraft.io/api/v1/snaps/download/XXzVIXswXKHqlUATPqGCj2w2l7BxosS8_73.snap"; 15 + hash = "sha256-YsAYQ/fKlrvu7IbIxLO0oVhWOtZZzUmA00lrU+z/0+s="; 16 + }; 17 + aarch64-linux = fetchurl { 18 + url = "https://api.snapcraft.io/api/v1/snaps/download/XXzVIXswXKHqlUATPqGCj2w2l7BxosS8_74.snap"; 19 + hash = "sha256-zwCbaFeVmeHQLEp7nmD8VlEjSY9PqSVt6CdW4wPtw9o="; 20 + }; 21 + }; 22 + in 23 + stdenv.mkDerivation rec { 24 + 25 + pname = "chromium-codecs-ffmpeg-extra"; 26 + 27 + version = "119293"; 28 + 29 + src = sources."${stdenv.hostPlatform.system}"; 30 + 31 + buildInputs = [ squashfsTools ]; 32 + 33 + unpackPhase = '' 34 + unsquashfs -dest . $src 35 + ''; 36 + 37 + installPhase = '' 38 + install -vD chromium-ffmpeg-${version}/chromium-ffmpeg/libffmpeg.so $out/lib/libffmpeg.so 39 + ''; 40 + 41 + passthru = { 42 + inherit sources; 43 + updateScript = ./update.sh; 44 + }; 45 + 46 + meta = with lib; { 47 + description = "Additional support for proprietary codecs for Vivaldi and other chromium based tools"; 48 + homepage = "https://ffmpeg.org/"; 49 + sourceProvenance = with sourceTypes; [ binaryNativeCode ]; 50 + license = licenses.lgpl21; 51 + maintainers = with maintainers; [ 52 + betaboon 53 + cawilliamson 54 + fptje 55 + sarahec 56 + ]; 57 + platforms = [ 58 + "x86_64-linux" 59 + "aarch64-linux" 60 + ]; 61 + }; 62 + }
+44
pkgs/by-name/vi/vivaldi-ffmpeg-codecs/update.sh
··· 1 + #!/usr/bin/env nix-shell 2 + #!nix-shell -i bash -p common-updater-scripts coreutils grep jq squashfsTools 3 + 4 + set -eu -o pipefail 5 + 6 + RELEASES=$(curl -H 'Snap-Device-Series: 16' http://api.snapcraft.io/v2/snaps/info/chromium-ffmpeg) 7 + STABLE_RELEASES=$(echo $RELEASES | jq '."channel-map" | .[] | select(.channel.risk=="stable")') 8 + 9 + function max_version() { 10 + local versions=$(echo $1 | jq -r '.version') 11 + echo "$(echo $versions | grep -E -o '^[0-9]+')" 12 + } 13 + 14 + function update_source() { 15 + local platform=$1 16 + local selectedRelease=$2 17 + local version=$3 18 + local url=$(echo $selectedRelease | jq -r '.download.url') 19 + source="$(nix-prefetch-url "$url")" 20 + hash=$(nix-hash --to-sri --type sha256 "$source") 21 + update-source-version vivaldi-ffmpeg-codecs "$version" "$hash" "$url" --ignore-same-version --system=$platform --source-key="sources.$platform" 22 + } 23 + 24 + x86Release="$(echo $STABLE_RELEASES | jq 'select(.channel.architecture=="amd64")')" 25 + x86CodecVersion=$(max_version "$x86Release") 26 + arm64Release="$(echo $STABLE_RELEASES | jq -r 'select(.channel.architecture=="arm64")')" 27 + arm64CodecVersion=$(max_version "$arm64Release") 28 + 29 + currentVersion=$(nix-instantiate --eval -E "with import ./. {}; vivaldi-ffmpeg-codecs.version or (lib.getVersion vivaldi-ffmpeg-codecs)" | tr -d '"') 30 + 31 + if [[ "$currentVersion" == "$x86CodecVersion" ]]; then 32 + exit 0 33 + fi 34 + 35 + # If this fails too often, consider finding the max common version between the two architectures 36 + if [[ "$x86CodecVersion" != "$arm64CodecVersion" ]]; then 37 + >&2 echo "Multiple chromium versions found: $x86CodecVersion (intel) and $arm64CodecVersion (arm); no update" 38 + exit 1 39 + fi 40 + 41 + 42 + 43 + update_source "x86_64-linux" "$x86Release" "$x86CodecVersion" 44 + update_source "aarch64-linux" "$arm64Release" "$arm64CodecVersion"
-4
pkgs/top-level/all-packages.nix
··· 15693 15693 15694 15694 vivaldi = callPackage ../applications/networking/browsers/vivaldi { }; 15695 15695 15696 - vivaldi-ffmpeg-codecs = 15697 - callPackage ../applications/networking/browsers/vivaldi/ffmpeg-codecs.nix 15698 - { }; 15699 - 15700 15696 openrazer-daemon = python3Packages.toPythonApplication python3Packages.openrazer-daemon; 15701 15697 15702 15698 orpie = callPackage ../applications/misc/orpie {