Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
HOWTO: Make Google Earth use system libraries
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
Etal
Veteran
Veteran


Joined: 15 Jul 2005
Posts: 1641

PostPosted: Mon Feb 09, 2009 2:57 am    Post subject: HOWTO: Make Google Earth use system libraries Reply with quote

Why, you ask?

When I updated Google Earth to version 5, I found the fonts look awful. So, I decided to link replace the Qt libs that come with Google Earth with those that I have installed. This resulted in nice, clean fonts.

Other reasons why you might want to do that could be because:
- you want to Zomg-Optimize!!1
- you're bored
- you really need those extra 19 MB

To do that, I wrote this script:

Code:
#!/bin/bash

cd /opt/googleearth

find . -maxdepth 1 -type f -regex '^\./lib.*so\..*' -printf '%f\n' | while read lib
do
        echo "Searching for $lib ..."
        find /lib /usr/lib/ -name "$lib" \
                -exec echo -n "Replacing $lib with {} ... " \; \
                -exec ln -fs '{}' "$lib" \; \
                -exec echo "OK" \;
done


What it does is it searches for each library in Google Earth's directory and finds their counterpart in /usr/lib. It then replaces Google's library with a symlink to the system library.

For me, it works like a charm. If it doesn't work, simply re-emerge googleearth, and it will all be back to normal.

Have fun!

Edit: A little semi-related tidbit I found - if you don't like the Qt style it comes with by default, you can change it in /opt/googleearth/googleearth, on line 48: Just change "-style=cleanlooks" to "-style=oxygen"

Small Edit: Added /lib to search path to get libz.so
_________________
“And even in authoritarian countries, information networks are helping people discover new facts and making governments more accountable.”– Hillary Clinton, Jan. 21, 2010


Last edited by Etal on Mon Feb 09, 2009 4:44 pm; edited 2 times in total
Back to top
View user's profile Send private message
poly_poly-man
Advocate
Advocate


Joined: 06 Dec 2006
Posts: 2477
Location: RIT, NY, US

PostPosted: Mon Feb 09, 2009 3:35 am    Post subject: Reply with quote

before I try it, does it work with amd64?
_________________
iVBORw0KGgoAAAANSUhEUgAAA

avatar: new version of logo - see topic 838248. Potentially still a WiP.
Back to top
View user's profile Send private message
Etal
Veteran
Veteran


Joined: 15 Jul 2005
Posts: 1641

PostPosted: Mon Feb 09, 2009 4:53 am    Post subject: Reply with quote

That I can not answer since I never used AMD64. Since Google Earth is apparently 32-bit, my guess would be no, because you probably don't have those 32-bit libs.
_________________
“And even in authoritarian countries, information networks are helping people discover new facts and making governments more accountable.”– Hillary Clinton, Jan. 21, 2010
Back to top
View user's profile Send private message
szczerb
Veteran
Veteran


Joined: 24 Feb 2007
Posts: 1636
Location: Poland => Lodz

PostPosted: Mon Feb 09, 2009 7:07 am    Post subject: Reply with quote

AM088 wrote:
That I can not answer since I never used AMD64. Since Google Earth is apparently 32-bit, my guess would be no, because you probably don't have those 32-bit libs.
Yeah, we do - there is a bunch of emul-linux-x86-* packages.
Back to top
View user's profile Send private message
mv
Advocate
Advocate


Joined: 20 Apr 2005
Posts: 4221

PostPosted: Mon Feb 09, 2009 2:45 pm    Post subject: Reply with quote

This tip is great. For amd64 it does not save much space, but in principle the approach is possible. The only problem I had was that the openoffice-bin libraries cannot replace the google libs (I do not know why).

To make the whole approach a bit more generically (and let it work also for the next emerge of googleearth), you can alternatively put the following code into /etc/portage/env/x11-misc/googleearth
Code:

