Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Maintainer: Det
- # Contributors: 458italia, Madek, Berseker, Syr
- # Check the latest version with: $ curl -s https://dl.google.com/dl/earth/client/current/google-earth-stable_current_x86_64.rpm | head -c96 | strings | cut -d "-" -f4
- # Attempt to fix crashes and blank Panoramio: "1" to enable.
- # - http://forums.fedoraforum.org/showthread.php?p=1678303#post1678303
- _attempt_fix=0
- # Build an unstable 64-bit build: "1" to enable.
- _64=0
- pkgname=google-earth
- pkgver=7.1.2.2041
- pkgrel=2
- pkgdesc="A 3D interface to view satellite images of Earth and other objects"
- arch=('i686' 'x86_64')
- url="https://www.google.com/earth/index.html"
- license=('custom:earth')
- depends=('desktop-file-utils' 'hicolor-icon-theme' 'ld-lsb>=3-5' 'lib32-fontconfig' 'lib32-glu' 'lib32-libgl' 'lib32-libsm'
- 'lib32-libxrender' 'lib32-mesa' 'shared-mime-info' 'xdg-utils')
- [[ $_attempt_fix = 1 ]] && depends+=('gcc-multilib' 'lib32-freeimage' 'lib32-libpng15' 'lib32-qt4')
- optdepends=('lib32-ati-dri: For the open source AMD/ATI Radeon driver'
- 'lib32-catalyst-utils: For AMD Catalyst'
- 'lib32-intel-dri: For the open source Intel driver'
- 'lib32-nouveau-dri: For the open source Nouveau driver'
- 'lib32-nvidia-utils: For the NVIDIA driver')
- _arch=i386
- if [[ $CARCH = x86_64 ]] && [[ $_64 = 1 ]]; then
- _arch=amd64
- fi
- if [[ $CARCH = i686 ]] || [[ $_arch = amd64 ]]; then
- depends=('desktop-file-utils' 'fontconfig' 'glu' 'hicolor-icon-theme' 'ld-lsb>=3-5' 'libgl' 'libsm' 'libxrender' 'mesa'
- 'shared-mime-info' 'xdg-utils')
- [[ $_attempt_fix = 1 ]] && depends+=('freeimage' 'libpng15' 'qtwebkit')
- optdepends=('ati-dri: For the open source AMD/ATI Radeon driver'
- 'catalyst-utils: For AMD Catalyst'
- 'intel-dri: For the open source Intel driver'
- 'nouveau-dri: For the open source Nouveau driver'
- 'nvidia-utils: For the NVIDIA driver')
- fi
- options=('!emptydirs')
- install=$pkgname.install
- source=("$pkgname-stable_${pkgver}_$_arch.deb::https://dl.google.com/earth/client/current/$pkgname-stable_current_$_arch.deb"
- 'googleearth'
- "$pkgname-mimetypes.xml"
- 'baifaao.cpp')
- md5sums=('c9675d0078d1b188188c9d3b616de6fa' # google-earth-stable_${pkgver}_i386.deb
- 'e84f5d51ea3545c131d1794f89f6464a' # googleearth
- 'e3c67b8d05c3de50535bd7e45eee728e' # google-earth-mimetypes.xml
- '598d579a1c3199c77850d86ba78f7b44') # baifaao.cpp
- [[ $_arch = amd64 ]] && md5sums[0]='6979fd255895891fea8c98fa02fd243d' # google-earth-stable_${pkgver}_amd64.deb
- _instdir=/opt/google/earth/free/
- # Build() the baifaao.so
- if [[ $_attempt_fix = 1 ]]; then
- # bin32?
- if [[ $CARCH = x86_64 ]] && [[ $_64 != 1 ]]; then
- _m32=-m32
- fi
- build() {
- gcc -vI /usr/include/qt4/ $_m32 -O3 -fPIC --shared baifaao.cpp -o baifaao.so
- }
- fi
- package() {
- msg2 "Extracting the data.tar.lzma"
- bsdtar -xvf data.tar.lzma -C "$pkgdir/"
- msg2 "Moving stuff in place"
- # The .desktop
- mv -v "$pkgdir"/$_instdir/$pkgname.desktop "$pkgdir"/usr/share/applications/
- # Icons
- for i in 16 22 24 32 48 64 128 256; do
- install -vDm644 "$pkgdir"/$_instdir/product_logo_$i.png "$pkgdir"/usr/share/icons/hicolor/${i}x$i/apps/$pkgname.png
- done
- # The MIME package
- install -vDm644 $pkgname-mimetypes.xml "$pkgdir"/usr/share/mime/packages/$pkgname-mimetypes.xml
- # The license (too many different ones to do this in "source=()")
- install -d "$pkgdir"/usr/share/licenses/$pkgname/
- curl -Lv ${url/i*}/license.html -o "$pkgdir"/usr/share/licenses/$pkgname/license.html
- msg2 "Removing the Debian-intended cron job and duplicated images"
- rm -rv "$pkgdir"/etc/cron.daily/ "$pkgdir"/$_instdir/product_logo_*.png
- if [[ $_attempt_fix = 1 ]]; then
- msg2 "Attempting a fix on Panoramio and certain crashes"
- # Install baifaao.so
- install -vm755 baifaao.so "$pkgdir"/$_instdir/
- # Preload it
- install -vm755 googleearth "$pkgdir"/$_instdir/
- # bin32?
- if [[ "$_m32" ]]; then
- sed -i "s,/usr/lib,/usr/lib32,g" "$pkgdir"/$_instdir/googleearth
- fi
- # Remove the old, bundled Qt libs
- rm -v "$pkgdir"/$_instdir/libQt*
- fi
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement