2011-02-09 14:33:46 +01:00
|
|
|
{ stdenv, fetchurl, glibc, mesa, freetype, glib, libSM, libICE, libXi, libXv
|
|
|
|
, libXrender, libXrandr, libXfixes, libXcursor, libXinerama, libXext, libX11, qt4
|
2017-02-02 16:53:24 +01:00
|
|
|
, zlib, fontconfig, dpkg }:
|
2009-04-13 17:40:51 +02:00
|
|
|
|
2017-02-02 16:53:24 +01:00
|
|
|
let
|
|
|
|
arch =
|
|
|
|
if stdenv.system == "x86_64-linux" then "amd64"
|
|
|
|
else if stdenv.system == "i686-linux" then "i386"
|
|
|
|
else abort "Unsupported architecture";
|
|
|
|
sha256 =
|
|
|
|
if arch == "amd64"
|
|
|
|
then "0dwnppn5snl5bwkdrgj4cyylnhngi0g66fn2k41j3dvis83x24k6"
|
|
|
|
else "0gndbxrj3kgc2dhjqwjifr3cl85hgpm695z0wi01wvwzhrjqs0l2";
|
|
|
|
fullPath = stdenv.lib.makeLibraryPath [
|
2009-04-13 17:40:51 +02:00
|
|
|
glibc
|
|
|
|
glib
|
2015-01-15 05:25:26 +01:00
|
|
|
stdenv.cc.cc
|
2017-02-02 16:53:24 +01:00
|
|
|
libSM
|
|
|
|
libICE
|
|
|
|
libXi
|
2009-04-13 17:40:51 +02:00
|
|
|
libXv
|
|
|
|
mesa
|
2017-02-02 16:53:24 +01:00
|
|
|
libXrender
|
|
|
|
libXrandr
|
|
|
|
libXfixes
|
|
|
|
libXcursor
|
|
|
|
libXinerama
|
|
|
|
freetype
|
|
|
|
libXext
|
|
|
|
libX11
|
2010-10-16 15:11:06 +02:00
|
|
|
qt4
|
2009-10-06 19:37:39 +02:00
|
|
|
zlib
|
2011-02-09 14:33:46 +01:00
|
|
|
fontconfig
|
2009-04-13 17:40:51 +02:00
|
|
|
];
|
2017-02-02 16:53:24 +01:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
version = "7.1.4.1529";
|
|
|
|
name = "googleearth-${version}";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://dl.google.com/earth/client/current/google-earth-stable_current_${arch}.deb";
|
|
|
|
inherit sha256;
|
|
|
|
};
|
2009-04-13 17:40:51 +02:00
|
|
|
|
|
|
|
phases = "unpackPhase installPhase";
|
2017-02-02 16:53:24 +01:00
|
|
|
|
|
|
|
buildInputs = [ dpkg ];
|
|
|
|
|
2009-04-13 17:40:51 +02:00
|
|
|
unpackPhase = ''
|
2017-02-02 16:53:24 +01:00
|
|
|
dpkg-deb -x ${src} ./
|
2009-04-13 17:40:51 +02:00
|
|
|
'';
|
2017-02-02 16:53:24 +01:00
|
|
|
|
2009-04-13 17:40:51 +02:00
|
|
|
installPhase =''
|
2017-02-02 16:53:24 +01:00
|
|
|
mkdir $out
|
|
|
|
mv usr/* $out/
|
|
|
|
rmdir usr
|
|
|
|
mv * $out/
|
|
|
|
rm $out/bin/google-earth $out/opt/google/earth/free/google-earth
|
|
|
|
ln -s $out/opt/google/earth/free/googleearth $out/bin/google-earth
|
2009-04-13 17:40:51 +02:00
|
|
|
|
2014-12-17 19:11:30 +01:00
|
|
|
patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
2017-02-02 16:53:24 +01:00
|
|
|
--set-rpath "${fullPath}:\$ORIGIN" \
|
|
|
|
$out/opt/google/earth/free/googleearth-bin
|
2009-04-13 17:40:51 +02:00
|
|
|
|
2017-02-02 16:53:24 +01:00
|
|
|
for a in $out/opt/google/earth/free/*.so* ; do
|
|
|
|
patchelf --set-rpath "${fullPath}:\$ORIGIN" $a
|
2009-04-13 17:40:51 +02:00
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2017-02-02 16:53:24 +01:00
|
|
|
dontPatchELF = true;
|
|
|
|
|
2009-04-13 17:40:51 +02:00
|
|
|
meta = {
|
2009-12-23 20:55:58 +01:00
|
|
|
description = "A world sphere viewer";
|
|
|
|
homepage = http://earth.google.com;
|
2014-06-19 06:19:00 +02:00
|
|
|
license = stdenv.lib.licenses.unfree;
|
2010-02-05 20:22:26 +01:00
|
|
|
maintainers = [ stdenv.lib.maintainers.viric ];
|
2017-02-02 16:53:24 +01:00
|
|
|
platforms = stdenv.lib.platforms.linux;
|
2009-04-13 17:40:51 +02:00
|
|
|
};
|
|
|
|
}
|