[Top][All Lists]

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

[bug#55424] [PATCH 081/602] gnu: renpy: Build with Python 3.

From: Maxim Cournoyer
Subject: [bug#55424] [PATCH 081/602] gnu: renpy: Build with Python 3.
Date: Fri, 17 Jun 2022 01:09:05 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux)

Hi Liliana,

We have a nice opportunity at the moment to truly phase out Python 2
from Guix, with just a handful packages remaining that still depend on
it, so I'd like to focus on options other than re-introducing Python 2
dependencies at first.

I tried updating the package like so:

--8<---------------cut here---------------start------------->8---
diff --git a/gnu/packages/game-development.scm 
index 4c1b97f041..89602dc127 100644
--- a/gnu/packages/game-development.scm
+++ b/gnu/packages/game-development.scm
@@ -1208,7 +1208,8 @@ (define-public python-pygame
 (define-public python-pygame-sdl2
   (let ((real-version "2.1.0")
-        (renpy-version "7.4.11"))
+        ;; Use a pre-release version to match that of Renpy.
+        (renpy-version "8.0.0"))
       (inherit python-pygame)
       (name "python-pygame-sdl2")
@@ -1216,17 +1217,16 @@ (define-public python-pygame-sdl2
          (method url-fetch)
-         (uri (string-append ""; renpy-version
+         (uri (string-append "";
                              "/pygame_sdl2-" version ".tar.gz"))
-         (sha256 (base32 
+         (sha256 (base32 
          (modules '((guix build utils)))
              ;; drop generated sources
              (delete-file-recursively "gen")
              (delete-file-recursively "gen3")
-             (delete-file-recursively "gen-static")
-             #t))))
+             (delete-file-recursively "gen-static")))))
       (build-system python-build-system)
        `(#:tests? #f                ; tests require pygame to be installed 
@@ -1243,8 +1243,7 @@ (define-public python-pygame-sdl2
                                       (assoc-ref inputs "sdl-union")
                                       "/lib -Wl,-rpath,"
                                       (assoc-ref inputs "sdl-union")
-                                      "/lib -Wl,--enable-new-dtags -lSDL2"))
-               #t)))))
+                                      "/lib -Wl,--enable-new-dtags 
        (list (sdl-union (list sdl2 sdl2-image sdl2-mixer sdl2-ttf))))
@@ -1260,22 +1259,23 @@ (define-public python-pygame-sdl2
 (define-public renpy
     (name "renpy")
-    (version "7.4.11")
-    (source
-     (origin
-       (method url-fetch)
-       (uri (string-append ""; version
-                           "/renpy-" version "-source.tar.bz2"))
-       (sha256 (base32 "0zkhg2sd2hglm9dkansf4h8sq7lm7iqslzl763ambp4kyfdvd07q"))
-       (modules '((guix build utils)))
-       (patches
-        (search-patches
-         "renpy-use-system-fribidi.patch"))
-       (snippet
-        '(with-directory-excursion "module"
-           ;; drop fribidi sources
-           (delete-file-recursively "fribidi-src")
-           #t))))
+    ;; Use a pre-release version to avoid Python 2, which the last stable 7.5
+    ;; release is still using.
+    (version "8.0.0")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "";
+                                  "/renpy-" version "-source.tar.bz2"))
+              (modules '((guix build utils)))
+              (snippet
+               '(with-directory-excursion "module"
+                  ;; drop fribidi sources
+                  (delete-file-recursively "fribidi-src")))
+              (sha256
+               (base32
+                "0bxihc8lkjmp769i4ih74si76i0lvdw86dg5j005kbj4m4cpvvax"))
+              (patches
+               (search-patches "renpy-use-system-fribidi.patch"))))
     (build-system python-build-system)
      `(#:tests? #f                      ; Ren'py doesn't seem to package tests
@@ -1299,7 +1299,7 @@ (define-public renpy
              (setenv "RENPY_DEPS_INSTALL" (string-join (map cdr inputs) ":"))))
          (replace 'build
-           (lambda* (#:key inputs outputs #:allow-other-keys #:rest args)
+           (lambda args
              ;; The "module" subdirectory contains a python (really cython)
              ;; project, which is built using a script, that is thankfully
              ;; named "".
--8<---------------cut here---------------end--------------->8---

It currently fails to build due to a new dependency, 'tinyfiledialogs':

--8<---------------cut here---------------start------------->8---
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall 
-fno-semantic-interposition -fPIC -I. 
-c gen3/_renpytfd.c -o build/temp.linux-x86_64-3.9/gen3/_renpytfd.o -std=gnu99 
gen3/_renpytfd.c:618:10: fatal error: tinyfiledialogs/tinyfiledialogs.h: No 
such file or directory
  618 | #include "tinyfiledialogs/tinyfiledialogs.h"
--8<---------------cut here---------------end--------------->8---

> OTOH if our stance is that we really
> don't want any python 2 stuff in Guix and rather have people use time
> machine, I think we should loudly break the package (by removing it)
> rather than silently.

That appears to be exactly what NixOS has done:

$ nix edit nixpkgs#renpy
error: renpy has been removed from nixpkgs, it was unmaintained and the
latest packaged version required python2

I think finishing the update started above would be a better option than
removing it, if we have the bandwidth to tackle the update.  Would you
like to give it a try?



reply via email to

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