···
{ stdenv, fetchurl, glibc, mesa, freetype, glib, libSM, libICE, libXi, libXv
, libXrender, libXrandr, libXfixes, libXcursor, libXinerama, libXext, libX11, qt4
3
-
, zlib, fontconfig }:
5
-
/* I haven't found any x86_64 package from them */
6
-
assert stdenv.system == "i686-linux";
8
-
stdenv.mkDerivation {
9
-
name = "googleearth-6.0.3.2197";
12
-
url = http://dl.google.com/earth/client/current/GoogleEarthLinux.bin;
13
-
sha256 = "0bcpmnlk03382x577qbnbw3i6y08hr3qmg85pqj35scnl6van74c";
3
+
, zlib, fontconfig, dpkg }:
16
-
nativeBuildInputs = [
7
+
if stdenv.system == "x86_64-linux" then "amd64"
8
+
else if stdenv.system == "i686-linux" then "i386"
9
+
else abort "Unsupported architecture";
12
+
then "0dwnppn5snl5bwkdrgj4cyylnhngi0g66fn2k41j3dvis83x24k6"
13
+
else "0gndbxrj3kgc2dhjqwjifr3cl85hgpm695z0wi01wvwzhrjqs0l2";
14
+
fullPath = stdenv.lib.makeLibraryPath [
36
+
stdenv.mkDerivation rec {
37
+
version = "7.1.4.1529";
38
+
name = "googleearth-${version}";
41
+
url = "https://dl.google.com/earth/client/current/google-earth-stable_current_${arch}.deb";
phases = "unpackPhase installPhase";
47
+
buildInputs = [ dpkg ];
41
-
bash $src --noexec --target unpacked
50
+
dpkg-deb -x ${src} ./
46
-
mkdir -p $out/{opt/googleearth/,bin};
47
-
tar xf googleearth-data.tar -C $out/opt/googleearth
48
-
tar xf googleearth-linux-x86.tar -C $out/opt/googleearth
49
-
cp bin/googleearth $out/opt/googleearth
50
-
cat > $out/bin/googleearth << EOF
52
-
export GOOGLEEARTH_DATA_PATH=$out/opt/googleearth
53
-
exec $out/opt/googleearth/googleearth
55
-
chmod +x $out/bin/googleearth
58
+
rm $out/bin/google-earth $out/opt/google/earth/free/google-earth
59
+
ln -s $out/opt/google/earth/free/googleearth $out/bin/google-earth
58
-
for i in $nativeBuildInputs; do
59
-
fullPath=$fullPath:$i/lib
patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
63
-
--set-rpath $fullPath \
64
-
$out/opt/googleearth/googleearth-bin
62
+
--set-rpath "${fullPath}:\$ORIGIN" \
63
+
$out/opt/google/earth/free/googleearth-bin
66
-
for a in $out/opt/googleearth/*.so* ; do
67
-
patchelf --set-rpath $fullPath $a
65
+
for a in $out/opt/google/earth/free/*.so* ; do
66
+
patchelf --set-rpath "${fullPath}:\$ORIGIN" $a
70
+
dontPatchELF = true;
description = "A world sphere viewer";
homepage = http://earth.google.com;
license = stdenv.lib.licenses.unfree;
maintainers = [ stdenv.lib.maintainers.viric ];
77
+
platforms = stdenv.lib.platforms.linux;