GNU bug report logs - #62902
[PATCH 0/3] Fixing laby.

Previous Next

Package: guix-patches;

Reported by: Ivana Drazovic <iv.dra <at> hotmail.com>

Date: Mon, 17 Apr 2023 13:19:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 62902 in the body.
You can then email your comments to 62902 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#62902; Package guix-patches. (Mon, 17 Apr 2023 13:19:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ivana Drazovic <iv.dra <at> hotmail.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Mon, 17 Apr 2023 13:19:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ivana Drazovic <iv.dra <at> hotmail.com>
To: guix-patches <at> gnu.org
Cc: Ivana Drazovic <iv.dra <at> hotmail.com>
Subject: [PATCH 0/3] Fixing laby.
Date: Mon, 17 Apr 2023 11:52:57 +0200
These patches make laby work properly again.

Ivana Drazovic (3):
  gnu: laby: Use new package style.
  gnu: laby: Make laby function in pure environments.
  gnu: laby: Add patch for being able to execute game code.

 gnu/local.mk                                  |  2 +
 gnu/packages/games.scm                        | 48 +++++++++++++------
 .../laby-use-tmpdir-from-runtime.patch        | 39 +++++++++++++++
 3 files changed, 74 insertions(+), 15 deletions(-)
 create mode 100644 gnu/packages/patches/laby-use-tmpdir-from-runtime.patch


base-commit: c9af27d4ca733b20f09019f1465d3e5fdc1ec724
-- 
2.34.1





Information forwarded to guix-patches <at> gnu.org:
bug#62902; Package guix-patches. (Wed, 19 Apr 2023 19:59:04 GMT) Full text and rfc822 format available.

Message #8 received at 62902 <at> debbugs.gnu.org (full text, mbox):

From: Ivana Drazovic <iv.dra <at> hotmail.com>
To: 62902 <at> debbugs.gnu.org
Cc: Ivana Drazovic <iv.dra <at> hotmail.com>,
 Florian Pelz <pelzflorian <at> pelzflorian.de>
Subject: [PATCH 1/3] gnu: laby: Use new package style.
Date: Wed, 19 Apr 2023 21:53:54 +0200
* gnu/packages/games.scm (laby)[arguments]: Use gexps.
Use "this-package-input" to locate package input.

Co-authored-by: Florian Pelz <pelzflorian <at> pelzflorian.de>
---
 gnu/packages/games.scm | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 5825b8d936..6a404d7712 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -75,6 +75,8 @@
 ;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
 ;;; Copyright © 2022 Hendursaga <hendursaga <at> aol.com>
 ;;; Copyright © 2022 Parnikkapore <poomklao <at> yahoo.com>
