GNU bug report logs - #25908
[PATCH, WIP] Add godot.

Previous Next

Package: guix-patches;

Reported by: Christopher Allan Webber <cwebber <at> dustycloud.org>

Date: Wed, 1 Mar 2017 04:47:02 UTC

Severity: normal

Tags: patch

Merged with 28380

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

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 25908 in the body.
You can then email your comments to 25908 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#25908; Package guix-patches. (Wed, 01 Mar 2017 04:47:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Christopher Allan Webber <cwebber <at> dustycloud.org>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Wed, 01 Mar 2017 04:47:02 GMT) Full text and rfc822 format available.

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

From: Christopher Allan Webber <cwebber <at> dustycloud.org>
To: guix-patches <at> gnu.org
Subject: [PATCH, WIP] Add godot.
Date: Tue, 28 Feb 2017 22:46:16 -0600
[Message part 1 (text/plain, inline)]
This is still WIP, and unfortunately it doesn't work.  Here's the error
I got:

                 from ./drivers/pulseaudio/audio_driver_pulseaudio.h:36,
                 from platform/x11/os_x11.h:46,
                 from platform/x11/godot_x11.cpp:30:
  /gnu/store/iwgi9001dmmihrjg4rqhd6pa6788prjw-glibc-2.24/include/bits/local_lim.h:38:26: fatal error: linux/limits.h: No such file or directory
  #include <linux/limits.h>

I also get this if I try to build it outside the package, from a git
checkout of Godot.

I don't know why I'm experiencing this; I added linux-libre-headers as
an input.  It seems that I'm not the first one to experience this with
Guix packages... I ran across these:

  https://lists.gnu.org/archive/html/help-guix/2016-06/msg00130.html

(I don't think I need to include gcc-toolchain though)

  https://gnunet.org/bot/log/guix/2016-07-27
  https://gnunet.org/bot/log/guix/2016-08-03

looks like jlicht eventually found a solution, and lfam said
   <lfam> jlicht: Have you tried setting -I in #:make-flags or #:configure-flags?

... not sure how that helps with scons :)

Other potential issues:
 - bundles a number of packages (can they be easily unbundled?)
 - license field should probably reflect bundled packages
 - very badly snarfs a whole bunch of phases code from aria-maestosa,
   which itself suggests refactoring into a scons-build-system...

Nonetheless, uh, maybe it's a good starting point!

[0001-gnu-Add-godot.patch (text/x-patch, inline)]
From 8fe2eb621c0cc4556c112b0bd42714200f1332b2 Mon Sep 17 00:00:00 2001
From: Christopher Allan Webber <cwebber <at> dustycloud.org>
Date: Tue, 28 Feb 2017 22:39:38 -0600
Subject: [PATCH] gnu: Add godot.

* gnu/packages/game-development.scm (godot): New variable.
---
 gnu/packages/game-development.scm | 69 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 69 insertions(+)

diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm
index 619c2f1bc..2f03041b3 100644
--- a/gnu/packages/game-development.scm
+++ b/gnu/packages/game-development.scm
@@ -8,6 +8,7 @@
 ;;; Copyright © 2016 Kei Kebreau <kei <at> openmailbox.org>
 ;;; Copyright © 2016 Ricardo Wurmus <rekado <at> elephly.net>
 ;;; Copyright © 2016 Julian Graham <joolean <at> gmail.com>
+;;; Copyright © 2017 Christopher Allan Webber <cwebber <at> dustycloud.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -60,6 +61,7 @@
   #:use-module (gnu packages gnome)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages sdl)
+  #:use-module (gnu packages tls)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages xiph)
   #:use-module (gnu packages lua)
@@ -619,3 +621,70 @@ to create fully featured games and multimedia programs in the python language.")
                    license:psfl
                    license:public-domain
                    license:lgpl2.1+))))
