Package: googleearth-package
Version: 0.5.7
Severity: normal
Tags: patch

--- Please enter the report below this line. ---

Enclosed please find a new patch against Google Earth 5.2.1.

In these changes, I removed the Qt4 libraries and use our own libfreeimage3 libraries.

* Avoid crashing[1] by QtWebKit. The QtWebKit libraries comes with GoogleEarch is incompatible with system browser plugins.

* Use the system font settings, but not Google Earth's internal font setting. It fixed font issue of non-en_US locale (ex: Chinese)

* I use LD_PRELOAD to overwrite the freeimages3 functions google linked into their own libIGGfx.so, which also caused crashing[2].

This patch should also fixes #590847[3], #590842[4],

[1] stactrace of Google's own QtWebKit
Stacktrace from glibc:
/usr/lib/googleearth/libgoogleearth_free.so(+0xd090b)[0xb759490b]
[0xb7875400]
/usr/lib/libgdk_pixbuf-2.0.so.0(gdk_pixbuf_from_pixdata+0x13f)[0x9f648daf]
/usr/lib/libgdk_pixbuf-2.0.so.0(gdk_pixbuf_new_from_inline+0x63)[0x9f649073]
/usr/lib/flashplugin-nonfree/libflashplayer.so(+0x4d335)[0x9fc68335]
/usr/lib/flashplugin-nonfree/libflashplayer.so(+0x4bd8e)[0x9fc66d8e]
/usr/lib/flashplugin-nonfree/libflashplayer.so(NP_Initialize+0x1ae)[0x9fc6b28e]
/usr/lib/googleearth/libQtWebKit.so.4(+0x747b22)[0xb6151b22]
/usr/lib/googleearth/libQtWebKit.so.4(+0x747c0c)[0xb6151c0c]

[2] stactrace without LD_PRELOAD freeimages3
Stacktrace from glibc:
/usr/lib/googleearth/libgoogleearth_free.so(+0xd090b)[0xb788290b]
[0xb78db400]
/usr/lib/googleearth/libIGGfx.so(+0x1296c9)[0xb3f206c9]
/usr/lib/googleearth/libIGGfx.so(FreeImage_LoadFromHandle+0xb1)[0xb3f0e2c1]
/usr/lib/googleearth/libIGGfx.so(_ZN3Gap3Gfx7igImage21platformLoadFreeImageEPNS_4Core6igFileEbPNS0_19igImageMetaDataListE+0xa1)[0xb3ef84b1]
/usr/lib/googleearth/libIGGfx.so(_ZN3Gap3Gfx10igOglImage12platformLoadEPNS_4Core6igFileEPNS0_19igImageMetaDataListE+0x112)[0xb3ef8bb2]
/usr/lib/googleearth/libIGGfx.so(_ZN3Gap3Gfx7igImage8loadFileEPNS_4Core6igFileEPNS0_19igImageMetaDataListE+0x12d)[0xb3ee91ad]
/usr/lib/googleearth/libevll.so(_ZN5earth4evll7Texture9LoadBytesEPKhi+0xa6d)[0xb0ad7b8d]

[3] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=588847
[4] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=588842

--- System information. ---
Architecture: i386
Kernel:       Linux 2.6.32-4-686-bigmem

Debian Release: squeeze/sid
  500 unstable        www.emdebian.org
  500 unstable        www.debian-multimedia.org
  500 unstable        http.us.debian.org
  500 unstable        ftp.us.debian.org
  500 unstable        debian.wgdd.de
  500 testing         ftp.us.debian.org
  500 testing         dl.google.com
  500 stable          repo.wuala.com
  500 stable          dl.google.com
  500 stable          deb.opera.com
  500 lucid           ppa.launchpad.net
  500 lucid           linux.getdropbox.com
    1 experimental    ftp.us.debian.org

--- Package information. ---
Depends         (Version) | Installed
=========================-+-===========
wget                      | 1.12-2
 OR curl                  | 7.21.1-1
dpkg-dev                  | 1.15.8.4
fakeroot                  | 1.14.4-1
bzip2                     | 1.0.5-4
file                      | 5.04-5
x11-common                | 1:7.5+6
x11-utils                 | 7.5+4


Package's Recommends field is empty.

Package's Suggests field is empty.



diff --git a/make-googleearth-package b/make-googleearth-package
index d595b70..d01186c 100755
--- a/make-googleearth-package
+++ b/make-googleearth-package
@@ -72,7 +72,7 @@ function check_version() {
 
   echo $version >&2
 
-  if grep -E 'GNU/Linux (4.[0123])|(5.[01])' <<<"$version" > /dev/null; then
+  if grep -E 'GNU/Linux (4.[0123])|(5.[012])' <<<"$version" > /dev/null; then
     GoogleEarth_VERSION=$(sed -e 's/.*GNU\/Linux //' <<<"$version")
     echo 'Supported Google Earth version:' $GoogleEarth_VERSION >&2
   elif [ "$OPT_FORCE" ]; then
@@ -307,6 +307,15 @@ else
   LD_LIBRARY_PATH=${GOOGLE_EARTH_LD_LIBRARY_PATH}
 fi
 export LD_LIBRARY_PATH
+
+GOOGLE_EARTH_LD_PRELOAD=/usr/lib/libfreeimage.so.3
+if [ ! -z "$LD_PRELOAD" ]; then
+  LD_PRELOAD=${LD_PRELOAD}:${GOOGLE_EARTH_LD_PRELOAD}
+else
+  LD_PRELOAD=${GOOGLE_EARTH_LD_PRELOAD}
+fi
+export LD_PRELOAD
+
 /usr/lib/googleearth/googleearth-bin "$@"
 EOF
   chmod a+x googleearth
@@ -324,12 +333,12 @@ Source: googleearth-package
 
 Package: googleeearth
 Suggests: ttf-bitstream-vera
-Depends:
+Depends: 
 EOF
 
   local deps=$(for elf in $elfs; do echo >&2 Checking shlib deps: $(basename $elf); LD_LIBRARY_PATH="../usr/lib/googleearth" dpkg-shlibdeps --warnings=0 -O -Lshlibs.local "$elf" | sed -e 's/^shlibs:Depends=//' -e 's/, /\n/g'; done | sort -u)
 
-  local depends=$(while read dep; do echo -n "$dep, "; done <<< "$deps" | sed 's/, $//')
+  local depends="libfreeimage3, "$(while read dep; do echo -n "$dep, "; done <<< "$deps" | sed 's/, $//')
 
   # clean up dpkg-shlibdeps helper files
   rm shlibs.local
@@ -381,6 +390,11 @@ function build_package() {
   # Workaround symbol problem in libcrypto
   mv libssl.so.0.9.8 libssl.so.0.9.8.moved.for.workaround
 
+  # Google's preloaded Qt libraries crashed all the time, it casused many issue.
+  for qtlib in libQtCore.so.4 libQtGui.so.4 libQtNetwork.so.4 libQtWebKit.so.4 ; do
+      mv ${qtlib} ${qtlib}.moved.for.workaround
+  done
+
   # debian menu entry
   cd "$instdir"
   mkdir -p usr/share/menu

Reply via email to