changeset 6493:a753f2b56688

guile: bump to 2.0
author Jan Nieuwenhuizen <janneke@gnu.org>
date Tue, 15 Mar 2011 14:13:15 +0100
parents 5bab80dd593a
children 4af12ccffd10
files gub/specs/guile.py patches/guile-2.0.0-configure-cross.patch patches/guile-2.0.0-mingw-compile-binary.patch patches/guile-2.0.0-mingw-dynl.patch patches/guile-2.0.0-mingw-fchmod.patch patches/guile-2.0.0-testsuite.patch
diffstat 6 files changed, 161 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/gub/specs/guile.py	Tue Feb 08 12:33:54 2011 +0100
+++ b/gub/specs/guile.py	Tue Mar 15 14:13:15 2011 +0100
@@ -13,12 +13,14 @@
     # source = 'git://git.sv.gnu.org/guile.git&branch=branch_release-1-8&revision=bba579611b3671c7e4c1515b100f01c048a07935'
     source = 'http://ftp.gnu.org/pub/gnu/guile/guile-1.8.7.tar.gz'
     source = 'http://alpha.gnu.org/gnu/guile/guile-1.9.15.tar.gz'
+    source = 'http://ftp.gnu.org/gnu/guile/guile-2.0.0.tar.gz'
     patches = [
         #'guile-reloc-1.8.6.patch',
         'guile-1.9.14-reloc.patch',
         #'guile-cexp.patch',
         'guile-1.8.6-test-use-srfi.patch',
         #'guile-1.8.7-doc-snarfing.patch',
+        ##'guile-2.0.0-configure-cross.patch',
         'guile-1.9.14-configure-cross.patch',
         'guile-1.9.15-cross.patch',
         'guile-1.9.14-gnulib-libunistring.patch',
@@ -181,6 +183,9 @@
         'guile-1.9.15-mingw-fports.patch',
         'guile-1.9.15-mingw-rename.patch',
         'guile-1.9.15-mingw-cachedir.patch',
+        'guile-2.0.0-mingw-compile-binary.patch',
+        'guile-2.0.0-mingw-fchmod.patch',
+        'guile-2.0.0-mingw-dynl.patch',
         ]
     dependencies = (Guile.dependencies + [
             'regex-devel',
@@ -263,7 +268,10 @@
                             'CPATH="%(srcdir)s:%(builddir)s:%(system_prefix)s/include" ')
 
 class Guile__tools (tools.AutoBuild, Guile):
-    patches = []
+    patches = [
+        'guile-2.0.0-testsuite.patch',
+        'guile-2.0.0-mingw-compile-binary.patch',
+        ]
     dependencies = (Guile.dependencies
                     + [
                 'autoconf',
@@ -305,7 +313,7 @@
         self.file_sub ([('-std=gnu99', ''),('-std=c99', '')], '%(srcdir)s/configure')
     def install (self):
         tools.AutoBuild.install (self)
-        self.system ('cd %(install_root)s%(packaging_suffix_dir)s%(prefix_dir)s/bin && cp guile guile-1.9')
+        self.system ('cd %(install_root)s%(packaging_suffix_dir)s%(prefix_dir)s/bin && cp guile guile-2.0')
 #        self.file_sub ([('[(]string-join other-flags[)]', '(string-join (filter (lambda (x) (not (equal? x "-L/usr/lib"))) other-flags))')],
 #                       '%(install_root)s%(packaging_suffix_dir)s%(prefix_dir)s/bin/guile-config',
 #                       must_succeed=True)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/guile-2.0.0-configure-cross.patch	Tue Mar 15 14:13:15 2011 +0100
@@ -0,0 +1,27 @@
+--- guile-1.9.14/configure.ac~	2011-01-27 18:33:17.300003072 +0100
++++ guile-1.9.14/configure.ac	2011-01-27 19:29:42.191669551 +0100
+@@ -76,11 +76,7 @@ AC_LIBTOOL_DLOPEN
+ AC_PROG_LIBTOOL
+ 
+ dnl Check for libltdl.
+-AC_LIB_HAVE_LINKFLAGS([ltdl], [], [#include <ltdl.h>],
+-  [lt_dlopenext ("foo");])
+-if test "x$HAVE_LIBLTDL" != "xyes"; then
+-  AC_MSG_ERROR([GNU libltdl (Libtool) not found, see README.])
+-fi
++AC_CHECK_LIB(ltdl, lt_dlopenext, [HAVE_LIBLTDL=yes AC_SUBST(HAVE_LIBLTDL) LTLIBLTDL="-lltdl" AC_SUBST(LTLIBLTDL)])
+ 
+ AC_CHECK_PROG(have_makeinfo, makeinfo, yes, no)
+ AM_CONDITIONAL(HAVE_MAKEINFO, test "$have_makeinfo" = yes)
+@@ -854,10 +850,7 @@ fi
+ 
+ 
+ dnl GMP tests
+-AC_LIB_HAVE_LINKFLAGS([gmp],
+-  [],
+-  [#include <gmp.h>],
+-  [mpz_import (0, 0, 0, 0, 0, 0, 0);])
++AC_CHECK_LIB(gmp, main, [HAVE_LIBGMP=yes AC_SUBST(HAVE_LIBGMP) LTLIBGMP="-lgmp" AC_SUBST(LTLIBGMP)])
+ 
+ if test "x$HAVE_LIBGMP" != "xyes"; then
+   AC_MSG_ERROR([GNU MP 4.1 or greater not found, see README])
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/guile-2.0.0-mingw-compile-binary.patch	Tue Mar 15 14:13:15 2011 +0100
@@ -0,0 +1,70 @@
+--- guile-1.9.15/module/system/base/compile.scm~	2011-02-15 10:54:38.483090146 +0100
++++ guile-1.9.15/module/system/base/compile.scm	2011-03-03 09:15:24.742333809 +0100
+@@ -51,7 +51,7 @@
+ ;; (put 'call-with-output-file/atomic 'scheme-indent-function 1)
+ (define* (call-with-output-file/atomic filename proc #:optional reference)
+   (let* ((template (string-append filename ".XXXXXX"))
+-         (tmp (mkstemp! template)))
++         (tmp (mkstemp! template "w+b")))
+     (call-once
+      (lambda ()
+        (with-throw-handler #t
+--- guile-1.9.15/libguile/posix.h~	2010-12-14 19:15:17.000000000 +0100
++++ guile-1.9.15/libguile/posix.h	2011-03-03 09:21:46.058955734 +0100
+@@ -67,7 +67,7 @@
+ SCM_API SCM scm_uname (void);
+ SCM_API SCM scm_environ (SCM env);
+ SCM_API SCM scm_tmpnam (void);
+-SCM_API SCM scm_mkstemp (SCM tmpl);
++SCM_API SCM scm_mkstemp (SCM tmpl, SCM mode);
+ SCM_API SCM scm_tmpfile (void);
+ SCM_API SCM scm_open_pipe (SCM pipestr, SCM modes);
+ SCM_API SCM scm_close_pipe (SCM port);
+--- guile-1.9.15/libguile/posix.c~	2011-01-29 21:36:58.000000000 +0100
++++ guile-1.9.15/libguile/posix.c	2011-03-03 09:14:46.745199721 +0100
+@@ -1329,8 +1329,8 @@
+ extern int mkstemp (char *);
+ #endif
+ 
+-SCM_DEFINE (scm_mkstemp, "mkstemp!", 1, 0, 0,
+-	    (SCM tmpl),
++SCM_DEFINE (scm_mkstemp, "mkstemp!", 1, 1, 0,
++	    (SCM tmpl, SCM mode),
+ 	    "Create a new unique file in the file system and return a new\n"
+ 	    "buffered port open for reading and writing to the file.\n"
+ 	    "\n"
+@@ -1338,6 +1338,8 @@
+ 	    "created: it must end with @samp{XXXXXX} and those @samp{X}s\n"
+ 	    "will be changed in the string to return the name of the file.\n"
+ 	    "(@code{port-filename} on the port also gives the name.)\n"
++	    "The optional @var{mode}, if given, is a string specifying the\n"
++	    "open mode of the file, e.g. w+b\n"
+ 	    "\n"
+ 	    "POSIX doesn't specify the permissions mode of the file, on GNU\n"
+ 	    "and most systems it's @code{#o600}.  An application can use\n"
+@@ -1354,7 +1356,12 @@
+ {
+   char *c_tmpl;
+   int rv;
+-  
++  SCM port;
++  char *c_mode = "w+";
++
++  if (!SCM_UNBNDP (mode))
++    c_mode = scm_to_locale_string (mode);
++
+   scm_dynwind_begin (0);
+ 
+   c_tmpl = scm_to_locale_string (tmpl);
+@@ -1369,7 +1376,10 @@
+ 			tmpl, SCM_INUM0);
+ 
+   scm_dynwind_end ();
+-  return scm_fdes_to_port (rv, "w+", tmpl);
++  port = scm_fdes_to_port (rv, c_mode, tmpl);
++  if (!SCM_UNBNDP (mode))
++    free (c_mode);
++  return port;
+ }
+ #undef FUNC_NAME
+ 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/guile-2.0.0-mingw-dynl.patch	Tue Mar 15 14:13:15 2011 +0100
@@ -0,0 +1,22 @@
+diff --git a/libguile/dynl.c b/libguile/dynl.c
+index 2484dda..b612709 100644
+--- a/libguile/dynl.c
++++ b/libguile/dynl.c
+@@ -121,6 +121,17 @@ sysdep_dynl_value (const char *symb, void *handle, const char *subr)
+   return fptr;
+ }
+ 
++#ifdef __MINGW32__
++static void
++setenv (char const *name, char const *value)
++{
++  int len = strlen (value) + strlen (value) + 2;
++  char *str = malloc (len);
++  sprintf (str, "%s=%s", name, value);
++  putenv (str);
++}
++#endif /* __MINGW32__ */
++
+ /* Augment environment variable VARIABLE with VALUE, assuming VARIABLE
+    is a path kind of variable.  */
+ static void
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/guile-2.0.0-mingw-fchmod.patch	Tue Mar 15 14:13:15 2011 +0100
@@ -0,0 +1,11 @@
+--- guile-1.9.15/libguile/filesys.c~	2011-03-04 10:36:13.417981644 +0100
++++ guile-1.9.15/libguile/filesys.c	2011-03-04 13:23:41.182832400 +0100
+@@ -121,7 +121,7 @@
+ #ifdef __MINGW32__
+ # define mkdir(path, mode) mkdir (path)
+ # define fsync(fd) _commit (fd)
+-# define fchmod(fd, mode) (-1)
++# define fchmod(fd, mode) (0)
+ #endif /* __MINGW32__ */
+ 
+ /* dirfd() returns the file descriptor underlying a "DIR*" directory stream.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/guile-2.0.0-testsuite.patch	Tue Mar 15 14:13:15 2011 +0100
@@ -0,0 +1,21 @@
+In guile 2.0, testsuite fails with
+
+In file included from ../../libguile/scmconfig.h:27,
+                 from /home/janneke/vc/gub/target/tools/src/guile-2.0.0/libguile/__scm.h:54,
+                 from /home/janneke/vc/gub/target/tools/src/guile-2.0.0/libguile.h:31,
+                 from /home/janneke/vc/gub/target/tools/src/guile-2.0.0/test-suite/standalone/test-asmobs-lib.c:23:
+../../lib/time.h:469: error: expected ';', ',' or ')' before '__timer'
+../../lib/time.h:491: error: expected ';', ',' or ')' before '__timer'
+
+
+--- guile-1.9.14/Makefile.am~	2010-12-14 19:15:16.000000000 +0100
++++ guile-1.9.14/Makefile.am	2011-01-29 15:36:05.312047266 +0100
+@@ -32,8 +32,6 @@ SUBDIRS =					\
+ 	guile-readline				\
+ 	examples				\
+ 	emacs					\
+-	test-suite				\
+-	benchmark-suite				\
+ 	am					\
+ 	doc
+