mv_ln_libs () {
   case "${MV_NO_LN_LIBS}" in ''|false|0|no) true;; *) return 0;; esac
   local pathlist="/lib /usr/lib"
   use amd64 && {
      test -d /lib32 || test -d /usr/lib32
   } && pathlist="/lib32 /usr/lib32"
   local i j k l
   l=''
   for i
   do
      test -f "${i}" || continue
      j="${i##*/}"
      for k in ${pathlist}; do
         [ -n "$(find "${k}" -name openoffice -prune -o \
            -name "${j}")" ] || continue
         l="${l} ${j}"
         find "${k}" -name openoffice -prune -o \
            -name "${j}" -exec \
            /bin/ln -vsfn -- '{}' "${i}" ';' -quit
         break
      done
   done
   [ -z "${l}" ] && return
   ewarn
   ewarn "${PORTAGE_CONFIGROOT%/}/etc/portage/env/${CATEGORY}/${PN}*"
   ewarn "The following libs have been linked symbolically:"
   ewarn ${l}
   ewarn "The package might not depend on these libs, so this may break."
   ewarn "If the libs change, a reemerge of the package might be needed."
   ewarn "Set MV_NO_LN_LIBS=true during emerge to skip this hack."
   ewarn
}

post_pkg_preinst() {
   mv_ln_libs "${D}"/opt/googleearth/lib*.so.* "${D}"/opt/googleearth/plugins/*/lib*.so
}
It should be obvious how to change the code for other binary packages.

As usual for such hacks: If somethings breaks you keep the pieces. Do not report a bug for googleearth unless you have reemerged with MV_NO_LN_LIBS set.


Last edited by mv on Sun Feb 22, 2009 8:55 pm; edited 1 time in total
Back to top
View user's profile Send private message
toralf
Advocate
Advocate


Joined: 01 Feb 2004
Posts: 2713
Location: Hamburg/Germany

PostPosted: Mon Feb 09, 2009 3:54 pm    Post subject: Reply with quote

Why you do not include in /usr/bin/googleearth sth. like
Code:
LD_LIBRARY_PATH="/usr/lib:${LD_LIBRARY_PATH}"
?
Back to top
View user's profile Send private message
Etal
Veteran
Veteran


Joined: 15 Jul 2005
Posts: 1641

PostPosted: Mon Feb 09, 2009 4:50 pm    Post subject: Reply with quote

toralf wrote:
Why you do not include in /usr/bin/googleearth sth. like
Code:
LD_LIBRARY_PATH="/usr/lib:${LD_LIBRARY_PATH}"
?


I haven't tried that. Does it work if you delete the libraries that my script finds?
_________________
“And even in authoritarian countries, information networks are helping people discover new facts and making governments more accountable.”– Hillary Clinton, Jan. 21, 2010
Back to top
View user's profile Send private message
toralf
Advocate
Advocate


Joined: 01 Feb 2004
Posts: 2713
Location: Hamburg/Germany

PostPosted: Mon Feb 09, 2009 4:57 pm    Post subject: Reply with quote

AM088 wrote:
Does it work if you delete the libraries that my script finds?
Try it yourself by doing sth. like:
Code:
cd /opt/googleearth/
LD_LIBRARY_PATH="/usr/lib:`pwd`"
ldd libapiloader.so
and look at the output.
Back to top
View user's profile Send private message
Etal
Veteran
Veteran


Joined: 15 Jul 2005
Posts: 1641

PostPosted: Mon Feb 09, 2009 5:43 pm    Post subject: Reply with quote

toralf wrote:
AM088 wrote:
Does it work if you delete the libraries that my script finds?
Try it yourself by doing sth. like:
Code:
cd /opt/googleearth/
LD_LIBRARY_PATH="/usr/lib:`pwd`"
ldd libapiloader.so
and look at the output.

I reemerged googleearth and tried playing around with the LD_LIBRARY_PATH inside of /usr/bin/googleearth as well as in /opt/googleearth/googleearth, but it doesn't seem to work - Google Earth continues to start with the ugly fonts, meaning it still uses its bundled libraries. Also, the output of ldd is the same whether I set the variable or not (it points to /usr/lib).

So my solution of removing those libraries seems to work better for now ;)
_________________
“And even in authoritarian countries, information networks are helping people discover new facts and making governments more accountable.”– Hillary Clinton, Jan. 21, 2010
Back to top
View user's profile Send private message
mv
Advocate
Advocate


Joined: 20 Apr 2005
Posts: 4221

PostPosted: Tue Feb 10, 2009 12:38 pm    Post subject: Reply with quote

toralf wrote:
Why you do not include in /usr/bin/googleearth sth. like
Code:
LD_LIBRARY_PATH="/usr/lib:${LD_LIBRARY_PATH}"
?

IIRC (no time to check in the moment), the paths in LD_LIBRARY_PATH are not search recursively, so you would have to include all subdirs (in particular, the qt-subdir(s?)) as well. However, I do not see the advantage: Patching a script and removing unneded libraries or replacing them by symlinks should be about the same in effort and effect.
Back to top
View user's profile Send private message
toralf
Advocate
Advocate


Joined: 01 Feb 2004
Posts: 2713
Location: Hamburg/Germany

PostPosted: Tue Feb 10, 2009 12:52 pm    Post subject: Reply with quote

mv wrote:
the paths in LD_LIBRARY_PATH are not search recursivel
That's correct, my intention was rather related to state out, that IMHO the use of an environment variable is better compared to hard/soft links within an emerged package directory.
Back to top
View user's profile Send private message
xiber
Apprentice
Apprentice


Joined: 28 Oct 2003
Posts: 245
Location: Fremont, CA

PostPosted: Sun Feb 15, 2009 8:22 pm    Post subject: Reply with quote

Hey AM088, thanks for the tip. Just installed googleearth. Fonts now look alot better.

But...

The blue square popup photographs still popup, but minus the photographs.
_________________
Athlon XP-M 2600 @ 2.3 GHz OC | Abit NF7-S r2.0 | 2x512MB PC3200 | 6600GT OC | Audigy 2 | Gentoo | 2005

Athlon 64 X2 4600 @ 2.4 GHz | Asus M2N-SLI DLX | 4x1GB PC6400 | 7600GT KO | 7HD @ 3.1TB | OpenSolaris SXCE | 2007


Last edited by xiber on Sun Feb 15, 2009 8:53 pm; edited 1 time in total
Back to top
View user's profile Send private message
albright
Advocate
Advocate


Joined: 16 Nov 2003
Posts: 2109
Location: Near Toronto

PostPosted: Sun Feb 15, 2009 8:50 pm    Post subject: Reply with quote

fonts do look better after this hack, but instead of photos appearing
when I click on the little box-things, I get little question mark icons.
A re-emerge fixed that but of course brought back the ugly font.
_________________
.... there is nothing - absolutely nothing - half so much worth
doing as simply messing about with Linux ...
(apologies to Kenneth Graeme)
Back to top
View user's profile Send private message
xiber
Apprentice
Apprentice


Joined: 28 Oct 2003
Posts: 245
Location: Fremont, CA

PostPosted: Sun Feb 15, 2009 9:13 pm    Post subject: Reply with quote

To get good looking fonts, at least in my case, only libQtCore.so.4 and libQtGui.so.4 need to be replaced in
/usr/opt/googleearth, but subsutiting libQtCore.so.4 causes popup photos to be replaced by blue squares.
_________________
Athlon XP-M 2600 @ 2.3 GHz OC | Abit NF7-S r2.0 | 2x512MB PC3200 | 6600GT OC | Audigy 2 | Gentoo | 2005

Athlon 64 X2 4600 @ 2.4 GHz | Asus M2N-SLI DLX | 4x1GB PC6400 | 7600GT KO | 7HD @ 3.1TB | OpenSolaris SXCE | 2007
Back to top
View user's profile Send private message
musv
Advocate
Advocate


Joined: 01 Dec 2002
Posts: 2674
Location: de

PostPosted: Mon Feb 16, 2009 4:07 pm    Post subject: Reply with quote

Replacing that libs with the system ones occures a
Code:
./googleearth-bin: error while loading shared libraries: libQtCore.so.4: wrong ELF class: ELFCLASS64


Is Google-Earth only 32bit?

Update: Ok reading again that thread: Google earth is only 32bit

szczerb wrote:
AM088 wrote:
That I can not answer since I never used AMD64. Since Google Earth is apparently 32-bit, my guess would be no, because you probably don't have those 32-bit libs.
Yeah, we do - there is a bunch of emul-linux-x86-* packages.

At least here app-emulation/emul-linux-x86-qtlibs installed only qt3-libs. Afair Google Earth is qt4-based. I had the same problem with opera, which didn't start as 64bit version.

equery files emul-linux-x86-qtlibs:
* Contents of app-emulation/emul-linux-x86-qtlibs-20080316:
/usr
/usr/kde
/usr/kde/3.5
/usr/kde/3.5/lib32
/usr/kde/3.5/lib32/libDCOP.so -> libDCOP.so.4.2.0
/usr/kde/3.5/lib32/libDCOP.so.4 -> libDCOP.so.4.2.0
/usr/kde/3.5/lib32/libDCOP.so.4.2.0
/usr/kde/3.5/lib32/libkdecore.so -> libkdecore.so.4.2.0
/usr/kde/3.5/lib32/libkdecore.so.4 -> libkdecore.so.4.2.0
/usr/kde/3.5/lib32/libkdecore.so.4.2.0
/usr/kde/3.5/lib32/libkdefx.so -> libkdefx.so.4.2.0
/usr/kde/3.5/lib32/libkdefx.so.4 -> libkdefx.so.4.2.0
/usr/kde/3.5/lib32/libkdefx.so.4.2.0
/usr/qt
/usr/qt/3
/usr/qt/3/lib32
/usr/qt/3/lib32/libqt-mt.so -> libqt-mt.so.3
/usr/qt/3/lib32/libqt-mt.so.3 -> libqt-mt.so.3.3
/usr/qt/3/lib32/libqt-mt.so.3.3 -> libqt-mt.so.3.3.8
/usr/qt/3/lib32/libqt-mt.so.3.3.8
/usr/qt/3/lib32/libqt.so -> libqt-mt.so
/usr/qt/3/lib32/libqt.so.3 -> libqt-mt.so.3
/usr/qt/3/lib32/libqt.so.3.3 -> libqt-mt.so.3.3
/usr/qt/3/lib32/libqt.so.3.3.8 -> libqt-mt.so.3.3.8
/usr/qt/3/lib32/libqui.so -> libqui.so.1
/usr/qt/3/lib32/libqui.so.1 -> libqui.so.1.0
/usr/qt/3/lib32/libqui.so.1.0 -> libqui.so.1.0.0
/usr/qt/3/lib32/libqui.so.1.0.0

Is there a way to get emul-linux-qtlibs for qt4?
Back to top
View user's profile Send private message
strobeam
n00b
n00b


Joined: 12 Feb 2007
Posts: 2

PostPosted: Sun Feb 22, 2009 7:59 pm    Post subject: Reply with quote

The pictures in the panoramio-windows are missing because not all QT4-libs are replaced. The libs for displaying pictures are located under
Code:
/opt/googleearth/plugins/imageformats

and have to be linked to the corresponding libs under
Code:
usr/lib/qt4/plugins/imageformats/


Perhaps these libs can be included into the script too, but I don't see how to do it now.
Back to top
View user's profile Send private message
mv
Advocate
Advocate


Joined: 20 Apr 2005
Posts: 4221

PostPosted: Sun Feb 22, 2009 9:01 pm    Post subject: Reply with quote

strobeam wrote:
Perhaps these libs can be included into the script too, but I don't see how to do it now.

I changed my suggestion (the script for /etc/portage/env/x11-misc/googleearth in a later posting) correspondingly.
Now the approach in this script is even more generically: You can perhaps even pass in addition "${D}"/opt/googleearth/lib*.so (or at least a subset thereof) in the call to mv_ln_libs to save even more space by replacing more libs, but I didn't try whether this (or with which libs) this works.
Back to top
View user's profile Send private message
Calvin721
n00b
n00b


Joined: 15 Dec 2007
Posts: 2

PostPosted: Tue Mar 17, 2009 8:23 pm    Post subject: Reply with quote

strobeam wrote:
The pictures in the panoramio-windows are missing because not all QT4-libs are replaced. The libs for displaying pictures are located under
Code:
/opt/googleearth/plugins/imageformats

and have to be linked to the corresponding libs under
Code:
usr/lib/qt4/plugins/imageformats/


Perhaps these libs can be included into the script too, but I don't see how to do it now.


OK, I got back panoramio pictures and also placemark icons back.

But, my own places and tracks are not located where they are supposed to be. Also, other placemarks are dislocated. When I use the libraries shiiped with GE, there are no problems. Any hints?

My QT version: qt-gui-4.4.2-r1 (split ebuilds)

Regards,

Stefan
Back to top
View user's profile Send private message
Hyper_Eye
Guru
Guru


Joined: 17 Aug 2003
Posts: 446
Location: Huntsville, AL.

PostPosted: Sat Apr 04, 2009 6:17 pm    Post subject: Reply with quote

Has there been any progress on this on the 64-bit side? I checked and the qt 32-bit libs are still qt3. If 32-bit qt4 libs were provided we would be good to substitute those libs and have fonts we can actually read right?
_________________
Gentoo Gaming Videos
Back to top
View user's profile Send private message
Hoek
n00b
n00b


Joined: 17 Apr 2003
Posts: 35
Location: Bayreuth, Germany

PostPosted: Sun Apr 26, 2009 2:06 am    Post subject: Reply with quote

After running the script and starting googleearth:

Code:

./googleearth-bin: ./libstdc++.so.6: version `GLIBCXX_3.4.4' not found (required by ./googleearth-bin)
./googleearth-bin: ./libstdc++.so.6: version `GLIBCXX_3.4.4' not found (required by ./libgoogleearth_lib.so)
./googleearth-bin: ./libstdc++.so.6: version `GLIBCXX_3.4.4' not found (required by ./libbase.so)
./googleearth-bin: ./libstdc++.so.6: version `GLIBCXX_3.4.4' not found (required by ./libge_net.so)
./googleearth-bin: ./libstdc++.so.6: version `GLIBCXX_3.4.4' not found (required by ./libgeobase.so)
./googleearth-bin: ./libstdc++.so.6: version `GLIBCXX_3.4.4' not found (required by ./libapiloader.so)
./googleearth-bin: ./libstdc++.so.6: version `GLIBCXX_3.4.4' not found (required by ./libauth.so)
./googleearth-bin: ./libstdc++.so.6: version `GLIBCXX_3.4.4' not found (required by ./libcommon.so)
./googleearth-bin: ./libstdc++.so.6: version `GLIBCXX_3.4.4' not found (required by ./libcomponentframework.so)
./googleearth-bin: ./libstdc++.so.6: version `GLIBCXX_3.4.4' not found (required by ./libmoduleframework.so)
./googleearth-bin: ./libstdc++.so.6: version `GLIBCXX_3.4.4' not found (required by ./libport.so)
./googleearth-bin: ./libstdc++.so.6: version `GLIBCXX_3.4.4' not found (required by ./librender.so)


I'm on 32bit.
Back to top
View user's profile Send private message
HMC
Tux's lil' helper
Tux's lil' helper


Joined: 06 Jul 2005
Posts: 76
Location: Australia

PostPosted: Wed Apr 29, 2009 5:18 pm    Post subject: Reply with quote

This one is a keeper. Thanks AM008

Running ~x86 KDE4.2, qt4.5, X11 overlay, 2.6.29... on i915 mobile a lot of stuff is broken. GE was totally smashed and this script proved to be a really quick fix for the bulk of its problems.


Cheers
Back to top
View user's profile Send private message
golding
Apprentice
Apprentice


Joined: 07 Jun 2005
Posts: 230
Location: Adelaide / South Australia

PostPosted: Tue May 12, 2009 8:27 pm    Post subject: Many, many thanks - VERY happy. Reply with quote

AM088, thankyou, thankyou, thankyou :D

Ran the script and the GoogleEarth app fonts are now clean and crisp, unlike the rendering from the old font libs, they made it virtually unreadable.
Actually, I lie, they were unreadable, to the point that I had to use Google Maps in Firefox as GE was basically unusable with the fonts rendered as they were.

And all without any of the problems others seem to have had.

Has anybody thought to have this as a patch for the ebuild, perhaps with a use flag? 8)
_________________
Regards, Robert

..... Some people can tell what time it is by looking at the sun, but I have never been able to make out the numbers.
Back to top
View user's profile Send private message
billydv
l33t
l33t


Joined: 22 Dec 2006
Posts: 875
Location: Mount Vernon, NY

PostPosted: Sun May 17, 2009 1:03 am    Post subject: Reply with quote

I have tried copying libs from an X86 machine to my amd64 machine and no matter what I copy it still doesn't work. Has anyone reached a fix for an ~amd64 box?
_________________
Billy DeVincentis
Back to top
View user's profile Send private message
Apopatos
Guru
Guru


Joined: 17 Oct 2004
Posts: 506
Location: Hellas

PostPosted: Thu May 21, 2009 2:21 am    Post subject: Reply with quote

billydv wrote:
I have tried copying libs from an X86 machine to my amd64 machine and no matter what I copy it still doesn't work. Has anyone reached a fix for an ~amd64 box?

Yup, see here:
http://forums.gentoo.org/viewtopic-t-764144.html
_________________
rm -rf /
Back to top
View user's profile Send private message
MalleRIM
Guru
Guru


Joined: 23 Jul 2007
Posts: 540
Location: Germany

PostPosted: Tue Oct 13, 2009 8:33 pm    Post subject: Reply with quote

Simply deleting the libraries will force googleearth to use the system libraries. There is no need of symlinking. But, is there a possibility to use any non-standard Qt-style such as bespin or oxygen?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum