From patchwork Wed Jun 5 20:10:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jesse Gibbons X-Patchwork-Id: 14240 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 0B9F9170B8; Wed, 5 Jun 2019 21:17:04 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 772E8170B6 for ; Wed, 5 Jun 2019 21:17:02 +0100 (BST) Received: from localhost ([127.0.0.1]:49311 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hYcLF-0007cI-MU for patchwork@mira.cbaines.net; Wed, 05 Jun 2019 16:17:01 -0400 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 X-Loop: help-debbugs@gnu.org Subject: [bug#36082] [PATCH] add gnurobots Resent-From: Jesse Gibbons Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 05 Jun 2019 20:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36082 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ricardo Wurmus Received: via spool by 36082-submit@debbugs.gnu.org id=B36082.155976543218725 (code B ref 36082); Wed, 05 Jun 2019 20:11:01 +0000 Received: (at 36082) by debbugs.gnu.org; 5 Jun 2019 20:10:32 +0000 Received: from localhost ([127.0.0.1]:48243 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hYcEw-0004rv-3H for submit@debbugs.gnu.org; Wed, 05 Jun 2019 16:10:30 -0400 Received: from mail-pf1-f175.google.com ([209.85.210.175]:35428) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hYcEu-0004rh-ED for 36082@debbugs.gnu.org; Wed, 05 Jun 2019 16:10:29 -0400 Received: by mail-pf1-f175.google.com with SMTP id d126so15500984pfd.2 for <36082@debbugs.gnu.org>; Wed, 05 Jun 2019 13:10:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version; bh=9Saj2lrjWaWG1qqAwuy1Z75gAWGCY0wn3YC/qnY384Y=; b=OkYl51vkv5GKBqyu7reWQwEzTjxJDcf6qRjBLxBXj+3Zjba49YzuiD91gxt+aL2XRo hNyepHYC8RM3cj+ajfAvWnJwyjY3oWudlfP389O7I5Bkh5q76KKOX1+dV2RE5yuSTnLm XJGuInfHvLaIz+j8Pt9MtSsp0rCSO+oDOa+kMYV4V5jFzieIc4hMIGXVoqUlVd+qDIr1 cKFZ6ADIqP+c4EknGzCzhl4HDPKBhBmph20IUrlv5hpGawdgwLmwgcMBYLDDRmpxL5du NJuWeyGliTc/Q5wZqOyHs5ArzjLhf1hzmUDQ5QB6TBS4odMoxCNSZKu5CHBdpN0ukNVA 436w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version; bh=9Saj2lrjWaWG1qqAwuy1Z75gAWGCY0wn3YC/qnY384Y=; b=JmHae9JE0f0VoZBcvPA8VTbPM8O311QMZ0HLL8NihYGNiXmFglt606dE5mAxwjjhsy TtpmmqOxp2pLgM45/jEwH1TNlbKK5j2+30i6hzRtGQ7eYPChAvqbuDaqiCrglJMmt4dA OXNJUpOaU588VD8AQaFG6lu4DSucxUtcPPKx0nO7pyAiHGuVdUTW6A378TXtxkLsnet5 0bFKEFoUFAJMBWKooUsmhWHgQPYO5WoZTcZESZuncxH0lRhMlkTyc+cPlp0Y6lj+NbPB L3UedtPZOo3w2sb3wdXwmbMd/S033CtEyYpQfUb78VJtsv9JmRAwlZFWbuvcCqhLbLxO +MPw== X-Gm-Message-State: APjAAAV5Hb7rB6U+swpAfDDQIlp2hvotbyjTULONPJg/dX1M/DXUPbH9 EBRj5rm0pJE/KTPalJBkhDtBfJwY X-Google-Smtp-Source: APXvYqyMAxnidc3bgFH8cROLhjGjokJlkIsy8cMfxFce9wbyqhG5TFL5QCJOrd99VH69/A0HfFaLpw== X-Received: by 2002:a63:fc55:: with SMTP id r21mr624809pgk.441.1559765422342; Wed, 05 Jun 2019 13:10:22 -0700 (PDT) Received: from localhost ([199.68.53.171]) by smtp.gmail.com with ESMTPSA id z4sm21570823pfa.142.2019.06.05.13.10.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 05 Jun 2019 13:10:21 -0700 (PDT) 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> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 36082@debbugs.gnu.org Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Thanks for the review. On Wed, 05 Jun 2019 15:38:06 +0200 Ricardo Wurmus wrote: > Hi Jesse, > > > 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 > > 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$") > > + > > (("") "")) > > + > > (substitute* (find-files "src" "\\.c$") > > + > > (("") "")))))))) > > 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 From 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 © 2019 Oleg Pykhalov ;;; Copyright © 2019 Pierre Langlois ;;; Copyright © 2019 Julien Lepiller -;;; -;;; This file is part of GNU Guix. +;;; Copyright © 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 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$") + (("") "")) + (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+))) -- 2.21.0