From 5f9b8ceff978718e6e28e795d5d781cc24238dd4 Mon Sep 17 00:00:00 2001 From: Sughosha Date: Thu, 23 Apr 2026 09:10:39 +0530 Subject: gnu: ring-racers: Install icon and create desktop entry. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/games.scm (ring-racers)[source]: Rename the icon file. [arguments]<#:phases>: Remove ‘move-and-wrap-binary’ phase. Use replacement for ‘install’. Add ‘wrap-program’ and ‘create-desktop-entry’. Change-Id: I0165f931132fe025731f92c15ff8df4d788f81fa Signed-off-by: Liliana Marie Prikler --- gnu/packages/games.scm | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm index 3d8c7e1945..f686ea6b12 100644 --- a/gnu/packages/games.scm +++ b/gnu/packages/games.scm @@ -5344,7 +5344,9 @@ also available.") (with-directory-excursion "src" (substitute* "CMakeLists.txt" (("glm::glm") - "glm"))))))) + "glm"))) + ;; Rename the icon to match with the executable file. + (rename-file "srb2.png" "ringracers.png"))))) (build-system cmake-build-system) (arguments (list @@ -5354,15 +5356,30 @@ also available.") "-DCMAKE_CXX_FLAGS_RELWITHDEBINFO='-O3 -g -DNDEBUG'") #:phases #~(modify-phases %standard-phases - (add-after 'install 'move-and-wrap-binary + (replace 'install + (lambda _ + (install-file "bin/ringracers" (string-append #$output "/bin")) + (install-file "../source/ringracers.png" + (string-append #$output "/share/pixmaps")))) + (add-after 'install 'wrap-program ;; Install executable to $out/bin. (lambda* (#:key inputs #:allow-other-keys) - (with-directory-excursion #$output - (mkdir "bin") - (rename-file "ringracers" "bin/ringracers") - (wrap-program "bin/ringracers" - `("RINGRACERSWADDIR" = - (,(assoc-ref inputs "ring-racers-data")))))))))) + (wrap-program "bin/ringracers" + `("RINGRACERSWADDIR" = + (,(assoc-ref inputs "ring-racers-data")))))) + (add-after 'wrap-program 'create-desktop-entry + (lambda _ + (let* ((datadir (string-append #$output "/share")) + (appdir (string-append datadir "/applications"))) + (mkdir-p appdir) + (make-desktop-entry-file (string-append appdir + "/ringracers.desktop") + #:name "Dr. Robotnik's Ring Racers" + #:comment "Technical kart racing game" + #:icon "ringracers" + #:exec (string-append #$output "/bin/ringracers") + #:startup-notify #f + #:categories '("Application" "Game")))))))) (native-inputs (list pkg-config)) (inputs (list glm libogg -- cgit v1.3