From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark H Weaver Subject: Re: [PATCH 2/3] gnu: Add man-db Date: Mon, 07 Apr 2014 01:12:50 -0400 Message-ID: <87vbulsox9.fsf@yeeloong.lan> References: <877g72ezqb.fsf@labrys.i-did-not-set--mail-host-address--so-tickle-me> <874n26ezp0.fsf@labrys.i-did-not-set--mail-host-address--so-tickle-me> <871txaeznu.fsf@labrys.i-did-not-set--mail-host-address--so-tickle-me> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38176) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WX1t6-0003x4-0X for guix-devel@gnu.org; Mon, 07 Apr 2014 01:14:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WX1t0-00077m-SR for guix-devel@gnu.org; Mon, 07 Apr 2014 01:14:27 -0400 Received: from world.peace.net ([96.39.62.75]:45946) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WX1t0-000756-Db for guix-devel@gnu.org; Mon, 07 Apr 2014 01:14:22 -0400 In-Reply-To: <871txaeznu.fsf@labrys.i-did-not-set--mail-host-address--so-tickle-me> (David Thompson's message of "Sun, 06 Apr 2014 20:44:37 -0400") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: David Thompson Cc: guix-devel@gnu.org Hi David, David Thompson writes: > From e67306f142b9878f3f08688fc837f2faf967a5cb Mon Sep 17 00:00:00 2001 > From: David Thompson > Date: Sun, 6 Apr 2014 20:25:01 -0400 > Subject: [PATCH 2/3] gnu: Add man-db. > > * gnu/packages.man.scm (man-db): New variable. > --- > gnu/packages/man.scm | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++- > 1 file changed, 53 insertions(+), 1 deletion(-) > > diff --git a/gnu/packages/man.scm b/gnu/packages/man.scm > index aeb7c15..47eb892 100644 > --- a/gnu/packages/man.scm > +++ b/gnu/packages/man.scm > @@ -20,7 +20,13 @@ > #:use-module (guix licenses) > #:use-module (guix download) > #:use-module (guix packages) > - #:use-module (guix build-system gnu)) > + #:use-module (guix build-system gnu) > + #:use-module (gnu packages flex) > + #:use-module (gnu packages gdbm) > + #:use-module (gnu packages groff) > + #:use-module (gnu packages less) > + #:use-module (gnu packages lynx) > + #:use-module (gnu packages pkg-config)) > > (define-public libpipeline > (package > @@ -41,3 +47,49 @@ > "libpipeline is a C library for manipulating pipelines of subprocesses in > a flexible and convenient way.") > (license gpl3+))) > + > +(define-public man-db > + (package > + (name "man-db") > + (version "2.6.6") > + (source (origin > + (method url-fetch) > + (uri (string-append > + "http://download.savannah.gnu.org/releases/man-db/man-db-" > + version ".tar.xz")) > + (sha256 > + (base32 > + "1hv6byj6sg6cp3jyf08gbmdm4pwhvd5hzmb94xl0w7prin6hzabx")))) > + (build-system gnu-build-system) > + (arguments > + '(#:phases (alist-cons-after > + 'patch-source-shebangs 'patch-test-shebangs > + (lambda* (#:key outputs #:allow-other-keys) > + ;; Patch shebangs in test scripts. > + (use-modules (srfi srfi-1)) Instead of putting the 'use-modules' form within the lambda (I'm surprised this even works, and I wouldn't expect it to necessarily work in future versions of guile) the way to do this is to add a #:modules keyword to the arguments list. See 'hop' in scheme.scm for an example. Be sure to include (guix build gnu-build-system) and (guix build utils) in addition to (srfi srfi-1). Those first two modules are included by default, and you'll need them. > + (let ((out (assoc-ref outputs "out"))) > + (for-each (lambda (file) > + (substitute* file > + (("#! /bin/sh") > + (string-append "#!" (which "sh"))))) > + (remove file-is-directory? > + (find-files "src/tests" ".*"))))) > + %standard-phases) > + #:configure-flags '("--disable-setuid"))) ;; Disable setuid man user. > + (native-inputs > + `(("pkg-config" ,pkg-config))) > + (inputs > + `(("flex" ,flex) > + ("gdbm" ,gdbm) > + ("libpipeline" ,libpipeline) > + ("lynx" ,lynx))) Why is 'lynx' an input? I remember you mentioning on IRC that if PAGER is not set, it launched a web browser by default. I wonder: if you included 'less' and not 'lynx', would it use 'less' by default instead? Thanks! Mark