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