+
+(define-public godot
+  (package
+    (name "godot")
+    (version "2.1.2")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "https://github.com/godotengine/godot/archive/"
+                    version "-stable.tar.gz"))
+              (sha256
+               (base32
+                "16ml6kf338qqiazc2swvla89zapg41qc1i00x25r1jpq94a17cr9"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       ;; TODO: This is copy-pasta'ed from aria-maestosa :)
+       ;; TODO: Add scons-build-system and use it here.
+       (modify-phases %standard-phases
+         (delete 'configure)
+         (add-after 'unpack 'scons-propagate-environment
+           (lambda _
+             ;; By design, SCons does not, by default, propagate
+             ;; environment variables to subprocesses.  See:
+             ;; <http://comments.gmane.org/gmane.linux.distributions.nixos/4969>
+             ;; Here, we modify the SConstruct file to arrange for
+             ;; environment variables to be propagated.
+             (substitute* "SConstruct"
+               (("env = Environment\\(\\)")
+                "env = Environment(ENV=os.environ)")
+               ;; Scons errors out when copying subdirectories from Resources,
+               ;; so we move them instead.
+               (("Copy") "Move")
+               ;; We move the "score" and "Documentation" directories at once,
+               ;; so we have to ignore files contained therein.
+               (("if \".svn\" in file" line)
+                (string-append line
+                               " or \"score/\" in file"
+                               " or \"Documentation/\" in file")))
+             #t))
+         (replace 'build (lambda _ (zero? (system* "scons" "platform=x11"))))
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out")))
+               (and
+                (zero? (system* "scons"
+                                (string-append "prefix=" out)
+                                "install")))))))))
+    (native-inputs `(("pkg-config" ,pkg-config)
+                     ("scons" ,scons)))
+    (inputs `(("libx11" ,libx11)
+              ("libxcursor" ,libxcursor)
+              ("libxinerama" ,libxinerama)
+              ("linux-libre-headers" ,linux-libre-headers)
+              ("mesa" ,mesa)
+              ("mesa-headers" ,mesa-headers)
+              ("glu" ,glu)
+              ("pulseaudio" ,pulseaudio)
+              ("freetype" ,freetype)
+              ("openssl" ,openssl)
+              ("libxrandr" ,libxrandr)))
+    (home-page "https://godotengine.org/")
+    (synopsis "Advanced 2d and 3d game engine")
+    (description "Godot is a 2d and 3d game engine which with a powerful
+visual interface.")
+    ;; TODO: Maybe list bundled libs
+    (license license:expat)))
-- 
2.11.0


Information forwarded to guix-patches <at> gnu.org:
bug#25908; Package guix-patches. (Tue, 14 Mar 2017 09:29:02 GMT) Full text and rfc822 format available.

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

From: ludo <at> gnu.org (Ludovic Courtès)
To: Christopher Allan Webber <cwebber <at> dustycloud.org>
Cc: 25908 <at> debbugs.gnu.org
Subject: Re: bug#25908: [PATCH, WIP] Add godot.
Date: Tue, 14 Mar 2017 10:28:13 +0100
Hi Chris!

Christopher Allan Webber <cwebber <at> dustycloud.org> skribis:

> This is still WIP, and unfortunately it doesn't work.  Here's the error
> I got:
>
>                  from ./drivers/pulseaudio/audio_driver_pulseaudio.h:36,
>                  from platform/x11/os_x11.h:46,
>                  from platform/x11/godot_x11.cpp:30:
>   /gnu/store/iwgi9001dmmihrjg4rqhd6pa6788prjw-glibc-2.24/include/bits/local_lim.h:38:26: fatal error: linux/limits.h: No such file or directory
>   #include <linux/limits.h>

This is because, by default, SCons unsets environment variables (!), in
this case C_INCLUDE_PATH.

However:

