godot: Add major version to binaries and desktop entries

Fixes #235384 Godot 3 and Godot 4 share same desktop entry, thus not possible to install both at the same time.
This commit is contained in:
LoveIsGrief 2023-06-01 22:30:08 +02:00
parent 1b5c793b59
commit d8eab115b6
No known key found for this signature in database
GPG Key ID: E96D1EDFA05345EB
2 changed files with 11 additions and 9 deletions

View File

@ -79,9 +79,9 @@ stdenv.mkDerivation rec {
installPhase = ''
mkdir -p "$out/bin"
cp bin/godot.* $out/bin/godot
cp bin/godot.* $out/bin/godot3
wrapProgram "$out/bin/godot" \
wrapProgram "$out/bin/godot3" \
--set ALSA_PLUGIN_DIR ${alsa-plugins}/lib/alsa-lib
mkdir "$dev"
@ -91,11 +91,12 @@ stdenv.mkDerivation rec {
cp misc/dist/linux/godot.6 "$man/share/man/man6/"
mkdir -p "$out"/share/{applications,icons/hicolor/scalable/apps}
cp misc/dist/linux/org.godotengine.Godot.desktop "$out/share/applications/"
cp misc/dist/linux/org.godotengine.Godot.desktop "$out/share/applications/org.godotengine.Godot3.desktop"
cp icon.svg "$out/share/icons/hicolor/scalable/apps/godot.svg"
cp icon.png "$out/share/icons/godot.png"
substituteInPlace "$out/share/applications/org.godotengine.Godot.desktop" \
--replace "Exec=godot" "Exec=$out/bin/godot"
substituteInPlace "$out/share/applications/org.godotengine.Godot3.desktop" \
--replace "Exec=godot" "Exec=$out/bin/godot3" \
--replace "Godot Engine" "Godot Engine 3"
'';
meta = with lib; {

View File

@ -109,14 +109,15 @@ stdenv.mkDerivation rec {
installPhase = ''
mkdir -p "$out/bin"
cp bin/godot.* $out/bin/godot
cp bin/godot.* $out/bin/godot4
installManPage misc/dist/linux/godot.6
mkdir -p "$out"/share/{applications,icons/hicolor/scalable/apps}
cp misc/dist/linux/org.godotengine.Godot.desktop "$out/share/applications/"
substituteInPlace "$out/share/applications/org.godotengine.Godot.desktop" \
--replace "Exec=godot" "Exec=$out/bin/godot"
cp misc/dist/linux/org.godotengine.Godot.desktop "$out/share/applications/org.godotengine.Godot4.desktop"
substituteInPlace "$out/share/applications/org.godotengine.Godot4.desktop" \
--replace "Exec=godot" "Exec=$out/bin/godot4" \
--replace "Godot Engine" "Godot Engine 4"
cp icon.svg "$out/share/icons/hicolor/scalable/apps/godot.svg"
cp icon.png "$out/share/icons/godot.png"
'';