+;;; Copyright © 2023 Florian Pelz <pelzflorian <at> pelzflorian.de>
+;;; Copyright © 2023 Ivana Drazovic <iv.dra <at> hotmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -5777,17 +5779,17 @@ (define-public laby
     (inputs
      (list lablgtk3 ocaml-lablgtk3-sourceview3 ocaml ocaml-findlib ocamlbuild))
     (arguments
-     '(#:phases
-       (modify-phases %standard-phases
-         (delete 'configure)
-         (add-before 'build 'set-library-path
-           (lambda* (#:key inputs #:allow-other-keys)
-             (let ((lablgtk (assoc-ref inputs "lablgtk")))
-               (setenv "LD_LIBRARY_PATH"
-                       (string-append lablgtk "/lib/ocaml/stublibs"))))))
-       #:tests? #f ; no 'check' target
-       #:make-flags
-       (list (string-append "PREFIX=" (assoc-ref %outputs "out")) "all")))
+     (list #:phases
+           #~(modify-phases %standard-phases
+               (delete 'configure)
+               (add-before 'build 'set-library-path
+                 (lambda* (#:key inputs #:allow-other-keys)
+                   (let ((lablgtk #$(this-package-input "lablgtk")))
+                     (setenv "LD_LIBRARY_PATH"
+                             (string-append lablgtk "/lib/ocaml/stublibs"))))))
+           #:tests? #f ; no 'check' target
+           #:make-flags
+           #~(list (string-append "PREFIX=" #$output) "all")))
     (home-page "https://sgimenez.github.io/laby/")
     (synopsis "Programming game")
     (description "Learn programming, playing with ants and spider webs ;-)
-- 
2.34.1





Information forwarded to guix-patches <at> gnu.org:
bug#62902; Package guix-patches. (Wed, 19 Apr 2023 19:59:04 GMT) Full text and rfc822 format available.

Message #11 received at 62902 <at> debbugs.gnu.org (full text, mbox):

From: Ivana Drazovic <iv.dra <at> hotmail.com>
To: 62902 <at> debbugs.gnu.org
Cc: Ivana Drazovic <iv.dra <at> hotmail.com>,
 Florian Pelz <pelzflorian <at> pelzflorian.de>
Subject: [PATCH 2/3] gnu: laby: Make laby function in pure environments.
Date: Wed, 19 Apr 2023 21:53:55 +0200
* gnu/packages/games.scm (laby)
[build-system]: Switch to 'glib-or-gtk-build-system'.
[inputs]: Add 'gdk-pixbuf' and 'librsvg-for-system'.
[arguments]: Wrap to use SVG-enabled pixbuf loaders.cache.

Co-authored-by: Florian Pelz <pelzflorian <at> pelzflorian.de>
---
 gnu/packages/games.scm | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 6a404d7712..ed06a57636 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -218,6 +218,7 @@ (define-module (gnu packages games)
   #:use-module (gnu packages xml)
   #:use-module (guix build-system copy)
   #:use-module (guix build-system cmake)
+  #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system go)
   #:use-module (guix build-system meson)
@@ -5775,9 +5776,15 @@ (define-public laby
               (base32
                "1y6nfxcjhqg9bb81hs0wijg7kcwk5kff81rgd8bsv5ps7ia9nj6b"))
              (patches (search-patches "laby-make-install.patch"))))
-    (build-system gnu-build-system)
+    (build-system glib-or-gtk-build-system)
     (inputs
-     (list lablgtk3 ocaml-lablgtk3-sourceview3 ocaml ocaml-findlib ocamlbuild))
+     (list gdk-pixbuf
+           lablgtk3
+           (librsvg-for-system)
+           ocaml-lablgtk3-sourceview3
+           ocaml
+           ocaml-findlib
+           ocamlbuild))
     (arguments
      (list #:phases
            #~(modify-phases %standard-phases
@@ -5786,7 +5793,15 @@ (define-public laby
                  (lambda* (#:key inputs #:allow-other-keys)
                    (let ((lablgtk #$(this-package-input "lablgtk")))
                      (setenv "LD_LIBRARY_PATH"
-                             (string-append lablgtk "/lib/ocaml/stublibs"))))))
+                             (string-append lablgtk "/lib/ocaml/stublibs")))))
+               (add-after 'glib-or-gtk-wrap 'wrap-pixbuf
+                  (lambda* (#:key outputs #:allow-other-keys)
+                    (let ((laby (string-append #$output "/bin/laby")))
+                      (wrap-program laby
+                        ;; Wrapping GDK_PIXBUF_MODULE_FILE allows laby to
+                        ;; function in pure environments.
+                        `("GDK_PIXBUF_MODULE_FILE" =
+                          (,(getenv "GDK_PIXBUF_MODULE_FILE"))))))))
            #:tests? #f ; no 'check' target
            #:make-flags
            #~(list (string-append "PREFIX=" #$output) "all")))
-- 
2.34.1





Information forwarded to guix-patches <at> gnu.org:
bug#62902; Package guix-patches. (Wed, 19 Apr 2023 19:59:04 GMT) Full text and rfc822 format available.

Message #14 received at 62902 <at> debbugs.gnu.org (full text, mbox):

From: Ivana Drazovic <iv.dra <at> hotmail.com>
To: 62902 <at> debbugs.gnu.org
Cc: Ivana Drazovic <iv.dra <at> hotmail.com>
Subject: [PATCH 3/3] gnu: laby: Add patch for being able to execute game code.
Date: Wed, 19 Apr 2023 21:53:56 +0200
Reported upstream at https://github.com/sgimenez/laby/pull/68

* gnu/packages/patches/laby-use-tmpdir-from-runtime.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/games.scm (laby)[source]: Use it.
---
 gnu/local.mk                                  |  2 +
 gnu/packages/games.scm                        |  3 +-
 .../laby-use-tmpdir-from-runtime.patch        | 39 +++++++++++++++++++
 3 files changed, 43 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/laby-use-tmpdir-from-runtime.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 64a1268fbe..2d8741223b 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -57,6 +57,7 @@
 # Copyright © 2022 ( <paren <at> disroot.org>
 # Copyright © 2022 jgart <jgart <at> dismail.de>
 # Copyright © 2023 Zheng Junjie <873216071 <at> qq.com>
+# Copyright © 2023 Ivana Drazovic <iv.dra <at> hotmail.com>
 #
 # This file is part of GNU Guix.
 #
@@ -1417,6 +1418,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/kodi-set-libcurl-ssl-parameters.patch		\
   %D%/packages/patches/kwayland-skip-flaky-test.patch		\
   %D%/packages/patches/laby-make-install.patch			\
+  %D%/packages/patches/laby-use-tmpdir-from-runtime.patch	\
   %D%/packages/patches/ldns-drill-examples.patch		\
   %D%/packages/patches/leela-zero-gtest.patch			\
   %D%/packages/patches/less-hurd-path-max.patch			\
diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index ed06a57636..79d5cb0c0c 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -5775,7 +5775,8 @@ (define-public laby
              (sha256
               (base32
                "1y6nfxcjhqg9bb81hs0wijg7kcwk5kff81rgd8bsv5ps7ia9nj6b"))
-             (patches (search-patches "laby-make-install.patch"))))
+             (patches (search-patches "laby-make-install.patch"
+                                      "laby-use-tmpdir-from-runtime.patch"))))
     (build-system glib-or-gtk-build-system)
     (inputs
      (list gdk-pixbuf
diff --git a/gnu/packages/patches/laby-use-tmpdir-from-runtime.patch b/gnu/packages/patches/laby-use-tmpdir-from-runtime.patch
new file mode 100644
index 0000000000..ea6324a91b
--- /dev/null
+++ b/gnu/packages/patches/laby-use-tmpdir-from-runtime.patch
@@ -0,0 +1,39 @@
+Reported as <https://github.com/sgimenez/laby/pull/68>
+
+diff --git a/build b/build
+index 992a9e3..0df74d9 100755
+--- a/build
++++ b/build
+@@ -7,7 +7,6 @@ source build.conf || exit 1
+ 
+ export PREFIX=${PREFIX-/usr}
+ export DATADIR=${DATADIR-${PREFIX}/share}
+-export TMPDIR=${TMPDIR-/tmp}
+ 
+ export PROJECT_NAME=${PROJECT_NAME-unknown}
+ export PROJECT_VERSION=${PROJECT_VERSION-unknown}
+diff --git a/src/config.sh b/src/config.sh
+index 19d4160..9338aad 100644
+--- a/src/config.sh
++++ b/src/config.sh
+@@ -29,5 +29,4 @@ let build_ocaml = "${OCAML_VERSION}"
+ let build_lablgtk = "${BUILD_LABLGTK}"
+ let build_lablgtk_sourceview = "${BUILD_LABLGTKSV}"
+ let _ = Res.sys_data_dir := "${DATADIR}"
+-let _ = Res.sys_tmp_dir := "${TMPDIR}"
+ EOF
+diff --git a/src/laby.ml b/src/laby.ml
+index b77f2b2..e17acb9 100644
+--- a/src/laby.ml
++++ b/src/laby.ml
+@@ -48,6 +48,7 @@ let opts =
+ 
+ let _ =
+   Printexc.record_backtrace true;
++  Res.sys_tmp_dir := Filename.get_temp_dir_name ();
+   Run.init
+     ~name:Config.project_name
+     ~conf:(conf, ["conf"])
+-- 
+2.34.1
+
-- 
2.34.1





Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Thu, 11 May 2023 12:49:02 GMT) Full text and rfc822 format available.

Notification sent to Ivana Drazovic <iv.dra <at> hotmail.com>:
bug acknowledged by developer. (Thu, 11 May 2023 12:49:02 GMT) Full text and rfc822 format available.

Message #19 received at 62902-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Ivana Drazovic <iv.dra <at> hotmail.com>
Cc: 62902-done <at> debbugs.gnu.org
Subject: Re: bug#62902: [PATCH 0/3] Fixing laby.
Date: Thu, 11 May 2023 14:48:42 +0200
Hi,

Ivana Drazovic <iv.dra <at> hotmail.com> skribis:

>   gnu: laby: Use new package style.
>   gnu: laby: Make laby function in pure environments.
>   gnu: laby: Add patch for being able to execute game code.

Finally applied, thanks!

Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 09 Jun 2023 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 293 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.