From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:36394) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hYcFb-00032t-Ss for guix-patches@gnu.org; Wed, 05 Jun 2019 16:11:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hYcFU-0005ty-95 for guix-patches@gnu.org; Wed, 05 Jun 2019 16:11:07 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:34699) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hYcFS-0005q1-8h for guix-patches@gnu.org; Wed, 05 Jun 2019 16:11:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hYcFS-0004sk-1s for guix-patches@gnu.org; Wed, 05 Jun 2019 16:11:02 -0400 Subject: [bug#36082] [PATCH] add gnurobots Resent-Message-ID: Date: Wed, 5 Jun 2019 14:10:17 -0600 From: Jesse Gibbons Message-ID: <20190605141017.363231cb@gmail.com> In-Reply-To: <87ef48cfup.fsf@elephly.net> References: <20190603161431.03842caa@gmail.com> <87ef48cfup.fsf@elephly.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/gctlb2cq60LkJlXWIIfH2Pv" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Ricardo Wurmus Cc: 36082@debbugs.gnu.org --MP_/gctlb2cq60LkJlXWIIfH2Pv Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Thanks for the review. On Wed, 05 Jun 2019 15:38:06 +0200 Ricardo Wurmus wrote: > Hi Jesse, >=20 > > From 77168e843404ba8cddbace220a04d2d30d419a2f Mon Sep 17 00:00:00 > > 2001 From: Jesse Gibbons > > Date: Mon, 3 Jun 2019 16:10:43 -0600 > > Subject: [PATCH] add gnurobots =20 >=20 > Thank you for your patch. It looks like the patch doesn=E2=80=99t apply = to > the git repository. Maybe it got mangled by your email client? >=20 > I=E2=80=99ll continue with some comments about the patch. >=20 > > + > > + =20 >=20 > Please remove the extra line break. >=20 > > +(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")))) =20 >=20 > 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. >=20 > > + (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 '( =20 >=20 > Please don=E2=80=99t leave parentheses dangling on their own like that. = They > need company. >=20 > > + ;-Werror=3Ddeprecated-declarations kills the build. > > Fix it! =20 >=20 > Please use =E2=80=9C;;=E2=80=9D for comments on their own line. Single s= emicolon is > used for =E2=80=9Cmargin comments=E2=80=9D, i.e. a comment at the end of = a line. >=20 > > + #:make-flags > > '("CFLAGS=3D-Wno-error=3Ddeprecated-declarations") > > + #:phases > > + ;readline headers were moved to > > readline/readline.h. Fix before we compile. =20 >=20 > Same here. Please also use full sentences when necessary. I=E2=80=99d s= ay no > comment is necessary here. Not certain what you mean. The comment contained two complete sentences. Comment removed. >=20 > > + (modify-phases %standard-phases > > + (add-before 'build > > 'patch-shell-references =20 >=20 > Please change the name of this build phase. =E2=80=9Cpatch-shell-referen= ces=E2=80=9D > does not describe what this phase does. >=20 > > + (lambda _ > > + (begin =20 >=20 > You don=E2=80=99t need =E2=80=9Cbegin=E2=80=9D here. >=20 > > + > > (substitute* (find-files "src" "\\.c$") > > + > > (("") "")) > > + > > (substitute* (find-files "src" "\\.c$") > > + > > (("") "")))))))) =20 >=20 > 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 =E2=80=9Creadline=E2=80=9D sub-directory to C_INCLUDE_PATH. S= o instead of > patching files you=E2=80=99d 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. >=20 > > + (synopsis > > + "Program a little robot and watch him explore a world") =20 >=20 > =E2=80=9Chim=E2=80=9D =E2=80=93> =E2=80=9Cit=E2=80=9D Given that these descriptions are from the gnurobots authors, I don't understand why this small change is necessary, but I'll fix. >=20 > > + (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") =20 >=20 > Plesae use HTTPS and remove the =E2=80=9C/readme.html=E2=80=9D part. >=20 > > + (license gpl3+))) =20 >=20 > This should be =E2=80=9C(license license:gpl3+)=E2=80=9D because all valu= es from the > (guix licenses) module are imported with a =E2=80=9Clicense:=E2=80=9D pre= fix. >=20 > Would you like to send a new patch? If you aren=E2=80=99t comfortable wi= th > =E2=80=9Cgit send-email=E2=80=9D please attach the generated patch file t= o your email > (don=E2=80=99t copy/paste the contents). >=20 > Thanks! >=20 > -- > Ricardo >=20 Recommended fixes made where possible, though I need a bit of help with other fixes noted above. New patch generated and attached. --Jesse --MP_/gctlb2cq60LkJlXWIIfH2Pv Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=0001-add-gnurobots.patch =46rom f18d37c3f2072c5f23d868a621e2b92d604761fe Mon Sep 17 00:00:00 2001 From: Jesse Gibbons 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 =C2=A9 2019 Oleg Pykhalov ;;; Copyright =C2=A9 2019 Pierre Langlois ;;; Copyright =C2=A9 2019 Julien Lepiller -;;; -;;; This file is part of GNU Guix. +;;; Copyright =C2=A9 2019 Jesse Gibbons ;;; ;;; 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 rea= l ambitions: DOMINATING the World and demonstrating that he is even more evil than his brother Vla= d.") ;; 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=20 + ;;-Werror=3Ddeprecated-declarations kills the build. + '(#:make-flags '("CFLAGS=3D-Wno-error=3Ddeprecated-declarations") + #:phases + (modify-phases %standard-phases + (add-before 'build 'fix-include + (lambda _ + ;;TODO: Replace with code adding readline directory to C_INCL= UDE_PATH. + (substitute* (find-files "src" "\\.c$") + (("") "")) + (substitute* (find-files "src" "\\.c$") + (("") ""))))))) + (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+))) --=20 2.21.0 --MP_/gctlb2cq60LkJlXWIIfH2Pv--