2016-03-29 10:54:40 +00:00
|
|
|
{ stdenv, fetchurl, zlib, libX11, libXext, libSM, libICE
|
|
|
|
, libXfixes, libXt, libXi, libXcursor, libXScrnSaver, libXcomposite, libXdamage, libXtst, libXrandr
|
2018-07-17 20:11:16 +00:00
|
|
|
, alsaLib, dbus, cups, libexif, ffmpeg, systemd
|
2018-07-21 00:44:44 +00:00
|
|
|
, freetype, fontconfig, libXft, libXrender, libxcb, expat
|
|
|
|
, libuuid
|
2017-02-26 20:25:29 +00:00
|
|
|
, gstreamer, gst-plugins-base, libxml2
|
2019-01-03 14:11:18 +00:00
|
|
|
, glib, gtk3, pango, gdk_pixbuf, cairo, atk, at-spi2-atk, at-spi2-core, gnome2
|
2016-03-29 10:54:40 +00:00
|
|
|
, nss, nspr
|
2017-07-12 09:53:53 +00:00
|
|
|
, patchelf, makeWrapper
|
2019-04-22 02:20:20 +00:00
|
|
|
, isSnapshot ? false
|
2017-10-10 04:54:38 +00:00
|
|
|
, proprietaryCodecs ? false, vivaldi-ffmpeg-codecs ? null
|
2016-03-29 10:54:40 +00:00
|
|
|
}:
|
|
|
|
|
2019-04-22 02:20:20 +00:00
|
|
|
let
|
|
|
|
branch = if isSnapshot then "snapshot" else "stable";
|
|
|
|
vivaldiName = if isSnapshot then "vivaldi-snapshot" else "vivaldi";
|
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
pname = "vivaldi";
|
2019-05-08 14:03:44 +00:00
|
|
|
version = "2.5.1525.40-1";
|
2017-12-05 16:43:03 +00:00
|
|
|
|
2016-04-29 01:05:41 +00:00
|
|
|
src = fetchurl {
|
2019-04-22 02:20:20 +00:00
|
|
|
url = "https://downloads.vivaldi.com/${branch}/vivaldi-${branch}_${version}_amd64.deb";
|
2019-05-08 14:03:44 +00:00
|
|
|
sha256 = "1samrhavjz21vynv1vz8qnv9bf30mcy0da0qkpa1vhbgkga5flgy";
|
2017-12-05 16:43:03 +00:00
|
|
|
};
|
2016-03-29 10:54:40 +00:00
|
|
|
|
|
|
|
unpackPhase = ''
|
2019-04-22 02:20:20 +00:00
|
|
|
ar vx $src
|
2016-03-29 10:54:40 +00:00
|
|
|
tar -xvf data.tar.xz
|
|
|
|
'';
|
|
|
|
|
2017-07-12 09:53:53 +00:00
|
|
|
nativeBuildInputs = [ patchelf makeWrapper ];
|
2017-06-18 11:45:17 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
stdenv.cc.cc stdenv.cc.libc zlib libX11 libXt libXext libSM libICE libxcb
|
|
|
|
libXi libXft libXcursor libXfixes libXScrnSaver libXcomposite libXdamage libXtst libXrandr
|
2019-01-03 14:11:18 +00:00
|
|
|
atk at-spi2-atk at-spi2-core alsaLib dbus cups gtk3 gdk_pixbuf libexif ffmpeg systemd
|
2017-06-18 11:45:17 +00:00
|
|
|
freetype fontconfig libXrender libuuid expat glib nss nspr
|
2018-07-09 22:34:32 +00:00
|
|
|
gstreamer libxml2 gst-plugins-base pango cairo gnome2.GConf
|
2017-06-25 12:00:05 +00:00
|
|
|
] ++ stdenv.lib.optional proprietaryCodecs vivaldi-ffmpeg-codecs;
|
2016-03-29 10:54:40 +00:00
|
|
|
|
|
|
|
libPath = stdenv.lib.makeLibraryPath buildInputs
|
2016-04-29 01:05:41 +00:00
|
|
|
+ stdenv.lib.optionalString (stdenv.is64bit)
|
2017-04-17 14:41:22 +00:00
|
|
|
(":" + stdenv.lib.makeSearchPathOutput "lib" "lib64" buildInputs)
|
2019-04-22 02:20:20 +00:00
|
|
|
+ ":$out/opt/${vivaldiName}/lib";
|
2016-03-29 10:54:40 +00:00
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
echo "Patching Vivaldi binaries"
|
|
|
|
patchelf \
|
|
|
|
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
|
|
|
--set-rpath "${libPath}" \
|
2019-04-22 02:20:20 +00:00
|
|
|
opt/${vivaldiName}/vivaldi-bin
|
2017-06-25 12:00:05 +00:00
|
|
|
'' + stdenv.lib.optionalString proprietaryCodecs ''
|
|
|
|
sed -i '/^VIVALDI_FFMPEG_FOUND/ a \
|
2019-04-22 02:20:20 +00:00
|
|
|
checkffmpeg "${vivaldi-ffmpeg-codecs}/lib/libffmpeg.so"' opt/${vivaldiName}/vivaldi
|
2017-06-25 12:00:05 +00:00
|
|
|
'' + ''
|
2016-03-29 10:54:40 +00:00
|
|
|
echo "Finished patching Vivaldi binaries"
|
|
|
|
'';
|
|
|
|
|
|
|
|
dontPatchELF = true;
|
|
|
|
dontStrip = true;
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p "$out"
|
|
|
|
cp -r opt "$out"
|
|
|
|
mkdir "$out/bin"
|
2019-04-22 02:20:20 +00:00
|
|
|
ln -s "$out/opt/${vivaldiName}/${vivaldiName}" "$out/bin/vivaldi"
|
2016-09-23 22:27:36 +00:00
|
|
|
mkdir -p "$out/share"
|
|
|
|
cp -r usr/share/{applications,xfce4} "$out"/share
|
|
|
|
substituteInPlace "$out"/share/applications/*.desktop \
|
2019-04-22 02:20:20 +00:00
|
|
|
--replace /usr/bin/${vivaldiName} "$out"/bin/vivaldi
|
2016-09-23 22:27:36 +00:00
|
|
|
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 \
|
2019-04-22 02:20:20 +00:00
|
|
|
"$out"/opt/${vivaldiName}/product_logo_''${d}.png \
|
2016-09-23 22:27:36 +00:00
|
|
|
"$out"/share/icons/hicolor/''${d}x''${d}/apps/vivaldi.png
|
|
|
|
done
|
2017-07-12 09:53:53 +00:00
|
|
|
wrapProgram "$out/bin/vivaldi" \
|
|
|
|
--suffix XDG_DATA_DIRS : ${gtk3}/share/gsettings-schemas/${gtk3.name}/
|
2016-03-29 10:54:40 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "A Browser for our Friends, powerful and personal";
|
|
|
|
homepage = "https://vivaldi.com";
|
|
|
|
license = licenses.unfree;
|
2016-04-29 01:05:41 +00:00
|
|
|
maintainers = with maintainers; [ otwieracz nequissimus ];
|
2017-06-18 11:45:17 +00:00
|
|
|
platforms = [ "x86_64-linux" ];
|
2016-03-29 10:54:40 +00:00
|
|
|
};
|
|
|
|
}
|