cleverca22
8/1/2015 - 11:50 PM

builder.sh

#{ stdenv, ... }:
with import <nixpkgs> {};

stdenv.mkDerivation {
	name = "chrome-44.0.2403.125";
	builder = ./builder.sh;
	src = fetchurl {
		url = "http://ext.earthtools.ca/videos/dcc/google-chrome-stable_current_amd64.deb";
		sha256 = "ce09ce576407ff14fd6628783d1f818ea0b722b1cd8d75895f1b46ff2e762fdd";
	};
	libPath = stdenv.lib.makeLibraryPath [
		xlibs.libX11 xlibs.libXext alsaLib cups xlibs.libXrandr xlibs.libXcursor
		dbus gnome.pango cairo fontconfig xlibs.libXdamage xlibs.libXcomposite
		xlibs.libXrender xlibs.libXfixes gnome.gtk freetype glib expat
		atk gnome3.gconf nss nspr xlibs.libXi xlibs.libXScrnSaver xlibs.libXtst
		gdk-pixbuf
	];
}
source $stdenv/setup

echo $out
ar x $src
ls
mkdir -pv unpacked
cd unpacked
tar -xf ../data.tar.xz
for x in opt/google/chrome/chrome; do
	patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" --set-rpath $libPath $x
done
cd ..
mkdir $out
cp -r unpacked/* $out/