@@ -0,0 +1,51 @@
1+{ stdenv, fetchurl, fetchpatch
2+, dbus_glib, gtk2, gtk3, libexif, libpulseaudio, libXScrnSaver, ninja, nss
3+, pciutils, pkgconfig, python2, xdg_utils
4+}:
5+
6+stdenv.mkDerivation rec {
7+ name = "${product}-${version}";
8+ product = "vivaldi-ffmpeg-codecs";
9+ version = "59.0.3071.104";
10+
11+ src = fetchurl {
12+ url = "https://commondatastorage.googleapis.com/chromium-browser-official/chromium-${version}.tar.xz";
13+ sha512 = "419cf5bafa80f190cd301c2933502351929c1ef1d5cfedc720ce6762674a0e6af3b4246a8f92e0c29743420338b056061d4e7f9f4a4066a5bdd4d2ee8db3ddbf";
14+ };
15+
16+ buildInputs = [ ];
17+
18+ nativeBuildInputs = [
19+ dbus_glib gtk2 gtk3 libexif libpulseaudio libXScrnSaver ninja nss pciutils pkgconfig
20+ python2 xdg_utils
21+ ];
22+
23+ configurePhase = ''
24+ runHook preConfigure
25+
26+ local args="ffmpeg_branding=\"ChromeOS\" proprietary_codecs=true enable_hevc_demuxing=true use_gconf=false use_gio=false use_gnome_keyring=false use_kerberos=false use_cups=false use_sysroot=false use_gold=false linux_use_bundled_binutils=false fatal_linker_warnings=false treat_warnings_as_errors=false is_clang=false is_component_build=true is_debug=false symbol_level=0"
27+ python tools/gn/bootstrap/bootstrap.py -v -s --no-clean --gn-gen-args "$args"
28+ out/Release/gn gen out/Release -v --args="$args"
29+
30+ runHook postConfigure
31+ '';
32+
33+ buildPhase = ''
34+ ninja -C out/Release -v libffmpeg.so
35+ '';
36+
37+ dontStrip = true;
38+
39+ installPhase = ''
40+ mkdir -p "$out/lib"
41+ cp out/Release/libffmpeg.so "$out/lib/libffmpeg.so"
42+ '';
43+
44+ meta = with stdenv.lib; {
45+ description = "Additional support for proprietary codecs for Vivaldi";
46+ homepage = "https://ffmpeg.org/";
47+ license = licenses.lgpl21;
48+ maintainers = with maintainers; [ lluchs ];
49+ platforms = [ "x86_64-linux" ];
50+ };
51+}