2021-04-24 19:18:47 +02:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, mkDerivation
|
|
|
|
, fetchurl
|
|
|
|
, freetype
|
|
|
|
, glib
|
|
|
|
, libGL
|
|
|
|
, libGLU
|
|
|
|
, libSM
|
|
|
|
|
|
|
|
, libXrender
|
|
|
|
, libX11
|
|
|
|
|
|
|
|
, libxcb
|
|
|
|
, sqlite
|
|
|
|
, zlib
|
|
|
|
, fontconfig
|
|
|
|
, dpkg
|
|
|
|
, libproxy
|
|
|
|
, libxml2
|
|
|
|
, gst_all_1
|
|
|
|
, dbus
|
|
|
|
, makeWrapper
|
|
|
|
|
2021-10-30 22:35:36 +02:00
|
|
|
, cups
|
|
|
|
, alsa-lib
|
2021-04-24 19:18:47 +02:00
|
|
|
|
|
|
|
, xkeyboardconfig
|
|
|
|
, autoPatchelfHook
|
|
|
|
}:
|
2021-04-11 02:45:27 +02:00
|
|
|
let
|
|
|
|
arch =
|
|
|
|
if stdenv.hostPlatform.system == "x86_64-linux" then "amd64"
|
|
|
|
else throw "Unsupported system ${stdenv.hostPlatform.system} ";
|
|
|
|
in
|
2021-04-24 19:18:47 +02:00
|
|
|
mkDerivation rec {
|
2021-04-11 02:45:27 +02:00
|
|
|
pname = "googleearth-pro";
|
2021-10-30 22:35:36 +02:00
|
|
|
version = "7.3.4.8248";
|
2021-04-11 02:45:27 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://dl.google.com/linux/earth/deb/pool/main/g/google-earth-pro-stable/google-earth-pro-stable_${version}-r0_${arch}.deb";
|
2021-10-30 22:35:36 +02:00
|
|
|
sha256 = "1pbapi267snlrjari5k93y6kbrjsqhqxgkxxqaqv4r25az00dx6d";
|
2021-04-11 02:45:27 +02:00
|
|
|
};
|
|
|
|
|
2021-04-24 19:18:47 +02:00
|
|
|
nativeBuildInputs = [ dpkg makeWrapper autoPatchelfHook ];
|
2021-04-23 21:35:52 +02:00
|
|
|
propagatedBuildInputs = [ xkeyboardconfig ];
|
2021-04-24 19:18:47 +02:00
|
|
|
buildInputs = [
|
|
|
|
dbus
|
2021-10-30 22:35:36 +02:00
|
|
|
cups
|
2021-04-24 19:18:47 +02:00
|
|
|
fontconfig
|
|
|
|
freetype
|
|
|
|
glib
|
|
|
|
gst_all_1.gst-plugins-base
|
|
|
|
gst_all_1.gstreamer
|
|
|
|
libGL
|
|
|
|
libGLU
|
|
|
|
libSM
|
|
|
|
libX11
|
|
|
|
libXrender
|
|
|
|
libproxy
|
|
|
|
libxcb
|
|
|
|
libxml2
|
|
|
|
sqlite
|
|
|
|
zlib
|
2021-10-30 22:35:36 +02:00
|
|
|
alsa-lib
|
2021-04-24 19:18:47 +02:00
|
|
|
];
|
2021-04-11 02:45:27 +02:00
|
|
|
|
|
|
|
doInstallCheck = true;
|
|
|
|
|
|
|
|
dontBuild = true;
|
|
|
|
|
|
|
|
unpackPhase = ''
|
|
|
|
# deb file contains a setuid binary, so 'dpkg -x' doesn't work here
|
2023-04-23 14:29:19 +02:00
|
|
|
mkdir deb
|
|
|
|
dpkg --fsys-tarfile ${src} | tar --extract -C deb
|
2021-04-11 02:45:27 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase =''
|
2021-04-24 19:18:47 +02:00
|
|
|
runHook preInstall
|
|
|
|
|
2021-04-11 02:45:27 +02:00
|
|
|
mkdir $out
|
2023-04-23 14:29:19 +02:00
|
|
|
mv deb/usr/* $out/
|
|
|
|
rmdir deb/usr
|
|
|
|
mv deb/* $out/
|
2021-04-11 02:45:27 +02:00
|
|
|
rm $out/bin/google-earth-pro $out/opt/google/earth/pro/googleearth
|
|
|
|
|
|
|
|
# patch and link googleearth binary
|
|
|
|
ln -s $out/opt/google/earth/pro/googleearth-bin $out/bin/googleearth-pro
|
|
|
|
|
|
|
|
# patch and link gpsbabel binary
|
|
|
|
ln -s $out/opt/google/earth/pro/gpsbabel $out/bin/gpsbabel
|
|
|
|
|
|
|
|
# Add desktop config file and icons
|
|
|
|
mkdir -p $out/share/{applications,icons/hicolor/{16x16,22x22,24x24,32x32,48x48,64x64,128x128,256x256}/apps,pixmaps}
|
|
|
|
ln -s $out/opt/google/earth/pro/google-earth-pro.desktop $out/share/applications/google-earth-pro.desktop
|
|
|
|
sed -i -e "s|Exec=.*|Exec=$out/bin/googleearth-pro|g" $out/opt/google/earth/pro/google-earth-pro.desktop
|
|
|
|
for size in 16 22 24 32 48 64 128 256; do
|
|
|
|
ln -s $out/opt/google/earth/pro/product_logo_"$size".png $out/share/icons/hicolor/"$size"x"$size"/apps/google-earth-pro.png
|
|
|
|
done
|
|
|
|
ln -s $out/opt/google/earth/pro/product_logo_256.png $out/share/pixmaps/google-earth-pro.png
|
2021-04-24 19:18:47 +02:00
|
|
|
|
|
|
|
runHook postInstall
|
2021-04-11 02:45:27 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
installCheckPhase = ''
|
|
|
|
$out/bin/gpsbabel -V > /dev/null
|
|
|
|
'';
|
|
|
|
|
|
|
|
# wayland is not supported by Qt included in binary package, so make sure it uses xcb
|
2021-04-24 19:18:47 +02:00
|
|
|
postFixup = ''
|
2021-04-23 21:35:52 +02:00
|
|
|
wrapProgram $out/bin/googleearth-pro \
|
|
|
|
--set QT_QPA_PLATFORM xcb \
|
|
|
|
--set QT_XKB_CONFIG_ROOT "${xkeyboardconfig}/share/X11/xkb"
|
2021-04-11 02:45:27 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A world sphere viewer";
|
2021-04-24 19:18:47 +02:00
|
|
|
homepage = "https://www.google.com/earth/";
|
2022-06-05 00:19:25 +02:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
2021-04-11 02:45:27 +02:00
|
|
|
license = licenses.unfree;
|
2021-04-24 19:18:47 +02:00
|
|
|
maintainers = with maintainers; [ friedelino shamilton ];
|
2021-04-11 02:45:27 +02:00
|
|
|
platforms = platforms.linux;
|
2021-10-30 22:35:36 +02:00
|
|
|
knownVulnerabilities = [ "Includes vulnerable bundled libraries." ];
|
2021-04-11 02:45:27 +02:00
|
|
|
};
|
|
|
|
}
|