unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Pierre Neidhardt <ambrevar@gmail.com>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 31114@debbugs.gnu.org
Subject: [bug#31114] [PATCH] gnu: Add fortune-mod.
Date: Tue, 10 Apr 2018 21:52:02 +0530	[thread overview]
Message-ID: <87efjnowut.fsf@gmail.com> (raw)
In-Reply-To: <87a7ub8j1b.fsf@gnu.org>


[-- Attachment #1.1: Type: text/plain, Size: 208 bytes --]


Yup, we need valgrind as a propagated input for perl-test-runvalgrind.

Attached the whole patch set: 3 perl packages and fortune-mod.

-- 
Pierre Neidhardt

A pencil with no point needs no eraser.

[-- Attachment #1.2: 0001-gnu-Add-perl-file-readbackwards.patch --]
[-- Type: text/x-patch, Size: 2249 bytes --]

From 2314e654a55ce7cecfeeb4410e92a7490f4128f3 Mon Sep 17 00:00:00 2001
From: Pierre Neidhardt <ambrevar@gmail.com>
Date: Tue, 10 Apr 2018 21:00:08 +0530
Subject: [PATCH 1/4] gnu: Add perl-file-readbackwards.

* gnu/packages/perl.scm (perl-file-readbackwards): New variable.
---
 gnu/packages/perl.scm | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm
index 50273d31e..e1d029c38 100644
--- a/gnu/packages/perl.scm
+++ b/gnu/packages/perl.scm
@@ -19,6 +19,7 @@
 ;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
 ;;; Copyright © 2017 Christopher Allan Webber <cwebber@dustycloud.org>
 ;;; Copyright © 2018 Oleg Pykhalov <go.wigust@gmail.com>
+;;; Copyright © 2018 Pierre Neidhardt <ambrevar@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -3501,6 +3502,35 @@ provided base directory and can return files (and/or directories if desired)
 matching a regular expression.")
     (home-page "http://search.cpan.org/~dopacki/File-List//")))
 
+(define-public perl-file-readbackwards
+  (package
+    (name "perl-file-readbackwards")
+    (version "1.05")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "mirror://cpan/authors/id/U/UR/URI/File-ReadBackwards-"
+             version
+             ".tar.gz"))
+       (sha256
+        (base32
+         "0vldy5q0zyf1cwzwb1gv14f8vg2f21bw96b8wvkw6z2hhypn3cl2"))))
+    (build-system perl-build-system)
+    (home-page
+     "http://search.cpan.org/dist/File-ReadBackwards/")
+    (synopsis "Read a file backwards by lines")
+    (description "This module reads a file backwards line by line. It is
+simple to use, memory efficient and fast. It supports both an object and a
+tied handle interface.
+
+It is intended for processing log and other similar text files which
+typically have their newest entries appended to them. By default files
+are assumed to be plain text and have a line ending appropriate to the
+OS. But you can set the input record separator string on a per file
+basis.")
+    (license #f)))
+
 (define-public perl-file-remove
   (package
     (name "perl-file-remove")
-- 
2.16.3


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.3: 0002-gnu-Add-perl-io-all.patch --]
[-- Type: text/x-patch, Size: 2100 bytes --]

From e819b9532883aaf168a2fcc74daa40341dcf8afb Mon Sep 17 00:00:00 2001
From: Pierre Neidhardt <ambrevar@gmail.com>
Date: Tue, 10 Apr 2018 21:01:09 +0530
Subject: [PATCH 2/4] gnu: Add perl-io-all.

* gnu/packages/perl.scm (perl-io-all): New variable.
---
 gnu/packages/perl.scm | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm
index e1d029c38..4bef99dce 100644
--- a/gnu/packages/perl.scm
+++ b/gnu/packages/perl.scm
@@ -46,6 +46,7 @@
   #:use-module (guix build-system perl)
   #:use-module (gnu packages base)
   #:use-module (gnu packages compression)
+  #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages perl-check)
   #:use-module (gnu packages perl-web)
   #:use-module (gnu packages pkg-config))
@@ -4086,6 +4087,32 @@ This document describes how to use Inline with the C programming language.
 It also goes a bit into Perl C internals.")
     (license (package-license perl))))
 
+(define-public perl-io-all
+  (package
+    (name "perl-io-all")
+    (version "0.87")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "mirror://cpan/authors/id/F/FR/FREW/IO-All-"
+             version
+             ".tar.gz"))
+       (sha256
+        (base32
+         "0nsd9knlbd7if2v6zwj4q978axq0w5hk8ymp61z14a821hjivqjl"))))
+    (build-system perl-build-system)
+    (propagated-inputs
+     `(("perl-file-mimeinfo" ,perl-file-mimeinfo)
+       ("perl-file-readbackwards" ,perl-file-readbackwards)))
+    (home-page "http://search.cpan.org/dist/IO-All/")
+    (synopsis "IO::All to Larry Wall!")
+    (description "IO::All combines all of the best Perl IO modules into a
+single nifty object oriented interface to greatly simplify your everyday Perl
+IO idioms. It exports a single function called io, which returns a new IO::All
+object. And that object can do it all!")
+    (license perl-license)))
+
 (define-public perl-io-captureoutput
   (package
     (name "perl-io-captureoutput")
-- 
2.16.3


[-- Attachment #1.4: 0003-gnu-Add-perl-test-runvalgrind.patch --]
[-- Type: text/x-patch, Size: 2401 bytes --]

From a1d5a57a4e55f7aca4033844ff764aa2a0069bf9 Mon Sep 17 00:00:00 2001
From: Pierre Neidhardt <ambrevar@gmail.com>
Date: Tue, 10 Apr 2018 21:01:44 +0530
Subject: [PATCH 3/4] gnu: Add perl-test-runvalgrind

* gnu/packages/perl-check.scm (perl-test-runvalgrind): New variable.
---
 gnu/packages/perl-check.scm | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/gnu/packages/perl-check.scm b/gnu/packages/perl-check.scm
index 1fd725f65..832efc2b7 100644
--- a/gnu/packages/perl-check.scm
+++ b/gnu/packages/perl-check.scm
@@ -12,6 +12,7 @@
 ;;; Copyright © 2017 Petter <petter@mykolab.ch>
 ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2018 Oleg Pykhalov <go.wigust@gmail.com>
+;;; Copyright © 2018 Pierre Neidhardt <ambrevar@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -31,6 +32,7 @@
 (define-module (gnu packages perl-check)
   #:use-module (guix licenses)
   #:use-module (gnu packages)
+  #:use-module (gnu packages valgrind)
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module (guix build-system perl)
@@ -1001,6 +1003,33 @@ reported, and the tests skipped.")
     (description "Test::Roo provides composable, reusable tests with roles.")
     (license asl2.0)))
 
+(define-public perl-test-runvalgrind
+  (package
+    (name "perl-test-runvalgrind")
+    (version "0.2.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "mirror://cpan/authors/id/S/SH/SHLOMIF/Test-RunValgrind-"
+             version
+             ".tar.gz"))
+       (sha256
+        (base32
+         "0cfndkn2k9pcx290wcblwmrwh1ybs0grxjlsrp8fbqqbmmjpb53h"))))
+    (build-system perl-build-system)
+    (native-inputs
+     `(("perl-module-build" ,perl-module-build)))
+    (propagated-inputs
+     `(("perl-path-tiny" ,perl-path-tiny)
+       ("perl-test-trap" ,perl-test-trap)
+       ("valgrind" ,valgrind)))
+    (home-page "http://search.cpan.org/dist/Test-RunValgrind/")
+    (synopsis "Tests that an external program is valgrind-clean")
+    (description "Test::RunValgind checks weather Valgrind does not detect
+errors (such as memory leaks) in an arbitrary binary executable.")
+    (license x11)))
+
 (define-public perl-test-script
   (package
     (name "perl-test-script")
-- 
2.16.3


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.5: 0004-gnu-Add-fortune-mod.patch --]
[-- Type: text/x-patch, Size: 3591 bytes --]

From d4ab7650cae4e4cf3403a5e03bc68cef15e4109a Mon Sep 17 00:00:00 2001
From: Pierre Neidhardt <ambrevar@gmail.com>
Date: Mon, 9 Apr 2018 23:01:04 +0530
Subject: [PATCH 4/4] gnu: Add fortune-mod.

* gnu/packages/games.scm (fortune-mod): New variable.
---
 gnu/packages/games.scm | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 54 insertions(+)

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 5207e08d6..47557a762 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -112,6 +112,7 @@
   #:use-module (gnu packages gstreamer)
   #:use-module (gnu packages bash)
   #:use-module (gnu packages perl)
+  #:use-module (gnu packages perl-check)
   #:use-module (gnu packages qt)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages pulseaudio)
@@ -4851,3 +4852,56 @@ Strife, Chex Quest, and fan-created games like Harmony, Hacx and Freedoom.")
                    (license:non-copyleft ; modified dumb
                     "file://dumb/licence.txt"
                     "Dumb license, explicitly GPL compatible.")))))
+
+(define-public fortune-mod
+  (package
+    (name "fortune-mod")
+    (version "2.4.1")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://github.com/shlomif/fortune-mod/"
+                                  "archive/" name "-" version ".tar.gz"))
+              (sha256
+               (base32
+                "1hnqpkassh7fwg2jgvybr8mw7vzfikbrhb5r22367ilfwxnl9yd2"))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:test-target "check"
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'fix-build-env
+           (lambda* (#:key inputs #:allow-other-keys)
+             (use-modules (guix build utils))
+             (let* ((cmake-rules (assoc-ref inputs "cmake-rules")))
+               (copy-file cmake-rules
+                          (string-append "fortune-mod/cmake/"
+                                         (strip-store-file-name cmake-rules)))
+               (chdir "fortune-mod"))))
+         (add-after 'install 'fix-install-directory
+           ;; Move binary from "games/" to "bin/".
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out")))
+               (rename-file (string-append out "/games/fortune")
+                            (string-append out "/bin/fortune"))
+               #t))))))
+    (inputs `(("recode" ,recode)))
+    (native-inputs
+     `(("perl" ,perl)
+       ;; The following is only needed for tests.
+       ("perl-file-find-object" ,perl-file-find-object)
+       ("perl-test-differences" ,perl-test-differences)
+       ("perl-class-xsaccessor" ,perl-class-xsaccessor)
+       ("perl-io-all" ,perl-io-all)
+       ("perl-test-runvalgrind" ,perl-test-runvalgrind)
+       ("cmake-rules"
+        ,(origin
+           (method url-fetch)
+           (uri (string-append "https://bitbucket.org/shlomif/shlomif-cmake-modules/"
+                               "raw/default/shlomif-cmake-modules/Shlomif_Common.cmake"))
+           (sha256
+            (base32 "0kx9s1qqhhzprp1w3b67xmsns0n0v506bg5hgrshxaxpy6lqiwb2"))))))
+    (home-page "http://www.shlomifish.org/open-source/projects/fortune-mod/")
+    (synopsis "The Fortune Cookie program from BSD games")
+    (description "Fortune is a command-line utility which displays a random
+quotation from a collection of quotes.")
+    (license license:gpl2+)))
-- 
2.16.3


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

  reply	other threads:[~2018-04-10 16:23 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-09 17:32 [bug#31114] [PATCH] gnu: Add fortune-mod Pierre Neidhardt
2018-04-09 17:39 ` Pierre Neidhardt
2018-04-09 20:51   ` Ludovic Courtès
2018-04-10  7:05     ` Pierre Neidhardt
2018-04-10  7:24       ` Pierre Neidhardt
2018-04-10 10:14         ` Ludovic Courtès
2018-04-10 16:22           ` Pierre Neidhardt [this message]
2018-04-19  9:56             ` bug#31114: " Ludovic Courtès
2018-04-19 12:34               ` [bug#31114] " Pierre Neidhardt
2018-04-23 15:12                 ` Ludovic Courtès
2018-04-09 20:55   ` Leo Famulari
2018-04-10  7:00     ` Pierre Neidhardt
2018-04-18 20:42       ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87efjnowut.fsf@gmail.com \
    --to=ambrevar@gmail.com \
    --cc=31114@debbugs.gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).