distro: Add GNU M4.

* distro/base.scm (m4): New variable.

* distro/m4-readlink-EINVAL.patch, distro/m4-s_isdir.patch: New files.
* Makefile.am (nobase_dist_guilemodule_DATA): Add them.
This commit is contained in:
Ludovic Courtès 2012-07-11 15:42:40 +02:00
parent 6365068393
commit 4ac3df4290
4 changed files with 83 additions and 1 deletions

View File

@ -37,7 +37,9 @@ GOBJECTS = $(MODULES:%.scm=%.go)
nobase_dist_guilemodule_DATA = \
$(MODULES) \
distro/guile-1.8-cpp-4.5.patch
distro/guile-1.8-cpp-4.5.patch \
distro/m4-readlink-EINVAL.patch \
distro/m4-s_isdir.patch
nobase_nodist_guilemodule_DATA = $(GOBJECTS)

View File

@ -108,6 +108,54 @@ code.")
(home-page "http://www.gnu.org/software/hello/")
(license "GPLv3+")))
(define-public m4
(package
(name "m4")
(version "1.4.16")
(source (origin
(method http-fetch)
(uri (string-append "http://ftp.gnu.org/gnu/m4/m4-"
version ".tar.bz2"))
(sha256
(base32
"035r7ma272j2cwni2961jp22k6bn3n9xwn3b3qbcn2yrvlghql22"))))
(build-system gnu-build-system)
(arguments (case-lambda
((system)
;; XXX: Disable tests on those platforms with know issues.
`(#:tests? ,(not (member system
'("x86_64-darwin"
"i686-cygwin"
"i686-sunos")))
#:patches (list (assoc-ref %build-inputs "patch/s_isdir")
(assoc-ref %build-inputs
"patch/readlink-EINVAL"))))
((system cross-system)
`(#:patches (list (assoc-ref %build-inputs "patch/s_isdir")
(assoc-ref %build-inputs
"patch/readlink-EINVAL"))))))
(inputs `(("patch/s_isdir"
,(search-path %load-path "distro/m4-s_isdir.patch"))
("patch/readlink-EINVAL"
,(search-path %load-path "distro/m4-readlink-EINVAL.patch"))))
(description "GNU M4, a macro processor")
(long-description
"GNU M4 is an implementation of the traditional Unix macro processor. It
is mostly SVR4 compatible although it has some extensions (for example,
handling more than 9 positional parameters to macros). GNU M4 also has
built-in functions for including files, running shell commands, doing
arithmetic, etc.
GNU M4 is a macro processor in the sense that it copies its input to the
output expanding macros as it goes. Macros are either builtin or
user-defined and can take any number of arguments. Besides just doing macro
expansion, m4 has builtin functions for including named files, running UNIX
commands, doing integer arithmetic, manipulating text in various ways,
recursion etc... m4 can be used either as a front-end to a compiler or as a
macro processor in its own right.")
(license "GPLv3+")
(home-page "http://www.gnu.org/software/m4/")))
(define-public guile-1.8
(package
(name "guile")

View File

@ -0,0 +1,18 @@
Newer Linux kernels would return EINVAL instead of ENOENT.
The patch below, taken from Gnulib, allows the test to pass when
these Linux versions are in use:
https://lists.gnu.org/archive/html/bug-gnulib/2011-03/msg00308.html .
diff --git a/tests/test-readlink.h b/tests/test-readlink.h
index 08d5662..7247fc4 100644
--- a/tests/test-readlink.h
+++ b/tests/test-readlink.h
@@ -38,7 +38,7 @@ test_readlink (ssize_t (*func) (char const *, char *, size_t), bool print)
ASSERT (errno == ENOENT);
errno = 0;
ASSERT (func ("", buf, sizeof buf) == -1);
- ASSERT (errno == ENOENT);
+ ASSERT (errno == ENOENT || errno == EINVAL);
errno = 0;
ASSERT (func (".", buf, sizeof buf) == -1);
ASSERT (errno == EINVAL);

14
distro/m4-s_isdir.patch Normal file
View File

@ -0,0 +1,14 @@
Fails to build with glibc 2.12.1 without this patch.
http://lists.gnu.org/archive/html/bug-m4/2010-05/msg00002.html
--- a/src/path.c
+++ b/src/path.c
@@ -22,6 +22,7 @@
/* Handling of path search of included files via the builtins "include"
and "sinclude". */
#include "m4.h"
+#include "sys/stat.h"
struct includes