> +             ;; By design, SCons does not, by default, propagate
> +             ;; environment variables to subprocesses.  See:
> +             ;; <http://comments.gmane.org/gmane.linux.distributions.nixos/4969>
> +             ;; Here, we modify the SConstruct file to arrange for
> +             ;; environment variables to be propagated.
> +             (substitute* "SConstruct"
> +               (("env = Environment\\(\\)")
> +                "env = Environment(ENV=os.environ)")

this should definitely take care of that.

Could it be that the regexp doesn’t match or something?

HTH!

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#25908; Package guix-patches. (Sat, 18 Mar 2017 17:01:01 GMT) Full text and rfc822 format available.

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

From: Kei Kebreau <kei <at> openmailbox.org>
To: ludo <at> gnu.org (Ludovic Courtès)
Cc: Christopher Allan Webber <cwebber <at> dustycloud.org>, 25908 <at> debbugs.gnu.org
Subject: Re: bug#25908: [PATCH, WIP] Add godot.
Date: Sat, 18 Mar 2017 12:59:56 -0400
[Message part 1 (text/plain, inline)]
ludo <at> gnu.org (Ludovic Courtès) writes:

> Hi Chris!
>
> Christopher Allan Webber <cwebber <at> dustycloud.org> skribis:
>
>> This is still WIP, and unfortunately it doesn't work.  Here's the error
>> I got:
>>
>>                  from ./drivers/pulseaudio/audio_driver_pulseaudio.h:36,
>>                  from platform/x11/os_x11.h:46,
>>                  from platform/x11/godot_x11.cpp:30:
>>   /gnu/store/iwgi9001dmmihrjg4rqhd6pa6788prjw-glibc-2.24/include/bits/local_lim.h:38:26: fatal error: linux/limits.h: No such file or directory
>>   #include <linux/limits.h>
>
> This is because, by default, SCons unsets environment variables (!), in
> this case C_INCLUDE_PATH.
>
> However:
>
>> +             ;; By design, SCons does not, by default, propagate
>> +             ;; environment variables to subprocesses.  See:
>> +             ;; <http://comments.gmane.org/gmane.linux.distributions.nixos/4969>
>> +             ;; Here, we modify the SConstruct file to arrange for
>> +             ;; environment variables to be propagated.
>> +             (substitute* "SConstruct"
>> +               (("env = Environment\\(\\)")
>> +                "env = Environment(ENV=os.environ)")
>
> this should definitely take care of that.
>
> Could it be that the regexp doesn’t match or something?
>
> HTH!
>
> Ludo’.

Ah, the crucial clue! I replaced the above regexp with the following:

(substitute* "SConstruct"
  (("env_base = Environment\\(tools=custom_tools\\)")
   "env_base = Environment(ENV=os.environ)"))

Though I don't know what the meaning of "tools=custom_tools" is, this
substitution let me complete the build phase without an issue.

Just two other things:

Throughout the build I saw "-Ithirdparty/glew" as a CFLAG. Is this
necessary for a successful build or can we use our own copy of glew?

Is there a check target for this build system? If not we can just leave
a #:tests? #f with a note in the arguments section.

Thanks for the help, Ludovic!
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#25908; Package guix-patches. (Sun, 19 Mar 2017 15:52:01 GMT) Full text and rfc822 format available.

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

From: ludo <at> gnu.org (Ludovic Courtès)
To: Kei Kebreau <kei <at> openmailbox.org>
Cc: Christopher Allan Webber <cwebber <at> dustycloud.org>, 25908 <at> debbugs.gnu.org
Subject: Re: bug#25908: [PATCH, WIP] Add godot.
Date: Sun, 19 Mar 2017 16:51:30 +0100
Hi Kei,

Kei Kebreau <kei <at> openmailbox.org> skribis:

> Ah, the crucial clue! I replaced the above regexp with the following:
>
> (substitute* "SConstruct"
>   (("env_base = Environment\\(tools=custom_tools\\)")
>    "env_base = Environment(ENV=os.environ)"))
>
> Though I don't know what the meaning of "tools=custom_tools" is, this
> substitution let me complete the build phase without an issue.

In doubt, I’d keep “tools=custom_tools” in addition to
“ENV=os.environ”.  :-)

> Just two other things:
>
> Throughout the build I saw "-Ithirdparty/glew" as a CFLAG. Is this
> necessary for a successful build or can we use our own copy of glew?

Maybe you could (delete-file-recursively "thirdparty") from the snippet
to be sure.

> Is there a check target for this build system? If not we can just leave
> a #:tests? #f with a note in the arguments section.

AFAIK SCons does not standardize anything when it comes to running
tests.  I think ‘scons --help’ lists all the supported targets, so you
could check if there’s a “test” target or something like that.

HTH!

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#25908; Package guix-patches. (Sat, 25 Mar 2017 17:29:02 GMT) Full text and rfc822 format available.

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

From: Kei Kebreau <kei <at> openmailbox.org>
To: ludo <at> gnu.org (Ludovic Courtès)
Cc: Christopher Allan Webber <cwebber <at> dustycloud.org>, 25908 <at> debbugs.gnu.org
Subject: Re: bug#25908: [PATCH, WIP] Add godot.
Date: Sat, 25 Mar 2017 13:28:38 -0400
[Message part 1 (text/plain, inline)]
ludo <at> gnu.org (Ludovic Courtès) writes:

> Hi Kei,
>
> Kei Kebreau <kei <at> openmailbox.org> skribis:
>
>> Ah, the crucial clue! I replaced the above regexp with the following:
>>
>> (substitute* "SConstruct"
>>   (("env_base = Environment\\(tools=custom_tools\\)")
>>    "env_base = Environment(ENV=os.environ)"))
>>
>> Though I don't know what the meaning of "tools=custom_tools" is, this
>> substitution let me complete the build phase without an issue.
>
> In doubt, I’d keep “tools=custom_tools” in addition to
> “ENV=os.environ”.  :-)
>

Okay. I figured out how this works and kept both.

>> Just two other things:
>>
>> Throughout the build I saw "-Ithirdparty/glew" as a CFLAG. Is this
>> necessary for a successful build or can we use our own copy of glew?
>
> Maybe you could (delete-file-recursively "thirdparty") from the snippet
> to be sure.
>

It seems like these libraries will be quite difficult to unbundle. The
build system has targets that depend on files specifically found in the
"thirdparty" directory.

>> Is there a check target for this build system? If not we can just leave
>> a #:tests? #f with a note in the arguments section.
>
> AFAIK SCons does not standardize anything when it comes to running
> tests.  I think ‘scons --help’ lists all the supported targets, so you
> could check if there’s a “test” target or something like that.
>

