* [PATCH 0/3] Add man-db and libpipeline
@ 2014-04-07 0:43 David Thompson
2014-04-07 0:43 ` [PATCH 1/3] gnu: Add libpipeline David Thompson
2014-04-09 0:52 ` [PATCH 0/3] Add man-db and libpipeline David Thompson
0 siblings, 2 replies; 15+ messages in thread
From: David Thompson @ 2014-04-07 0:43 UTC (permalink / raw)
To: guix-devel
The following patchset adds a package for man-db, a package for its
prerequisite libpipeline, and moves the help2man package recipe into the
new (gnu packages man) module.
- Dave
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 1/3] gnu: Add libpipeline
2014-04-07 0:43 [PATCH 0/3] Add man-db and libpipeline David Thompson
@ 2014-04-07 0:43 ` David Thompson
2014-04-07 0:44 ` [PATCH 2/3] gnu: Add man-db David Thompson
2014-04-07 7:46 ` [PATCH 1/3] gnu: Add libpipeline Ludovic Courtès
2014-04-09 0:52 ` [PATCH 0/3] Add man-db and libpipeline David Thompson
1 sibling, 2 replies; 15+ messages in thread
From: David Thompson @ 2014-04-07 0:43 UTC (permalink / raw)
To: guix-devel
[-- Attachment #1: 0001-gnu-Add-libpipeline.patch --]
[-- Type: text/x-diff, Size: 2826 bytes --]
From 665b1e28b62facbf43dda65cb23bfebef2ac2e42 Mon Sep 17 00:00:00 2001
From: David Thompson <dthompson@member.fsf.org>
Date: Sun, 6 Apr 2014 15:36:40 -0400
Subject: [PATCH 1/3] gnu: Add libpipeline.
* gnu/packages/man.scm: New file.
* gnu-system.am (GNU_SYSTEM_MODULES): Add it.
---
gnu-system.am | 1 +
gnu/packages/man.scm | 43 +++++++++++++++++++++++++++++++++++++++++++
2 files changed, 44 insertions(+)
create mode 100644 gnu/packages/man.scm
diff --git a/gnu-system.am b/gnu-system.am
index 5d817cc..6b2a3d4 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -143,6 +143,7 @@ GNU_SYSTEM_MODULES = \
gnu/packages/lvm.scm \
gnu/packages/lynx.scm \
gnu/packages/m4.scm \
+ gnu/packages/man.scm \
gnu/packages/mail.scm \
gnu/packages/make-bootstrap.scm \
gnu/packages/maths.scm \
diff --git a/gnu/packages/man.scm b/gnu/packages/man.scm
new file mode 100644
index 0000000..aeb7c15
--- /dev/null
+++ b/gnu/packages/man.scm
@@ -0,0 +1,43 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2014 David Thompson <dthompson2@worcester.edu>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; 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
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages man)
+ #:use-module (guix licenses)
+ #:use-module (guix download)
+ #:use-module (guix packages)
+ #:use-module (guix build-system gnu))
+
+(define-public libpipeline
+ (package
+ (name "libpipeline")
+ (version "1.3.0")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append
+ "http://download.savannah.gnu.org/releases/libpipeline/libpipeline-"
+ version ".tar.gz"))
+ (sha256
+ (base32
+ "12d6ldcj7kv2nv832b23v97g7035d0ybq0ig7h0yr7xk9czd3z7i"))))
+ (build-system gnu-build-system)
+ (home-page "http://libpipeline.nongnu.org/")
+ (synopsis "C library for manipulating pipelines of subprocesses")
+ (description
+ "libpipeline is a C library for manipulating pipelines of subprocesses in
+a flexible and convenient way.")
+ (license gpl3+)))
--
1.8.4
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 2/3] gnu: Add man-db
2014-04-07 0:43 ` [PATCH 1/3] gnu: Add libpipeline David Thompson
@ 2014-04-07 0:44 ` David Thompson
2014-04-07 0:45 ` [PATCH 3/3] gnu: Move help2man package to (gnu packages man) module David Thompson
2014-04-07 5:12 ` [PATCH 2/3] gnu: Add man-db Mark H Weaver
2014-04-07 7:46 ` [PATCH 1/3] gnu: Add libpipeline Ludovic Courtès
1 sibling, 2 replies; 15+ messages in thread
From: David Thompson @ 2014-04-07 0:44 UTC (permalink / raw)
To: guix-devel
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: 0002-gnu-Add-man-db.patch --]
[-- Type: text/x-diff, Size: 2998 bytes --]
From e67306f142b9878f3f08688fc837f2faf967a5cb Mon Sep 17 00:00:00 2001
From: David Thompson <dthompson@member.fsf.org>
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))
+ (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)))
+ (propagated-inputs
+ `(("groff" ,groff)
+ ("less" ,less)))
+ (home-page "http://man-db.nongnu.org/")
+ (synopsis "Standard Unix documentation system")
+ (description
+ "Man-db is an implementation of the standard Unix documentation system
+accessed using the man command. It uses a Berkeley DB database in place of
+the traditional flat-text whatis databases.")
+ (license gpl2+)))
--
1.8.4
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 3/3] gnu: Move help2man package to (gnu packages man) module
2014-04-07 0:44 ` [PATCH 2/3] gnu: Add man-db David Thompson
@ 2014-04-07 0:45 ` David Thompson
2014-04-07 7:47 ` Ludovic Courtès
2014-04-07 5:12 ` [PATCH 2/3] gnu: Add man-db Mark H Weaver
1 sibling, 1 reply; 15+ messages in thread
From: David Thompson @ 2014-04-07 0:45 UTC (permalink / raw)
To: guix-devel
[-- Attachment #1: 0003-gnu-Move-help2man-package-to-gnu-packages-man-module.patch --]
[-- Type: text/x-diff, Size: 5172 bytes --]
From ef7e3f74b519df9cac77d23e97aa4371e68352fc Mon Sep 17 00:00:00 2001
From: David Thompson <dthompson@member.fsf.org>
Date: Sun, 6 Apr 2014 20:30:37 -0400
Subject: [PATCH 3/3] gnu: Move help2man package to (gnu packages man) module.
* gnu/packages/man.scm (help2man): New variable.
* gnu/packages/help2man.scm: Delete it.
* gnu-system.am (GNU_SYSTEM_MODULES): Delete 'gnu/packages/help2man.scm'.
---
gnu-system.am | 1 -
gnu/packages/help2man.scm | 53 -----------------------------------------------
gnu/packages/man.scm | 31 +++++++++++++++++++++++++++
3 files changed, 31 insertions(+), 54 deletions(-)
delete mode 100644 gnu/packages/help2man.scm
diff --git a/gnu-system.am b/gnu-system.am
index 6b2a3d4..04740a0 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -107,7 +107,6 @@ GNU_SYSTEM_MODULES = \
gnu/packages/guile-wm.scm \
gnu/packages/gv.scm \
gnu/packages/gxmessage.scm \
- gnu/packages/help2man.scm \
gnu/packages/hugs.scm \
gnu/packages/hurd.scm \
gnu/packages/icu4c.scm \
diff --git a/gnu/packages/help2man.scm b/gnu/packages/help2man.scm
deleted file mode 100644
index 9f3af7c..0000000
--- a/gnu/packages/help2man.scm
+++ /dev/null
@@ -1,53 +0,0 @@
-;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2012 Ludovic Courtès <ludo@gnu.org>
-;;;
-;;; This file is part of GNU Guix.
-;;;
-;;; 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
-;;; the Free Software Foundation; either version 3 of the License, or (at
-;;; your option) any later version.
-;;;
-;;; GNU Guix is distributed in the hope that it will be useful, but
-;;; WITHOUT ANY WARRANTY; without even the implied warranty of
-;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;;; GNU General Public License for more details.
-;;;
-;;; You should have received a copy of the GNU General Public License
-;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
-
-(define-module (gnu packages help2man)
- #:use-module (guix licenses)
- #:use-module (guix download)
- #:use-module (guix packages)
- #:use-module (guix build-system gnu)
- #:use-module (gnu packages perl))
-
-(define-public help2man
- (package
- (name "help2man")
- (version "1.45.1")
- (source
- (origin
- (method url-fetch)
- (uri (string-append "mirror://gnu/help2man/help2man-"
- version ".tar.xz"))
- (sha256
- (base32
- "1hk7ciqinq7djdb7s94y3jxh06rp8i93bpjmg4r40cniws8wf3y7"))))
- (build-system gnu-build-system)
- (arguments `(;; There's no `check' target.
- #:tests? #f))
- (inputs
- `(("perl" ,perl)
- ;; TODO: Add these optional dependencies.
- ;; ("perl-LocaleGettext" ,perl-LocaleGettext)
- ;; ("gettext" ,gettext)
- ))
- (home-page "http://www.gnu.org/software/help2man/")
- (synopsis "Automatically generate man pages from program --help")
- (description
- "GNU help2man is a program that converts the output of standard
-\"--help\" and \"--version\" command-line arguments into a manual page
-automatically.")
- (license gpl3+)))
diff --git a/gnu/packages/man.scm b/gnu/packages/man.scm
index 47eb892..3fcca5d 100644
--- a/gnu/packages/man.scm
+++ b/gnu/packages/man.scm
@@ -1,4 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2012 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2014 David Thompson <dthompson2@worcester.edu>
;;;
;;; This file is part of GNU Guix.
@@ -26,6 +27,7 @@
#:use-module (gnu packages groff)
#:use-module (gnu packages less)
#:use-module (gnu packages lynx)
+ #:use-module (gnu packages perl)
#:use-module (gnu packages pkg-config))
(define-public libpipeline
@@ -93,3 +95,32 @@ a flexible and convenient way.")
accessed using the man command. It uses a Berkeley DB database in place of
the traditional flat-text whatis databases.")
(license gpl2+)))
+
+(define-public help2man
+ (package
+ (name "help2man")
+ (version "1.45.1")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append "mirror://gnu/help2man/help2man-"
+ version ".tar.xz"))
+ (sha256
+ (base32
+ "1hk7ciqinq7djdb7s94y3jxh06rp8i93bpjmg4r40cniws8wf3y7"))))
+ (build-system gnu-build-system)
+ (arguments `(;; There's no `check' target.
+ #:tests? #f))
+ (inputs
+ `(("perl" ,perl)
+ ;; TODO: Add these optional dependencies.
+ ;; ("perl-LocaleGettext" ,perl-LocaleGettext)
+ ;; ("gettext" ,gnu-gettext)
+ ))
+ (home-page "http://www.gnu.org/software/help2man/")
+ (synopsis "Automatically generate man pages from program --help")
+ (description
+ "GNU help2man is a program that converts the output of standard
+\"--help\" and \"--version\" command-line arguments into a manual page
+automatically.")
+ (license gpl3+)))
--
1.8.4
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH 2/3] gnu: Add man-db
2014-04-07 0:44 ` [PATCH 2/3] gnu: Add man-db David Thompson
2014-04-07 0:45 ` [PATCH 3/3] gnu: Move help2man package to (gnu packages man) module David Thompson
@ 2014-04-07 5:12 ` Mark H Weaver
[not found] ` <87txa59xvw.fsf@labrys.i-did-not-set--mail-host-address--so-tickle-me>
1 sibling, 1 reply; 15+ messages in thread
From: Mark H Weaver @ 2014-04-07 5:12 UTC (permalink / raw)
To: David Thompson; +Cc: guix-devel
Hi David,
David Thompson <dthompson2@worcester.edu> writes:
> From e67306f142b9878f3f08688fc837f2faf967a5cb Mon Sep 17 00:00:00 2001
> From: David Thompson <dthompson@member.fsf.org>
> 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
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 1/3] gnu: Add libpipeline
2014-04-07 0:43 ` [PATCH 1/3] gnu: Add libpipeline David Thompson
2014-04-07 0:44 ` [PATCH 2/3] gnu: Add man-db David Thompson
@ 2014-04-07 7:46 ` Ludovic Courtès
1 sibling, 0 replies; 15+ messages in thread
From: Ludovic Courtès @ 2014-04-07 7:46 UTC (permalink / raw)
To: David Thompson; +Cc: guix-devel
David Thompson <dthompson2@worcester.edu> skribis:
> From 665b1e28b62facbf43dda65cb23bfebef2ac2e42 Mon Sep 17 00:00:00 2001
> From: David Thompson <dthompson@member.fsf.org>
> Date: Sun, 6 Apr 2014 15:36:40 -0400
> Subject: [PATCH 1/3] gnu: Add libpipeline.
>
> * gnu/packages/man.scm: New file.
> * gnu-system.am (GNU_SYSTEM_MODULES): Add it.
[...]
> + (name "libpipeline")
> + (version "1.3.0")
> + (source (origin
> + (method url-fetch)
> + (uri (string-append
> + "http://download.savannah.gnu.org/releases/libpipeline/libpipeline-"
OK to push with the URL base changed to
“mirror://savannah/libpipeline/libpipline-”.
Thanks!
Ludo’.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 3/3] gnu: Move help2man package to (gnu packages man) module
2014-04-07 0:45 ` [PATCH 3/3] gnu: Move help2man package to (gnu packages man) module David Thompson
@ 2014-04-07 7:47 ` Ludovic Courtès
0 siblings, 0 replies; 15+ messages in thread
From: Ludovic Courtès @ 2014-04-07 7:47 UTC (permalink / raw)
To: David Thompson; +Cc: guix-devel
David Thompson <dthompson2@worcester.edu> skribis:
> From ef7e3f74b519df9cac77d23e97aa4371e68352fc Mon Sep 17 00:00:00 2001
> From: David Thompson <dthompson@member.fsf.org>
> Date: Sun, 6 Apr 2014 20:30:37 -0400
> Subject: [PATCH 3/3] gnu: Move help2man package to (gnu packages man) module.
>
> * gnu/packages/man.scm (help2man): New variable.
> * gnu/packages/help2man.scm: Delete it.
> * gnu-system.am (GNU_SYSTEM_MODULES): Delete 'gnu/packages/help2man.scm'.
OK to push!
Ludo’.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 2/3] gnu: Add man-db
[not found] ` <87txa59xvw.fsf@labrys.i-did-not-set--mail-host-address--so-tickle-me>
@ 2014-04-08 1:51 ` Mark H Weaver
2014-04-08 11:46 ` David Thompson
0 siblings, 1 reply; 15+ messages in thread
From: Mark H Weaver @ 2014-04-08 1:51 UTC (permalink / raw)
To: David Thompson; +Cc: guix-devel
David Thompson <dthompson2@worcester.edu> writes:
>> 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?
>
> My system seems to be doing weird things and insisting on w3m for some
> reason.
That might be because the '.bash_profile' file I showed you set PAGER to
w3m. I found that if I unset PAGER, this man-db uses 'less' by default,
which I think is sensible.
> + (propagated-inputs
> + `(("groff" ,groff)
> + ("less" ,less)))
Instead of making these propagated inputs, how about arranging for
man-db to invoke the programs directly from the store? There are a
number of ./configure options that should probably be specified with
absolute pathnames:
--with-pager
--with-nroff
--with-eqn
--with-neqn
--with-tbl
--with-refer
--with-pic
--with-gzip
--with-bzip2
--with-xz
You could pass add these to the #:configure-flags. The goal should be
for 'man' to work properly without having to look up any of its
dependent programs from $PATH and with PAGER unset.
From the #:configure-flags code, %build-inputs can be looked up for the
input paths. So you could do something like (untested):
--8<---------------cut here---------------start------------->8---
`(#:configure-flags
(let ((groff (assoc-ref %build-inputs "groff"))
(less (assoc-ref %build-inputs "less"))
(gzip (assoc-ref %build-inputs "gzip"))
...)
(append (list (string-append "--with-pager=" less "/bin/less")
(string-append "--with-gzip=" gzip "/bin/gzip")
...)
(map (lambda (prog)
(string-append "--with-" prog "=" groff "/bin/" prog))
'("nroff" "eqn" "neqn" "tbl" "refer" "pic")))))
--8<---------------cut here---------------end--------------->8---
Thanks!
Mark
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 2/3] gnu: Add man-db
2014-04-08 1:51 ` Mark H Weaver
@ 2014-04-08 11:46 ` David Thompson
2014-04-08 12:12 ` Ludovic Courtès
0 siblings, 1 reply; 15+ messages in thread
From: David Thompson @ 2014-04-08 11:46 UTC (permalink / raw)
To: Mark H Weaver; +Cc: guix-devel
[-- Attachment #1: Type: text/plain, Size: 2506 bytes --]
Mark H Weaver <mhw@netris.org> writes:
> David Thompson <dthompson2@worcester.edu> writes:
>
>>> 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?
>>
>> My system seems to be doing weird things and insisting on w3m for some
>> reason.
>
> That might be because the '.bash_profile' file I showed you set PAGER to
> w3m. I found that if I unset PAGER, this man-db uses 'less' by default,
> which I think is sensible.
Can't believe I didn't notice the PAGER variable there. I was staring
right at it.
>
>> + (propagated-inputs
>> + `(("groff" ,groff)
>> + ("less" ,less)))
>
> Instead of making these propagated inputs, how about arranging for
> man-db to invoke the programs directly from the store? There are a
> number of ./configure options that should probably be specified with
> absolute pathnames:
>
> --with-pager
> --with-nroff
> --with-eqn
> --with-neqn
> --with-tbl
> --with-refer
> --with-pic
> --with-gzip
> --with-bzip2
> --with-xz
>
> You could pass add these to the #:configure-flags. The goal should be
> for 'man' to work properly without having to look up any of its
> dependent programs from $PATH and with PAGER unset.
>
> From the #:configure-flags code, %build-inputs can be looked up for the
> input paths. So you could do something like (untested):
>
> --8<---------------cut here---------------start------------->8---
> `(#:configure-flags
> (let ((groff (assoc-ref %build-inputs "groff"))
> (less (assoc-ref %build-inputs "less"))
> (gzip (assoc-ref %build-inputs "gzip"))
> ...)
> (append (list (string-append "--with-pager=" less "/bin/less")
> (string-append "--with-gzip=" gzip "/bin/gzip")
> ...)
> (map (lambda (prog)
> (string-append "--with-" prog "=" groff "/bin/" prog))
> '("nroff" "eqn" "neqn" "tbl" "refer" "pic")))))
> --8<---------------cut here---------------end--------------->8---
>
> Thanks!
> Mark
Wow, this worked perfectly. Now man uses less by default even when I
have no PAGER variable set and less is uninstalled. The same thing goes
for groff, gzip, etc.
I've attached the updated patch. Thanks for your help. This is the
most complicated package I've tried to write so far.
- Dave
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0002-gnu-Add-man-db.patch --]
[-- Type: text/x-diff, Size: 3780 bytes --]
From a0269a3830dfc2dd9cc6b8402a571a7efd90e717 Mon Sep 17 00:00:00 2001
From: David Thompson <dthompson@member.fsf.org>
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 | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 68 insertions(+), 1 deletion(-)
diff --git a/gnu/packages/man.scm b/gnu/packages/man.scm
index e68b1f2..5457037 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,64 @@
"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.
+ (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
+ (let ((groff (assoc-ref %build-inputs "groff"))
+ (less (assoc-ref %build-inputs "less"))
+ (gzip (assoc-ref %build-inputs "gzip"))
+ (bzip2 (assoc-ref %build-inputs "bzip2"))
+ (xz (assoc-ref %build-inputs "xz")))
+ ;; Invoke groff, less, gzip, bzip2, and xz directly from the store.
+ (append (list "--disable-setuid" ;; Disable setuid man user.
+ (string-append "--with-pager=" less "/bin/less")
+ (string-append "--with-gzip=" gzip "/bin/gzip")
+ (string-append "--with-bzip2=" bzip2 "/bin/gzip")
+ (string-append "--with-xz=" xz "/bin/xz"))
+ (map (lambda (prog)
+ (string-append "--with-" prog "=" groff "/bin/" prog))
+ '("nroff" "eqn" "neqn" "tbl" "refer" "pic"))))
+ #:modules ((guix build gnu-build-system)
+ (guix build utils)
+ (srfi srfi-1))))
+ (native-inputs
+ `(("pkg-config" ,pkg-config)))
+ (inputs
+ `(("flex" ,flex)
+ ("gdbm" ,gdbm)
+ ("groff" ,groff)
+ ("less" ,less)
+ ("libpipeline" ,libpipeline)))
+ (home-page "http://man-db.nongnu.org/")
+ (synopsis "Standard Unix documentation system")
+ (description
+ "Man-db is an implementation of the standard Unix documentation system
+accessed using the man command. It uses a Berkeley DB database in place of
+the traditional flat-text whatis databases.")
+ (license gpl2+)))
--
1.8.4
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH 2/3] gnu: Add man-db
2014-04-08 11:46 ` David Thompson
@ 2014-04-08 12:12 ` Ludovic Courtès
2014-04-08 12:40 ` Thompson, David
2014-04-08 22:02 ` David Thompson
0 siblings, 2 replies; 15+ messages in thread
From: Ludovic Courtès @ 2014-04-08 12:12 UTC (permalink / raw)
To: David Thompson; +Cc: guix-devel
David Thompson <dthompson2@worcester.edu> skribis:
> + (source (origin
> + (method url-fetch)
> + (uri (string-append
> + "http://download.savannah.gnu.org/releases/man-db/man-db-"
> + version ".tar.xz"))
Please use mirror://savannah.
Other than that, fine with me; Mark?
Ludo’.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 2/3] gnu: Add man-db
2014-04-08 12:12 ` Ludovic Courtès
@ 2014-04-08 12:40 ` Thompson, David
2014-04-08 22:02 ` David Thompson
1 sibling, 0 replies; 15+ messages in thread
From: Thompson, David @ 2014-04-08 12:40 UTC (permalink / raw)
To: Ludovic Courtès; +Cc: guix-devel
On Tue, Apr 8, 2014 at 8:12 AM, Ludovic Courtès <ludo@gnu.org> wrote:
> David Thompson <dthompson2@worcester.edu> skribis:
>
>> + (source (origin
>> + (method url-fetch)
>> + (uri (string-append
>> + "http://download.savannah.gnu.org/releases/man-db/man-db-"
>> + version ".tar.xz"))
>
> Please use mirror://savannah.
Yet another thing that I should've caught. Will fix. Sorry!
>
> Other than that, fine with me; Mark?
>
> Ludo'.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 2/3] gnu: Add man-db
2014-04-08 12:12 ` Ludovic Courtès
2014-04-08 12:40 ` Thompson, David
@ 2014-04-08 22:02 ` David Thompson
2014-04-08 22:55 ` Nikita Karetnikov
1 sibling, 1 reply; 15+ messages in thread
From: David Thompson @ 2014-04-08 22:02 UTC (permalink / raw)
To: Ludovic Courtès; +Cc: guix-devel
[-- Attachment #1: Type: text/plain, Size: 573 bytes --]
Ludovic Courtès <ludo@gnu.org> writes:
> David Thompson <dthompson2@worcester.edu> skribis:
>
>> + (source (origin
>> + (method url-fetch)
>> + (uri (string-append
>> + "http://download.savannah.gnu.org/releases/man-db/man-db-"
>> + version ".tar.xz"))
>
> Please use mirror://savannah.
>
> Other than that, fine with me; Mark?
>
> Ludo’.
For some reason I'm having trouble pushing to the git repo.
Here's the final version of this patch, if someone else wants to try.
- Dave
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0002-gnu-Add-man-db.patch --]
[-- Type: text/x-diff, Size: 3749 bytes --]
From eb3c76452337462f9ca8805decf74e9f3f75d1f1 Mon Sep 17 00:00:00 2001
From: David Thompson <dthompson@member.fsf.org>
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 | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 67 insertions(+), 1 deletion(-)
diff --git a/gnu/packages/man.scm b/gnu/packages/man.scm
index e68b1f2..db13fc1 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,63 @@
"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 "mirror://savannah/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.
+ (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
+ (let ((groff (assoc-ref %build-inputs "groff"))
+ (less (assoc-ref %build-inputs "less"))
+ (gzip (assoc-ref %build-inputs "gzip"))
+ (bzip2 (assoc-ref %build-inputs "bzip2"))
+ (xz (assoc-ref %build-inputs "xz")))
+ ;; Invoke groff, less, gzip, bzip2, and xz directly from the store.
+ (append (list "--disable-setuid" ;; Disable setuid man user.
+ (string-append "--with-pager=" less "/bin/less")
+ (string-append "--with-gzip=" gzip "/bin/gzip")
+ (string-append "--with-bzip2=" bzip2 "/bin/gzip")
+ (string-append "--with-xz=" xz "/bin/xz"))
+ (map (lambda (prog)
+ (string-append "--with-" prog "=" groff "/bin/" prog))
+ '("nroff" "eqn" "neqn" "tbl" "refer" "pic"))))
+ #:modules ((guix build gnu-build-system)
+ (guix build utils)
+ (srfi srfi-1))))
+ (native-inputs
+ `(("pkg-config" ,pkg-config)))
+ (inputs
+ `(("flex" ,flex)
+ ("gdbm" ,gdbm)
+ ("groff" ,groff)
+ ("less" ,less)
+ ("libpipeline" ,libpipeline)))
+ (home-page "http://man-db.nongnu.org/")
+ (synopsis "Standard Unix documentation system")
+ (description
+ "Man-db is an implementation of the standard Unix documentation system
+accessed using the man command. It uses a Berkeley DB database in place of
+the traditional flat-text whatis databases.")
+ (license gpl2+)))
--
1.8.4
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH 2/3] gnu: Add man-db
2014-04-08 22:02 ` David Thompson
@ 2014-04-08 22:55 ` Nikita Karetnikov
0 siblings, 0 replies; 15+ messages in thread
From: Nikita Karetnikov @ 2014-04-08 22:55 UTC (permalink / raw)
To: David Thompson; +Cc: guix-devel
[-- Attachment #1: Type: text/plain, Size: 85 bytes --]
> For some reason I'm having trouble pushing to the git repo.
What kind of trouble?
[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 0/3] Add man-db and libpipeline
2014-04-07 0:43 [PATCH 0/3] Add man-db and libpipeline David Thompson
2014-04-07 0:43 ` [PATCH 1/3] gnu: Add libpipeline David Thompson
@ 2014-04-09 0:52 ` David Thompson
2014-04-09 9:32 ` Ludovic Courtès
1 sibling, 1 reply; 15+ messages in thread
From: David Thompson @ 2014-04-09 0:52 UTC (permalink / raw)
To: guix-devel
David Thompson <dthompson2@worcester.edu> writes:
> The following patchset adds a package for man-db, a package for its
> prerequisite libpipeline, and moves the help2man package recipe into the
> new (gnu packages man) module.
>
> - Dave
I have pushed these patches to master. Apologies for the delay, I was
short on time and having a multitude of computer problems.
Just in time for Guix 0.6! :)
- Dave
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 0/3] Add man-db and libpipeline
2014-04-09 0:52 ` [PATCH 0/3] Add man-db and libpipeline David Thompson
@ 2014-04-09 9:32 ` Ludovic Courtès
0 siblings, 0 replies; 15+ messages in thread
From: Ludovic Courtès @ 2014-04-09 9:32 UTC (permalink / raw)
To: David Thompson; +Cc: guix-devel
David Thompson <dthompson2@worcester.edu> skribis:
> David Thompson <dthompson2@worcester.edu> writes:
>
>> The following patchset adds a package for man-db, a package for its
>> prerequisite libpipeline, and moves the help2man package recipe into the
>> new (gnu packages man) module.
>>
>> - Dave
>
> I have pushed these patches to master. Apologies for the delay, I was
> short on time and having a multitude of computer problems.
>
> Just in time for Guix 0.6! :)
Perfect, thanks!
Ludo’.
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2014-04-09 9:33 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-07 0:43 [PATCH 0/3] Add man-db and libpipeline David Thompson
2014-04-07 0:43 ` [PATCH 1/3] gnu: Add libpipeline David Thompson
2014-04-07 0:44 ` [PATCH 2/3] gnu: Add man-db David Thompson
2014-04-07 0:45 ` [PATCH 3/3] gnu: Move help2man package to (gnu packages man) module David Thompson
2014-04-07 7:47 ` Ludovic Courtès
2014-04-07 5:12 ` [PATCH 2/3] gnu: Add man-db Mark H Weaver
[not found] ` <87txa59xvw.fsf@labrys.i-did-not-set--mail-host-address--so-tickle-me>
2014-04-08 1:51 ` Mark H Weaver
2014-04-08 11:46 ` David Thompson
2014-04-08 12:12 ` Ludovic Courtès
2014-04-08 12:40 ` Thompson, David
2014-04-08 22:02 ` David Thompson
2014-04-08 22:55 ` Nikita Karetnikov
2014-04-07 7:46 ` [PATCH 1/3] gnu: Add libpipeline Ludovic Courtès
2014-04-09 0:52 ` [PATCH 0/3] Add man-db and libpipeline David Thompson
2014-04-09 9:32 ` Ludovic Courtès
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.