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
|
2017-02-26 20:25:29 +00:00
|
|
|
, gstreamer, gst-plugins-base, libxml2
|
2017-06-18 12:45:17 +01:00
|
|
|
, glib, gtk3, pango, gdk_pixbuf, cairo, atk, gnome3
|
2016-03-29 11:54:40 +01:00
|
|
|
, nss, nspr
|
2017-07-12 10:53:53 +01:00
|
|
|
, patchelf, makeWrapper
|
2017-06-25 13:00:05 +01:00
|
|
|
, proprietaryCodecs ? true, vivaldi-ffmpeg-codecs ? null
|
2016-03-29 11:54:40 +01:00
|
|
|
}:
|
|
|
|
|
2017-06-18 12:45:17 +01:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "${product}-${version}";
|
|
|
|
product = "vivaldi";
|
2017-06-25 19:56:03 +01:00
|
|
|
version = "1.10.867.48-1";
|
2016-03-29 11:54:40 +01:00
|
|
|
|
2016-04-29 02:05:41 +01:00
|
|
|
src = fetchurl {
|
2017-06-18 12:45:17 +01:00
|
|
|
url = "https://downloads.vivaldi.com/stable/${product}-stable_${version}_amd64.deb";
|
2017-06-25 19:56:03 +01:00
|
|
|
sha256 = "1han45swvv0y2i2kg7xhml1wj5zyrf2c2hc5b07kqsjkfg9iz1lc";
|
2016-04-29 02:05:41 +01:00
|
|
|
};
|
2016-03-29 11:54:40 +01:00
|
|
|
|
|
|
|
unpackPhase = ''
|
|
|
|
ar vx ${src}
|
|
|
|
tar -xvf data.tar.xz
|
|
|
|
'';
|
|
|
|
|
2017-07-12 10:53:53 +01:00
|
|
|
nativeBuildInputs = [ patchelf makeWrapper ];
|
2017-06-18 12:45:17 +01:00
|
|
|
|
|
|
|
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 gtk3 gdk_pixbuf libexif ffmpeg systemd
|
|
|
|
freetype fontconfig libXrender libuuid expat glib nss nspr
|
|
|
|
gstreamer libxml2 gst-plugins-base pango cairo gnome3.gconf
|
2017-06-25 13:00:05 +01:00
|
|
|
] ++ stdenv.lib.optional proprietaryCodecs vivaldi-ffmpeg-codecs;
|
2016-03-29 11:54:40 +01:00
|
|
|
|
|
|
|
libPath = stdenv.lib.makeLibraryPath buildInputs
|
2016-04-29 02:05:41 +01:00
|
|
|
+ stdenv.lib.optionalString (stdenv.is64bit)
|
2017-04-17 15:41:22 +01:00
|
|
|
(":" + stdenv.lib.makeSearchPathOutput "lib" "lib64" buildInputs)
|
|
|
|
+ ":$out/opt/vivaldi/lib";
|
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
|
2017-06-25 13:00:05 +01:00
|
|
|
'' + stdenv.lib.optionalString proprietaryCodecs ''
|
|
|
|
sed -i '/^VIVALDI_FFMPEG_FOUND/ a \
|
|
|
|
checkffmpeg "${vivaldi-ffmpeg-codecs}/lib/libffmpeg.so"' opt/vivaldi/vivaldi
|
|
|
|
'' + ''
|
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"
|
2016-09-23 23:27:36 +01: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
|
2017-07-12 10:53:53 +01:00
|
|
|
wrapProgram "$out/bin/vivaldi" \
|
|
|
|
--suffix XDG_DATA_DIRS : ${gtk3}/share/gsettings-schemas/${gtk3.name}/
|
2016-03-29 11:54:40 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
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 ];
|
2017-06-18 12:45:17 +01:00
|
|
|
platforms = [ "x86_64-linux" ];
|
2016-03-29 11:54:40 +01:00
|
|
|
};
|
|
|
|
}
|