gnu: godot: Install provided .desktop file and icons.

* gnu/packages/game-development.scm (godot)[arguments]: Install the provided
godot.desktop instead of creating a new one.  Copy icons to the correct
location in share/icons/hicolor as per XDG.

Signed-off-by: Nicolas Goaziou <mail@nicolasgoaziou.fr>
This commit is contained in:
Timotej Lazar 2020-05-17 17:55:19 +02:00 committed by Nicolas Goaziou
parent 545511df77
commit bf076da917
No known key found for this signature in database
GPG key ID: DA00B4F048E92F2D

View file

@ -1644,24 +1644,18 @@ (define-public godot
(add-after 'install 'install-godot-desktop (add-after 'install 'install-godot-desktop
(lambda* (#:key outputs #:allow-other-keys) (lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out")) (let* ((out (assoc-ref outputs "out"))
(desktop (string-append out "/share/applications")) (applications (string-append out "/share/applications"))
(icon-dir (string-append out "/share/pixmaps"))) (icons (string-append out "/share/icons/hicolor")))
(rename-file "icon.png" "godot.png") (mkdir-p applications)
(install-file "godot.png" icon-dir) (copy-file "misc/dist/linux/org.godotengine.Godot.desktop"
(mkdir-p desktop) (string-append applications "/godot.desktop"))
(with-output-to-file (for-each (lambda (icon dest)
(string-append desktop "/godot.desktop") (mkdir-p (dirname dest))
(lambda _ (copy-file icon dest))
(format #t '("icon.png" "icon.svg")
"[Desktop Entry]~@ `(,(string-append icons "/256x256/apps/godot.png")
Name=godot~@ ,(string-append icons "/scalable/apps/godot.svg"))))
Comment=The godot game engine~@ #t)))))
Exec=~a/bin/godot~@
TryExec=~@*~a/bin/godot~@
Icon=godot~@
Type=Application~%"
out)))
#t))))))
(outputs '("out" "headless")) (outputs '("out" "headless"))
(native-inputs `(("pkg-config" ,pkg-config))) (native-inputs `(("pkg-config" ,pkg-config)))
(inputs `(("alsa-lib" ,alsa-lib) (inputs `(("alsa-lib" ,alsa-lib)