There doesn't seem to be tests in the Godot's build system.

> HTH!
>
> Ludo’.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#25908; Package guix-patches. (Sat, 25 Mar 2017 17:48:02 GMT) Full text and rfc822 format available.

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

From: ludo <at> gnu.org (Ludovic Courtès)
To: Kei Kebreau <kei <at> openmailbox.org>
Cc: Christopher Allan Webber <cwebber <at> dustycloud.org>, 25908 <at> debbugs.gnu.org
Subject: Re: bug#25908: [PATCH, WIP] Add godot.
Date: Sat, 25 Mar 2017 18:47:46 +0100
Hi Kei,

Kei Kebreau <kei <at> openmailbox.org> skribis:

> ludo <at> gnu.org (Ludovic Courtès) writes:

[...]

>>> Just two other things:
>>>
>>> Throughout the build I saw "-Ithirdparty/glew" as a CFLAG. Is this
>>> necessary for a successful build or can we use our own copy of glew?
>>
>> Maybe you could (delete-file-recursively "thirdparty") from the snippet
>> to be sure.
>>
>
> It seems like these libraries will be quite difficult to unbundle. The
> build system has targets that depend on files specifically found in the
> "thirdparty" directory.

As a first step, you could remove (in the snippet) those that can easily
be avoided, and document work that remains to be done in a comment.
Though yeah, we’ll have to find out how to modify ‘SConscript’ & co. to
remove the dependencies on bundled libs.

>>> Is there a check target for this build system? If not we can just leave
>>> a #:tests? #f with a note in the arguments section.
>>
>> AFAIK SCons does not standardize anything when it comes to running
>> tests.  I think ‘scons --help’ lists all the supported targets, so you
>> could check if there’s a “test” target or something like that.
>>
>
> There doesn't seem to be tests in the Godot's build system.

Simpler!

Ludo’.




Merged 25908 28380. Request was from ludo <at> gnu.org (Ludovic Courtès) to control <at> debbugs.gnu.org. (Fri, 08 Sep 2017 15:45:02 GMT) Full text and rfc822 format available.

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

Notification sent to Christopher Allan Webber <cwebber <at> dustycloud.org>:
bug acknowledged by developer. (Thu, 14 Sep 2017 11:43:03 GMT) Full text and rfc822 format available.

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

From: ludo <at> gnu.org (Ludovic Courtès)
To: Peter Mikkelsen <petermikkelsen10 <at> gmail.com>
Cc: 25908-done <at> debbugs.gnu.org, 28380-done <at> debbugs.gnu.org
Subject: Re: [bug#28380] [PATCH] gnu: Add godot.
Date: Thu, 14 Sep 2017 13:41:51 +0200
[Message part 1 (text/plain, inline)]
Hello,

Peter Mikkelsen <petermikkelsen10 <at> gmail.com> skribis:

> I got some inspiration from that one, and afaik bug 25908 was never
> completed. I guess you can see my patch as a completed version, co-authored
> by Chris :) It builds and installs, and i have unbundled as much as
> possible right now.
>
> Hope that helps!

It does!

I’m committing it with the cosmetic changes below.

Note that it “calls home” to retrieve templates from godotengine.org and
github.com.  I suppose that’s expected but that wasn’t clear when I
clicked on the browsing thing.

Thanks!

Ludo’.

[Message part 2 (text/x-patch, inline)]
diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm
index e04c11d7d..5633456d4 100644
--- a/gnu/packages/game-development.scm
+++ b/gnu/packages/game-development.scm
@@ -1118,7 +1118,10 @@ their own original games.")
               ("pulseaudio" ,pulseaudio)
               ("python2" ,python-2)))
     (home-page "https://godotengine.org/")
-    (synopsis "Advanced 2d and 3d game engine")
-    (description "Godot is an advanced, feature-packed, multi-platform
-2D and 3D open source game engine.")
+    (synopsis "Advanced 2D and 3D game engine")
+    (description
+     "Godot is an advanced multi-platform game engine written in C++.  If
+features design tools such as a visual editor, can import 3D models and
+provide high-quality 3D rendering, it contains an animation editor, and can be
+scripted in a Python-like language.")
     (license license:expat)))

Reply sent to ludo <at> gnu.org (Ludovic Courtès):
You have taken responsibility. (Thu, 14 Sep 2017 11:43:03 GMT) Full text and rfc822 format available.

Notification sent to Peter Mikkelsen <petermikkelsen10 <at> gmail.com>:
bug acknowledged by developer. (Thu, 14 Sep 2017 11:43:03 GMT) Full text and rfc822 format available.

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

This bug report was last modified 6 years and 195 days ago.

Previous Next


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