all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#36082] [PATCH] add gnurobots
@ 2019-06-03 22:14 Jesse Gibbons
  2019-06-05 13:38 ` Ricardo Wurmus
  0 siblings, 1 reply; 4+ messages in thread
From: Jesse Gibbons @ 2019-06-03 22:14 UTC (permalink / raw)
  To: 36082

From 77168e843404ba8cddbace220a04d2d30d419a2f Mon Sep 17 00:00:00 2001
From: Jesse Gibbons <jgibbons2357+guix@gmail.com>
Date: Mon, 3 Jun 2019 16:10:43 -0600
Subject: [PATCH] add gnurobots

---
 gnu/packages/games.scm | 49 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 4fdc9b01e6..6416b6b1bc 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -40,6 +40,7 @@
 ;;; Copyright © 2019 Oleg Pykhalov <go.wigust@gmail.com>
 ;;; Copyright © 2019 Pierre Langlois <pierre.langlois@gmx.com>
 ;;; Copyright © 2019 Julien Lepiller <julien@lepiller.eu>
+;;; Copyright © 2019 Jesse Gibbons <jgibbons2357+guix@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -7336,3 +7337,51 @@ Unfortunately, Hacker is not aware of Drascula's
real ambitions: DOMINATING the World and demonstrating that he is even
more evil than his brother Vlad.") ;; Drascula uses a BSD-like license.
     (license (license:non-copyleft "file:///readme.txt"))))
+
+
+(define-public gnurobots
+  (package
+   (name "gnurobots")
+   (version "1.2.0")
+   (source
+    (origin
+     (method url-fetch)
+     (uri (string-append
+	   "mirror://gnu/gnurobots/gnurobots-"
+	   version
+	   ".tar.gz"))
+     (sha256
+      (base32
+       "07gi3lsmbzzsjambgixj6xy79lh22km84z7bnzgwzxdy806lyvwb"))))
+   (build-system gnu-build-system)
+   (inputs
+    `(("glib" ,glib)
+      ("gtk+" ,gtk+-2)
+      ("vte" ,vte/gtk+-2)
+      ("readline" ,readline)
+      ("guile" ,guile-1.8)
+      ("pkg-config" ,pkg-config)))
+   (arguments '(
+		;-Werror=deprecated-declarations kills the build. Fix
it!
+		#:make-flags
'("CFLAGS=-Wno-error=deprecated-declarations")
+		#:phases
+		;readline headers were moved to readline/readline.h.
Fix before we compile.
+		(modify-phases %standard-phases
+				(add-before 'build
'patch-shell-references
+				(lambda _
+							  (begin
+
(substitute* (find-files "src" "\\.c$")
+
(("<readline.h>") "<readline/readline.h>"))
+
(substitute* (find-files "src" "\\.c$")
+
(("<history.h>") "<readline/history.h>"))))))))
+   (synopsis
+    "Program a little robot and watch him explore a world")
+   (description
+    "GNU Robots is a game in which you program a robot to explore a
world +full of enemies that can hurt it, obstacles and food to be eaten.
+The goal of the game is to stay alive and collect prizes.  The robot
+program conveniently may be written in a plain text file in the
+Scheme programming language.")
+   (home-page
+    "http://www.gnu.org/software/gnurobots/readme.html")
+   (license gpl3+)))
-- 
2.21.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [bug#36082] [PATCH] add gnurobots
  2019-06-03 22:14 [bug#36082] [PATCH] add gnurobots Jesse Gibbons
@ 2019-06-05 13:38 ` Ricardo Wurmus
  2019-06-05 20:10   ` Jesse Gibbons
  0 siblings, 1 reply; 4+ messages in thread
From: Ricardo Wurmus @ 2019-06-05 13:38 UTC (permalink / raw)
  To: Jesse Gibbons; +Cc: 36082


Hi Jesse,

> From 77168e843404ba8cddbace220a04d2d30d419a2f Mon Sep 17 00:00:00 2001
> From: Jesse Gibbons <jgibbons2357+guix@gmail.com>
> Date: Mon, 3 Jun 2019 16:10:43 -0600
> Subject: [PATCH] add gnurobots

Thank you for your patch.  It looks like the patch doesn’t apply to the
git repository.  Maybe it got mangled by your email client?

I’ll continue with some comments about the patch.

> +
> +

Please remove the extra line break.

> +(define-public gnurobots
> +  (package
> +   (name "gnurobots")
> +   (version "1.2.0")
> +   (source
> +    (origin
> +     (method url-fetch)
> +     (uri (string-append
> +	   "mirror://gnu/gnurobots/gnurobots-"
> +	   version
> +	   ".tar.gz"))
> +     (sha256
> +      (base32
> +       "07gi3lsmbzzsjambgixj6xy79lh22km84z7bnzgwzxdy806lyvwb"))))

The indentation looks off.  I can fix this for you, of course, or you
could use the automatic indenter script; see the Contributing section in
the manual for more information.

> +   (build-system gnu-build-system)
> +   (inputs
> +    `(("glib" ,glib)
> +      ("gtk+" ,gtk+-2)
> +      ("vte" ,vte/gtk+-2)
> +      ("readline" ,readline)
> +      ("guile" ,guile-1.8)
> +      ("pkg-config" ,pkg-config)))
> +   (arguments '(

Please don’t leave parentheses dangling on their own like that.  They
need company.

> +		;-Werror=deprecated-declarations kills the build. Fix
> it!

Please use “;;” for comments on their own line.  Single semicolon is
used for “margin comments”, i.e. a comment at the end of a line.

> +		#:make-flags
> '("CFLAGS=-Wno-error=deprecated-declarations")
> +		#:phases
> +		;readline headers were moved to readline/readline.h.
> Fix before we compile.

Same here.  Please also use full sentences when necessary.  I’d say no
comment is necessary here.

> +		(modify-phases %standard-phases
> +				(add-before 'build
> 'patch-shell-references

Please change the name of this build phase.  “patch-shell-references”
does not describe what this phase does.

> +				(lambda _
> +							  (begin

You don’t need “begin” here.

> +
> (substitute* (find-files "src" "\\.c$")
> +
> (("<readline.h>") "<readline/readline.h>"))
> +
> (substitute* (find-files "src" "\\.c$")
> +
> (("<history.h>") "<readline/history.h>"))))))))

You could merge these two substitutions; after all they operate on the
same set of files.  However, I think that a better approach might be to
add the “readline” sub-directory to C_INCLUDE_PATH.  So instead of
patching files you’d just set one environment variable.

> +   (synopsis
> +    "Program a little robot and watch him explore a world")

“him” –> “it”

> +   (description
> +    "GNU Robots is a game in which you program a robot to explore a
> world +full of enemies that can hurt it, obstacles and food to be eaten.
> +The goal of the game is to stay alive and collect prizes.  The robot
> +program conveniently may be written in a plain text file in the
> +Scheme programming language.")
> +   (home-page
> +    "http://www.gnu.org/software/gnurobots/readme.html")

Plesae use HTTPS and remove the “/readme.html” part.

> +   (license gpl3+)))

This should be “(license license:gpl3+)” because all values from the
(guix licenses) module are imported with a “license:” prefix.

Would you like to send a new patch?  If you aren’t comfortable with “git
send-email” please attach the generated patch file to your email (don’t
copy/paste the contents).

Thanks!

--
Ricardo

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [bug#36082] [PATCH] add gnurobots
  2019-06-05 13:38 ` Ricardo Wurmus
@ 2019-06-05 20:10   ` Jesse Gibbons
  2019-06-06 10:20     ` bug#36082: " Ricardo Wurmus
  0 siblings, 1 reply; 4+ messages in thread
From: Jesse Gibbons @ 2019-06-05 20:10 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: 36082

[-- Attachment #1: Type: text/plain, Size: 5055 bytes --]

Thanks for the review.

On Wed, 05 Jun 2019 15:38:06 +0200
Ricardo Wurmus <rekado@elephly.net> wrote:

> Hi Jesse,
> 
> > From 77168e843404ba8cddbace220a04d2d30d419a2f Mon Sep 17 00:00:00
> > 2001 From: Jesse Gibbons <jgibbons2357+guix@gmail.com>
> > Date: Mon, 3 Jun 2019 16:10:43 -0600
> > Subject: [PATCH] add gnurobots  
> 
> Thank you for your patch.  It looks like the patch doesn’t apply to
> the git repository.  Maybe it got mangled by your email client?
> 
> I’ll continue with some comments about the patch.
> 
> > +
> > +  
> 
> Please remove the extra line break.
> 
> > +(define-public gnurobots
> > +  (package
> > +   (name "gnurobots")
> > +   (version "1.2.0")
> > +   (source
> > +    (origin
> > +     (method url-fetch)
> > +     (uri (string-append
> > +	   "mirror://gnu/gnurobots/gnurobots-"
> > +	   version
> > +	   ".tar.gz"))
> > +     (sha256
> > +      (base32
> > +       "07gi3lsmbzzsjambgixj6xy79lh22km84z7bnzgwzxdy806lyvwb"))))  
> 
> The indentation looks off.  I can fix this for you, of course, or you
> could use the automatic indenter script; see the Contributing section
> in the manual for more information.
I tried the indenter script. Made the code look worse. "guix lint"
complained about the line length. Furthermore, "guix lint" complains
about the line length when I autoindent. New patch leaves scripted
indent alone.
> 
> > +   (build-system gnu-build-system)
> > +   (inputs
> > +    `(("glib" ,glib)
> > +      ("gtk+" ,gtk+-2)
> > +      ("vte" ,vte/gtk+-2)
> > +      ("readline" ,readline)
> > +      ("guile" ,guile-1.8)
> > +      ("pkg-config" ,pkg-config)))
"guix lint" says pkg-config should be a native-input, but when it is
defined as a native-input it says it fails to make derivatives for
other systems. Since I am not currently able to reconfigure my system,
I'll let someone else handle this problem.
> > +   (arguments '(  
> 
> Please don’t leave parentheses dangling on their own like that.  They
> need company.
> 
> > +		;-Werror=deprecated-declarations kills the build.
> > Fix it!  
> 
> Please use “;;” for comments on their own line.  Single semicolon is
> used for “margin comments”, i.e. a comment at the end of a line.
> 
> > +		#:make-flags
> > '("CFLAGS=-Wno-error=deprecated-declarations")
> > +		#:phases
> > +		;readline headers were moved to
> > readline/readline.h. Fix before we compile.  
> 
> Same here.  Please also use full sentences when necessary.  I’d say no
> comment is necessary here.
Not certain what you mean. The comment contained two complete sentences.
Comment removed.
> 
> > +		(modify-phases %standard-phases
> > +				(add-before 'build
> > 'patch-shell-references  
> 
> Please change the name of this build phase.  “patch-shell-references”
> does not describe what this phase does.
> 
> > +				(lambda _
> > +							  (begin  
> 
> You don’t need “begin” here.
> 
> > +
> > (substitute* (find-files "src" "\\.c$")
> > +
> > (("<readline.h>") "<readline/readline.h>"))
> > +
> > (substitute* (find-files "src" "\\.c$")
> > +
> > (("<history.h>") "<readline/history.h>"))))))))  
> 
> You could merge these two substitutions; after all they operate on the
> same set of files.  However, I think that a better approach might be
> to add the “readline” sub-directory to C_INCLUDE_PATH.  So instead of
> patching files you’d just set one environment variable.
I had trouble tredging the documentation to find out how to do this.
Some help here would be appreciated. Until we can fix it as you
suggest, the original code will be sufficient. Added TODO comment
describing the change you suggested.
> 
> > +   (synopsis
> > +    "Program a little robot and watch him explore a world")  
> 
> “him” –> “it”
Given that these descriptions are from the gnurobots authors, I don't
understand why this small change is necessary, but I'll fix.
> 
> > +   (description
> > +    "GNU Robots is a game in which you program a robot to explore a
> > world +full of enemies that can hurt it, obstacles and food to be
> > eaten. +The goal of the game is to stay alive and collect prizes.
> > The robot +program conveniently may be written in a plain text file
> > in the +Scheme programming language.")
> > +   (home-page
> > +    "http://www.gnu.org/software/gnurobots/readme.html")  
> 
> Plesae use HTTPS and remove the “/readme.html” part.
> 
> > +   (license gpl3+)))  
> 
> This should be “(license license:gpl3+)” because all values from the
> (guix licenses) module are imported with a “license:” prefix.
> 
> Would you like to send a new patch?  If you aren’t comfortable with
> “git send-email” please attach the generated patch file to your email
> (don’t copy/paste the contents).
> 
> Thanks!
> 
> --
> Ricardo
> 
Recommended fixes made where possible, though I need a bit of help with
other fixes noted above. New patch generated and attached.
--Jesse

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-add-gnurobots.patch --]
[-- Type: text/x-patch, Size: 2908 bytes --]

From f18d37c3f2072c5f23d868a621e2b92d604761fe Mon Sep 17 00:00:00 2001
From: Jesse Gibbons <jgibbons2357+guix@gmail.com>
Date: Wed, 5 Jun 2019 14:03:19 -0600
Subject: [PATCH] add gnurobots

---
 gnu/packages/games.scm | 49 ++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 47 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 4fdc9b01e6..4b5eedc242 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -40,8 +40,7 @@
 ;;; Copyright © 2019 Oleg Pykhalov <go.wigust@gmail.com>
 ;;; Copyright © 2019 Pierre Langlois <pierre.langlois@gmx.com>
 ;;; Copyright © 2019 Julien Lepiller <julien@lepiller.eu>
-;;;
-;;; This file is part of GNU Guix.
+;;; Copyright © 2019 Jesse Gibbons <jgibbons2357+guix@gmail.com>
 ;;;
 ;;; GNU Guix is free software; you can redistribute it and/or modify it
 ;;; under the terms of the GNU General Public License as published by
@@ -7336,3 +7335,49 @@ Unfortunately, Hacker is not aware of Drascula's real ambitions: DOMINATING
 the World and demonstrating that he is even more evil than his brother Vlad.")
     ;; Drascula uses a BSD-like license.
     (license (license:non-copyleft "file:///readme.txt"))))
+
+(define-public gnurobots
+  (package
+    (name "gnurobots")
+    (version "1.2.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+	     "mirror://gnu/gnurobots/gnurobots-"
+	     version
+	     ".tar.gz"))
+       (sha256
+        (base32
+         "07gi3lsmbzzsjambgixj6xy79lh22km84z7bnzgwzxdy806lyvwb"))))
+    (build-system gnu-build-system)
+    (inputs
+     `(("glib" ,glib)
+       ("gtk+" ,gtk+-2)
+       ("vte" ,vte/gtk+-2)
+       ("readline" ,readline)
+       ("guile" ,guile-1.8)
+       ("pkg-config" ,pkg-config)))
+    (arguments 
+     ;;-Werror=deprecated-declarations kills the build.
+     '(#:make-flags '("CFLAGS=-Wno-error=deprecated-declarations")
+       #:phases
+       (modify-phases %standard-phases
+	 (add-before 'build 'fix-include
+	   (lambda _
+             ;;TODO: Replace with code adding readline directory to C_INCLUDE_PATH.
+	     (substitute* (find-files "src" "\\.c$")
+	       (("<readline.h>") "<readline/readline.h>"))
+	     (substitute* (find-files "src" "\\.c$")
+	       (("<history.h>") "<readline/history.h>")))))))
+    (synopsis
+     "Program a little robot and watch it explore a world")
+    (description
+     "GNU Robots is a game in which you program a robot to explore a world
+full of enemies that can hurt it, obstacles and food to be eaten.
+The goal of the game is to stay alive and collect prizes.  The robot
+program conveniently may be written in a plain text file in the
+Scheme programming language.")
+    (home-page
+     "https://www.gnu.org/software/gnurobots")
+    (license license:gpl3+)))
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* bug#36082: [PATCH] add gnurobots
  2019-06-05 20:10   ` Jesse Gibbons
@ 2019-06-06 10:20     ` Ricardo Wurmus
  0 siblings, 0 replies; 4+ messages in thread
From: Ricardo Wurmus @ 2019-06-06 10:20 UTC (permalink / raw)
  To: Jesse Gibbons; +Cc: 36082-done


Hi Jesse,

thank you for the updated patch.  I pushed it to the master branch with
commit 08c2fb8fe9 after a couple of changes:

* fixed indentation and formatting; replaced tabs with spaces
* added a build phase to install the HOWTO document
* replaced the build phase to patch references to headers with a make
  flag
* moved pkg-config to native-inputs
* reflowed the description
* changed the commit message

Thanks!

-- 
Ricardo

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-06-06 10:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-03 22:14 [bug#36082] [PATCH] add gnurobots Jesse Gibbons
2019-06-05 13:38 ` Ricardo Wurmus
2019-06-05 20:10   ` Jesse Gibbons
2019-06-06 10:20     ` bug#36082: " Ricardo Wurmus

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.