diff --git a/pkgs/applications/networking/browsers/vivaldi/default.nix b/pkgs/applications/networking/browsers/vivaldi/default.nix index 26ab2d8c411e..ee477af8d492 100644 --- a/pkgs/applications/networking/browsers/vivaldi/default.nix +++ b/pkgs/applications/networking/browsers/vivaldi/default.nix @@ -9,6 +9,7 @@ , patchelf, makeWrapper , isSnapshot ? false , proprietaryCodecs ? false, vivaldi-ffmpeg-codecs ? null +, enableWidevine ? false, vivaldi-widevine ? null }: let @@ -51,7 +52,7 @@ in stdenv.mkDerivation rec { opt/${vivaldiName}/vivaldi-bin '' + stdenv.lib.optionalString proprietaryCodecs '' sed -i '/^if \[ "$VIVALDI_FFMPEG_FOUND/i \ - VIVALDI_FFMPEG_FOUND=YES\nCACHED_FFMPEG=${vivaldi-ffmpeg-codecs}/lib/libffmpeg.so' opt/${vivaldiName}/vivaldi + VIVALDI_FFMPEG_FOUND=YES\nCACHED_FFMPEG=${vivaldi-ffmpeg-codecs}/lib/libffmpeg.so' opt/${vivaldiName}/${vivaldiName} '' + '' echo "Finished patching Vivaldi binaries" ''; @@ -76,7 +77,11 @@ in stdenv.mkDerivation rec { "$out"/share/icons/hicolor/''${d}x''${d}/apps/vivaldi.png done wrapProgram "$out/bin/vivaldi" \ - --suffix XDG_DATA_DIRS : ${gtk3}/share/gsettings-schemas/${gtk3.name}/ + --suffix XDG_DATA_DIRS : ${gtk3}/share/gsettings-schemas/${gtk3.name}/ \ + ${stdenv.lib.optionalString enableWidevine "--suffix LD_LIBRARY_PATH : ${libPath}"} + '' + stdenv.lib.optionalString enableWidevine '' + rm $out/opt/${vivaldiName}/libwidevinecdm.so + ln -s ${vivaldi-widevine}/lib/libwidevinecdm.so $out/opt/${vivaldiName}/libwidevinecdm.so ''; meta = with stdenv.lib; { diff --git a/pkgs/applications/networking/browsers/vivaldi/widevine.nix b/pkgs/applications/networking/browsers/vivaldi/widevine.nix new file mode 100644 index 000000000000..a21de1acad28 --- /dev/null +++ b/pkgs/applications/networking/browsers/vivaldi/widevine.nix @@ -0,0 +1,32 @@ +{ stdenv, fetchurl +, unzip +}: + +stdenv.mkDerivation rec { + name = "widevine"; + version = "4.10.1196.0"; + + src = fetchurl { + url = "https://dl.google.com/widevine-cdm/${version}-linux-x64.zip"; + sha256 = "01c7nr7d2xs718jymicbk4ipzfx6q253109qv3lk4lryrrhvw14y"; + }; + + buildInputs = [ unzip ]; + + unpackPhase = '' + unzip $src libwidevinecdm.so + find . + ''; + + installPhase = '' + install -vD libwidevinecdm.so $out/lib/libwidevinecdm.so + ''; + + meta = with stdenv.lib; { + description = "Widevine support for Vivaldi"; + homepage = "https://www.widevine.com"; + license = licenses.unfree; + maintainers = with maintainers; [ betaboon ]; + platforms = [ "x86_64-linux" ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 07cf31e9d8e5..54f2cab11d48 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -19536,6 +19536,8 @@ in vivaldi-ffmpeg-codecs = callPackage ../applications/networking/browsers/vivaldi/ffmpeg-codecs.nix {}; + vivaldi-widevine = callPackage ../applications/networking/browsers/vivaldi/widevine.nix { }; + openmpt123 = callPackage ../applications/audio/openmpt123 { }; opusfile = callPackage ../applications/audio/opusfile { };