nixpkgs/pkgs/applications/networking/browsers/vivaldi/default.nix
romildo 9747994a7b vivaldi: 1.6.689.34-1 -> 1.8.770.56-1
Add $out/opt/vivaldi/lib to RPATH so that libffmpeg.so distributed
with Vivaldi can be found. Otherwise launching Vivaldi fails.
2017-04-17 11:41:22 -03:00

90 lines
2.8 KiB
Nix

{ stdenv, fetchurl, zlib, libX11, libXext, libSM, libICE
, libXfixes, libXt, libXi, libXcursor, libXScrnSaver, libXcomposite, libXdamage, libXtst, libXrandr
, alsaLib, dbus_libs, cups, libexif, ffmpeg, systemd
, freetype, fontconfig, libXft, libXrender, libxcb, expat, libXau, libXdmcp
, libuuid, xz
, gstreamer, gst-plugins-base, libxml2
, glib, gtk2, pango, gdk_pixbuf, cairo, atk, gnome3
, nss, nspr
, patchelf
}:
let
version = "1.8";
build = "770.56-1";
fullVersion = "stable_${version}.${build}";
info = if stdenv.is64bit then {
arch = "amd64";
sha256 = "1f9cwr41rl0mqwg3xn2nfb5xnr0h0vc4wiz8367bd67zf4an61d2";
} else {
arch = "i386";
sha256 = "1240w3gqn5rbvkb0v1g66syrc92r1vzk82fkmvy92qsnx0d5z7nn ";
};
in stdenv.mkDerivation rec {
product = "vivaldi";
name = "${product}-${version}";
src = fetchurl {
inherit (info) sha256;
url = "https://downloads.vivaldi.com/stable/${product}-${fullVersion}_${info.arch}.deb";
};
unpackPhase = ''
ar vx ${src}
tar -xvf data.tar.xz
'';
buildInputs =
[ stdenv.cc.cc stdenv.cc.libc zlib libX11 libXt libXext libSM libICE libxcb
libXi libXft libXcursor libXfixes libXScrnSaver libXcomposite libXdamage libXtst libXrandr
atk alsaLib dbus_libs cups gtk2 gdk_pixbuf libexif ffmpeg systemd
freetype fontconfig libXrender libuuid expat glib nss nspr
gstreamer libxml2 gst-plugins-base pango cairo gnome3.gconf
patchelf
];
libPath = stdenv.lib.makeLibraryPath buildInputs
+ stdenv.lib.optionalString (stdenv.is64bit)
(":" + stdenv.lib.makeSearchPathOutput "lib" "lib64" buildInputs)
+ ":$out/opt/vivaldi/lib";
buildPhase = ''
echo "Patching Vivaldi binaries"
patchelf \
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
--set-rpath "${libPath}" \
opt/vivaldi/vivaldi-bin
echo "Finished patching Vivaldi binaries"
'';
dontPatchELF = true;
dontStrip = true;
installPhase = ''
mkdir -p "$out"
cp -r opt "$out"
mkdir "$out/bin"
ln -s "$out/opt/vivaldi/vivaldi" "$out/bin/vivaldi"
mkdir -p "$out/share"
cp -r usr/share/{applications,xfce4} "$out"/share
substituteInPlace "$out"/share/applications/*.desktop \
--replace /usr/bin/vivaldi-stable "$out"/bin/vivaldi
local d
for d in 16 22 24 32 48 64 128 256; do
mkdir -p "$out"/share/icons/hicolor/''${d}x''${d}/apps
ln -s \
"$out"/opt/vivaldi/product_logo_''${d}.png \
"$out"/share/icons/hicolor/''${d}x''${d}/apps/vivaldi.png
done
'';
meta = with stdenv.lib; {
description = "A Browser for our Friends, powerful and personal";
homepage = "https://vivaldi.com";
license = licenses.unfree;
maintainers = with maintainers; [ otwieracz nequissimus ];
platforms = platforms.linux;
};
}