2009-04-13 16:40:51 +01:00
|
|
|
{ stdenv, fetchurl, glibc, mesa, freetype, glib, libSM, libICE, libXi, libXv,
|
2009-10-06 18:37:39 +01:00
|
|
|
libXrender, libXrandr, libXfixes, libXcursor, libXinerama, libXext, libX11,
|
|
|
|
zlib, patchelf05 }:
|
2009-04-13 16:40:51 +01:00
|
|
|
|
2009-04-15 10:09:45 +01:00
|
|
|
/* I haven't found any x86_64 package from them */
|
|
|
|
assert stdenv.system == "i686-linux";
|
|
|
|
|
2009-04-13 16:40:51 +01:00
|
|
|
stdenv.mkDerivation {
|
2009-12-23 19:55:58 +00:00
|
|
|
name = "googleearth-5.1.3533.1731";
|
2009-04-13 16:40:51 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = http://dl.google.com/earth/client/current/GoogleEarthLinux.bin;
|
2009-12-23 19:55:58 +00:00
|
|
|
sha256 = "1sxs1nwb2zh2j8dbwm65r04byn66yn79kpzhilhswly6r8d7yivg";
|
2009-04-13 16:40:51 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
glibc
|
|
|
|
glib
|
|
|
|
stdenv.gcc.gcc
|
|
|
|
libSM
|
|
|
|
libICE
|
|
|
|
libXi
|
|
|
|
libXv
|
|
|
|
mesa
|
|
|
|
libXrender
|
|
|
|
libXrandr
|
|
|
|
libXfixes
|
|
|
|
libXcursor
|
|
|
|
libXinerama
|
|
|
|
freetype
|
|
|
|
libXext
|
|
|
|
libX11
|
2009-10-06 18:37:39 +01:00
|
|
|
zlib
|
2009-04-13 16:40:51 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
phases = "unpackPhase installPhase";
|
|
|
|
unpackPhase = ''
|
|
|
|
bash $src --noexec --target unpacked
|
|
|
|
cd unpacked
|
|
|
|
'';
|
|
|
|
installPhase =''
|
|
|
|
ensureDir $out/{opt/googleearth/,bin};
|
|
|
|
tar xf googleearth-data.tar -C $out/opt/googleearth
|
|
|
|
tar xf googleearth-linux-x86.tar -C $out/opt/googleearth
|
|
|
|
cp bin/googleearth $out/opt/googleearth
|
|
|
|
cat > $out/bin/googleearth << EOF
|
|
|
|
#!/bin/sh
|
|
|
|
export GOOGLEEARTH_DATA_PATH=$out/opt/googleearth
|
|
|
|
exec $out/opt/googleearth/googleearth
|
|
|
|
EOF
|
|
|
|
chmod +x $out/bin/googleearth
|
|
|
|
|
|
|
|
fullPath=
|
|
|
|
for i in $buildInputs; do
|
|
|
|
fullPath=$fullPath:$i/lib
|
|
|
|
done
|
|
|
|
|
2009-10-06 18:37:39 +01:00
|
|
|
${patchelf05}/bin/patchelf --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
|
2009-04-13 16:40:51 +01:00
|
|
|
--set-rpath $fullPath \
|
|
|
|
$out/opt/googleearth/googleearth-bin
|
|
|
|
|
|
|
|
for a in $out/opt/googleearth/*.so* ; do
|
2009-10-06 18:37:39 +01:00
|
|
|
${patchelf05}/bin/patchelf --set-rpath $fullPath $a
|
2009-04-13 16:40:51 +01:00
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
2009-12-23 19:55:58 +00:00
|
|
|
description = "A world sphere viewer";
|
|
|
|
homepage = http://earth.google.com;
|
|
|
|
license = "unfree";
|
|
|
|
maintainers = with stdenv.lib.maintainers; [viric];
|
|
|
|
platforms = with stdenv.lib.platforms; linux;
|
2009-04-13 16:40:51 +01:00
|
|
|
};
|
|
|
|
}
|