From 6c03d15d7d84c00b02efea0a60e91f55f5541b57 Mon Sep 17 00:00:00 2001
From: Tobias Geerinckx-Rice <me@tobias.gr>
Date: Fri, 16 Oct 2020 21:07:06 +0200
Subject: [PATCH] gnu: grass: Fix start-up without python@3 in profile.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* gnu/packages/geo.scm (grass)[arguments]: Rename ‘wrap-python’ phase to
‘python:wrap’.  Add ‘wrap-with-python-interpreter’ phase.
---
 gnu/packages/geo.scm | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/geo.scm b/gnu/packages/geo.scm
index b094b55c2a6..09afa658c7a 100644
--- a/gnu/packages/geo.scm
+++ b/gnu/packages/geo.scm
@@ -1865,8 +1865,14 @@ (define-public grass
                  (symlink (string-append dir "/lib")
                           (string-append out "/lib")))
                #t))
-           (add-after 'install-links 'wrap-python
-             (assoc-ref python:%standard-phases 'wrap)))))
+           (add-after 'install-links 'python:wrap
+             (assoc-ref python:%standard-phases 'wrap))
+           (add-after 'python:wrap 'wrap-with-python-interpreter
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let ((out (assoc-ref outputs "out")))
+                 (wrap-program (string-append out "/bin/" ,grassxx)
+                   `("GRASS_PYTHON" = (,(which "python3"))))
+                 #t))))))
       (synopsis "GRASS Geographic Information System")
       (description
        "GRASS (Geographic Resources Analysis Support System), is a Geographic
-- 
GitLab