Subject: bug#47765: closed (Re: [PATCH] gnu: minetest: Fix absolute path to 'rm' command.)

From: [email-masked] (GNU bug Tracking System)
Date: Wed, 14 Apr 2021 07:46:02 +0000

Your bug report

#47765: [PATCH] gnu: minetest: Fix absolute path to 'rm' command.

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
47765: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=47765
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: [PATCH] gnu: minetest: Fix absolute path to 'rm' command.
From: Leo Prikler <[email-masked]>
To: "Hass, Trevor Stenten" <[email-masked]>, [email-masked]
Date: Wed, 14 Apr 2021 09:45:33 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi Trevor,
Am Mittwoch, den 14.04.2021, 03:53 +0000 schrieb Hass, Trevor Stenten:
> Hello Guix,
> 
> The attached patch resolves an issue where Minetest cannot delete
> worlds or downloaded content.
I've pushed it with some cosmetic changes as
c5e149a9d9cf25c68da817f46ea0cbf5442d39bd.

Thanks,
Leo

Subject: [PATCH] gnu: minetest: Fix absolute path to 'rm' command.
From: "Hass, Trevor Stenten" <[email-masked]>
To: "[email-masked]" <[email-masked]>
Date: Wed, 14 Apr 2021 03:53:12 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello Guix,

The attached patch resolves an issue where Minetest cannot delete worlds or downloaded content.

Thank you,
Trevor
From b420ef5912b6b04023991f44db3e8a4f32091022 Mon Sep 17 00:00:00 2001
From: Trevor Hass <[email-masked]>
Date: Tue, 13 Apr 2021 22:05:08 -0500
Subject: [PATCH] gnu: minetest: Fix absolute path to 'rm' command.

* gnu/packages/games.scm (minetest): Add 'set-rm' phase to substitute absolute path to 'rm'.  Add 'coreutils' to inputs.
---
 gnu/packages/games.scm | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index dbc72446b2..6dedfa7419 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -52,7 +52,7 @@
 ;;; Copyright © 2020 Jack Hill <[email-masked]>
 ;;; Copyright © 2020 Vincent Legoll <[email-masked]>
 ;;; Copyright © 2020, 2021 Michael Rohleder <[email-masked]>
-;;; Copyright © 2020 Trevor Hass <[email-masked]>
+;;; Copyright © 2020, 2021 Trevor Hass <[email-masked]>
 ;;; Copyright © 2020, 2021 Leo Prikler <[email-masked]>
 ;;; Copyright © 2020 Lu hux <[email-masked]>
 ;;; Copyright © 2020 Tomás Ortín Fernández <[email-masked]>
@@ -3496,6 +3496,12 @@ match, cannon keep, and grave-itation pit.")
              (setenv "MINETEST_SUBGAME_PATH"
                      (string-append (getcwd) "/games")) ; for check
              #t))
+         (add-after 'unpack 'set-rm
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "src/filesys.cpp"
+               (("\"/bin/rm\"")
+                (string-append "\"" (assoc-ref inputs "coreutils") "/bin/rm\"")))
+             #t))
          (replace 'check
            (lambda _
              ;; Thanks to our substitutions, the tests should also run
@@ -3511,7 +3517,8 @@ match, cannon keep, and grave-itation pit.")
     (native-inputs
      `(("pkg-config" ,pkg-config)))
     (inputs
-     `(("curl" ,curl)
+     `(("coreutils" ,coreutils)
+       ("curl" ,curl)
        ("freetype" ,freetype)
        ("gettext" ,gettext-minimal)
        ("gmp" ,gmp)
-- 
2.31.1