Skip to content

Instantly share code, notes, and snippets.

@thorhop
Created February 4, 2015 00:38
Show Gist options
  • Select an option

  • Save thorhop/149d002640a92bc12c5b to your computer and use it in GitHub Desktop.

Select an option

Save thorhop/149d002640a92bc12c5b to your computer and use it in GitHub Desktop.
A browser for your friends...
{ stdenv, fetchurl, dpkg, patchelf, cpio, mesa, xorg, cairo
, libpng, gtk, glib, gdk_pixbuf, fontconfig, freetype, curl
, dbus_glib, alsaLib, pulseaudio, udev, pango
}:
with stdenv.lib;
let
rpathPlugin = makeLibraryPath
[ mesa
xorg.libXt
xorg.libX11
xorg.libXrender
cairo
libpng
gtk
glib
fontconfig
freetype
curl
];
rpathProgram = makeLibraryPath
[ gdk_pixbuf
glib
gtk
xorg.libX11
xorg.libXcomposite
xorg.libXfixes
xorg.libXrender
xorg.libXrandr
stdenv.cc.gcc
alsaLib
pulseaudio
dbus_glib
udev
curl
pango
cairo
];
in
stdenv.mkDerivation rec {
name = "vivaldi-${version}";
version = "1.0.83.38";
src =
if stdenv.system == "x86_64-linux" then
fetchurl {
url = "$https://vivaldi.com/download/Vivaldi_TP_${version}-1_amd64.deb";
sha256 = "01l9b4zqc78sfxrw0lz988k226223n6xq91wqj3ry24z9k6ap7im";
}
else throw "Vivaldi is not supported on your platform... friend.";
buildInputs = [ dpkg patchelf ];
unpackPhase = ''
dpkg --extract $src $out
'';
buildPhase = ''
patchelf \
--interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
--set-rpath $rpath $out/opt/vivaldi/libffmpegsumo.so
patchelf \
--interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
--set-rpath $rpath $out/opt/vivaldi/libpdf.so
patchelf \
--interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
--set-rpath $rpath $out/opt/vivaldi/vivaldi-sandbox
patchelf \
--interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
--set-rpath $rpath $out/opt/vivaldi/vivaldi-bin
rm $out/usr/bin/vivaldi-stable
ln -s $out/opt/vivaldi/vivaldi-bin $out/usr/bin/vivaldi-stable
'';
meta = {
homepage = https://vivaldi.com/;
description = "A new browser for our friends";
license = stdenv.lib.licenses.unfree;
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment