2016-03-29 11:54:40 +01:00
|
|
|
{ stdenv, fetchurl, zlib, libX11, libXext, libSM, libICE
|
|
|
|
, libXfixes, libXt, libXi, libXcursor, libXScrnSaver, libXcomposite, libXdamage, libXtst, libXrandr
|
2016-09-05 17:59:00 +01:00
|
|
|
, alsaLib, dbus_libs, cups, libexif, ffmpeg, systemd
|
2016-03-29 11:54:40 +01:00
|
|
|
, freetype, fontconfig, libXft, libXrender, libxcb, expat, libXau, libXdmcp
|
|
|
|
, libuuid, xz
|
|
|
|
, gstreamer, gst_plugins_base, libxml2
|
|
|
|
, glib, gtk, pango, gdk_pixbuf, cairo, atk, gnome3
|
|
|
|
, nss, nspr
|
|
|
|
, patchelf
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2016-08-18 14:13:39 +01:00
|
|
|
version = "1.3";
|
|
|
|
build = "551.30-1";
|
2016-04-29 02:05:41 +01:00
|
|
|
fullVersion = "stable_${version}.${build}";
|
2016-03-29 11:54:40 +01:00
|
|
|
|
2016-04-29 02:05:41 +01:00
|
|
|
info = if stdenv.is64bit then {
|
|
|
|
arch = "amd64";
|
2016-08-18 14:13:39 +01:00
|
|
|
sha256 = "89d0630c9df56cfb12a87f23430179f6d14a8c57fb029d1c8d28ab06c98b7640";
|
2016-04-29 02:05:41 +01:00
|
|
|
} else {
|
|
|
|
arch = "i386";
|
2016-08-18 14:13:39 +01:00
|
|
|
sha256 = "0a7e07833f5359e38516222767da63edeca92177cbb6d4ef4946a6ef7c7b2946";
|
2016-04-29 02:05:41 +01:00
|
|
|
};
|
|
|
|
in stdenv.mkDerivation rec {
|
2016-03-29 11:54:40 +01:00
|
|
|
product = "vivaldi";
|
|
|
|
name = "${product}-${version}";
|
|
|
|
|
2016-04-29 02:05:41 +01:00
|
|
|
src = fetchurl {
|
|
|
|
inherit (info) sha256;
|
|
|
|
url = "https://downloads.vivaldi.com/stable/${product}-${fullVersion}_${info.arch}.deb";
|
|
|
|
};
|
2016-03-29 11:54:40 +01:00
|
|
|
|
|
|
|
unpackPhase = ''
|
|
|
|
ar vx ${src}
|
|
|
|
tar -xvf data.tar.xz
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildInputs =
|
|
|
|
[ stdenv.cc.cc stdenv.cc.libc zlib libX11 libXt libXext libSM libICE
|
|
|
|
libXi libXft libXcursor libXfixes libXScrnSaver libXcomposite libXdamage libXtst libXrandr
|
2016-09-05 17:59:00 +01:00
|
|
|
atk alsaLib dbus_libs cups gtk gdk_pixbuf libexif ffmpeg systemd
|
2016-03-29 11:54:40 +01:00
|
|
|
freetype fontconfig libXrender libuuid expat glib nss nspr
|
2016-04-29 00:54:05 +01:00
|
|
|
gstreamer libxml2 gst_plugins_base pango cairo gnome3.gconf
|
2016-03-29 11:54:40 +01:00
|
|
|
patchelf
|
|
|
|
];
|
|
|
|
|
|
|
|
libPath = stdenv.lib.makeLibraryPath buildInputs
|
2016-04-29 02:05:41 +01:00
|
|
|
+ stdenv.lib.optionalString (stdenv.is64bit)
|
2016-04-14 16:14:28 +01:00
|
|
|
(":" + stdenv.lib.makeSearchPathOutput "lib" "lib64" buildInputs);
|
2016-03-29 11:54:40 +01:00
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
echo "Patching Vivaldi binaries"
|
|
|
|
patchelf \
|
|
|
|
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
|
|
|
--set-rpath "${libPath}" \
|
2016-09-05 17:59:00 +01:00
|
|
|
opt/vivaldi/vivaldi-bin
|
2016-03-29 11:54:40 +01:00
|
|
|
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"
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "A Browser for our Friends, powerful and personal";
|
|
|
|
homepage = "https://vivaldi.com";
|
|
|
|
license = licenses.unfree;
|
2016-04-29 02:05:41 +01:00
|
|
|
maintainers = with maintainers; [ otwieracz nequissimus ];
|
2016-03-29 11:54:40 +01:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|