guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

75/163: gnu: roguebox-adventures: Wrap with the new Guix PYTHONPATH.


From: guix-commits
Subject: 75/163: gnu: roguebox-adventures: Wrap with the new Guix PYTHONPATH.
Date: Mon, 25 Jan 2021 02:01:35 -0500 (EST)

apteryx pushed a commit to branch cu/farewell-to-pythonpath
in repository guix.

commit 71b1cb64c6e504802efc7d7eddecedad6628afb4
Author: Maxim Cournoyer <maxim.cournoyer@gmail.com>
AuthorDate: Sat Jan 23 21:05:26 2021 -0500

    gnu: roguebox-adventures: Wrap with the new Guix PYTHONPATH.
    
    * gnu/packages/games.scm (roguebox-adventures):
    [phases]: Remove trailing #t.
    {install}: Wrap with the new Guix PYTHONPATH.
---
 gnu/packages/games.scm | 36 ++++++++++++++++++++----------------
 1 file changed, 20 insertions(+), 16 deletions(-)

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 1f9d784..5055395 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -56,6 +56,7 @@
 ;;; Copyright © 2020 Leo Prikler <leo.prikler@student.tugraz.at>
 ;;; Copyright © 2020 Lu hux <luhux@outlook.com>
 ;;; Copyright © 2020 Tomás Ortín Fernández <tomasortin@mailbox.org>
+;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -2067,12 +2068,12 @@ utilizing the art assets from the @code{SuperTux} 
project.")
                (substitute* "main.py"
                  (("home_save = False") "home_save = True")
                  (("'icon_small.png'")
-                  (string-append "'" data "/icon_small.png'"))))
-             #t))
+                  (string-append "'" data "/icon_small.png'"))))))
          (replace 'install
-           (lambda* (#:key outputs #:allow-other-keys)
+           (lambda* (#:key inputs outputs #:allow-other-keys)
              (let* ((out (assoc-ref outputs "out"))
                     (bin (string-append out "/bin"))
+                    (pythonpath (guix-pythonpath inputs))
                     (roguebox-adventures
                      (string-append bin "/roguebox-adventures"))
                     (data (string-append
@@ -2100,13 +2101,15 @@ utilizing the art assets from the @code{SuperTux} 
project.")
                  (lambda (p)
                    (format p "\
 #!~a
-export PYTHONPATH=~a/LIB:~a
+export ~a=~a/LIB:~a
 exec -a \"~a\" ~a \"$@\"\n"
-                           (which "bash") data (getenv "PYTHONPATH")
+                           (which "bash")
+                           pythonpath
+                           data
+                           (getenv pythonpath)
                            (which "python3")
                            (string-append lib "/main.py"))))
-               (chmod roguebox-adventures #o555))
-             #t)))))
+               (chmod roguebox-adventures #o555)))))))
     (native-inputs
      `(("unzip" ,unzip)))
     (inputs
@@ -2144,8 +2147,7 @@ can be explored and changed freely.")
        ;; Remove non-free (non-commercial) font.
        (snippet
         `(begin
-           (for-each delete-file (find-files "data/fonts" "."))
-           #t))))
+           (for-each delete-file (find-files "data/fonts" "."))))))
     (build-system python-build-system)
     (arguments
      `(#:tests? #f                      ;no test
@@ -2153,9 +2155,10 @@ can be explored and changed freely.")
        (modify-phases %standard-phases
          (delete 'build)                ;pure Python
          (replace 'install              ;no install script
-           (lambda* (#:key outputs #:allow-other-keys)
+           (lambda* (#:key inputs outputs #:allow-other-keys)
              (let* ((out (assoc-ref outputs "out"))
                     (bin (string-append out "/bin"))
+                    (pythonpath (guix-pythonpath inputs))
                     (share (string-append out "/share"))
                     (applications (string-append share "/applications"))
                     (data (string-append share "/seahorse-adventures")))
@@ -2176,9 +2179,12 @@ can be explored and changed freely.")
                    (lambda (p)
                      (format p
                              "#!~a~@
-                              export PYTHONPATH=~a:~a~@
+                              export ~a=~a:~a~@
                               exec -a \"~a\" ~a \"$@\"~%"
-                             (which "bash") data (getenv "PYTHONPATH")
+                             (which "bash")
+                             pythonpath
+                             data
+                             (getenv pythonpath)
                              (which "python3")
                              (string-append data "/run_game.py"))))
                  (chmod executable #o555))
@@ -2202,8 +2208,7 @@ can be explored and changed freely.")
                     (copy-file
                      (string-append "icon" size ".png")
                      (string-append dir "/searhorse-adventures.png"))))
-                '("32" "64" "128")))
-             #t))
+                '("32" "64" "128")))))
          (add-after 'install 'unbundle-fonts
            ;; Unbundle Bitstream Vera font and replace deleted one.
            (lambda* (#:key outputs inputs #:allow-other-keys)
@@ -2220,8 +2225,7 @@ can be explored and changed freely.")
                   '("default" "gray")))
                (symlink vera (string-append data "/data/fonts/04B_20__.TTF"))
                (substitute* (string-append data "/lib/main.py")
-                 (("f_scale = 0.35") "f_scale = 0.47")))
-             #t)))))
+                 (("f_scale = 0.35") "f_scale = 0.47"))))))))
     (inputs
      `(("font-bitstream-vera" ,font-bitstream-vera)
        ("python-pygame" ,python-pygame)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]