gnu: guile-static-stripped: Update to 2.2.

* gnu/packages/make-bootstrap.scm (%guile-static): Replace GUILE-2.0
with GUILE-2.2.  Use "guile-2.2-default-utf8.patch" instead of
"guile-default-utf8.patch".
* gnu/packages/patches/guile-2.2-default-utf8.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
This commit is contained in:
Ludovic Courtès 2017-07-18 14:08:31 +02:00
parent 920f2c42ce
commit 2acfe022a7
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5
3 changed files with 94 additions and 15 deletions

View file

@ -657,6 +657,7 @@ dist_patch_DATA = \
%D%/packages/patches/gsl-test-i686.patch \ %D%/packages/patches/gsl-test-i686.patch \
%D%/packages/patches/gspell-dash-test.patch \ %D%/packages/patches/gspell-dash-test.patch \
%D%/packages/patches/guile-1.8-cpp-4.5.patch \ %D%/packages/patches/guile-1.8-cpp-4.5.patch \
%D%/packages/patches/guile-2.2-default-utf8.patch \
%D%/packages/patches/guile-default-utf8.patch \ %D%/packages/patches/guile-default-utf8.patch \
%D%/packages/patches/guile-linux-syscalls.patch \ %D%/packages/patches/guile-linux-syscalls.patch \
%D%/packages/patches/guile-present-coding.patch \ %D%/packages/patches/guile-present-coding.patch \

View file

@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU ;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2012, 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il> ;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
;;; ;;;
;;; This file is part of GNU Guix. ;;; This file is part of GNU Guix.
@ -502,23 +502,23 @@ (define %guile-static
;; .scm and .go files relative to its installation directory, rather ;; .scm and .go files relative to its installation directory, rather
;; than in hard-coded configure-time paths. ;; than in hard-coded configure-time paths.
(let* ((patches (cons* (search-patch "guile-relocatable.patch") (let* ((patches (cons* (search-patch "guile-relocatable.patch")
(search-patch "guile-default-utf8.patch") (search-patch "guile-2.2-default-utf8.patch")
(search-patch "guile-linux-syscalls.patch") (search-patch "guile-linux-syscalls.patch")
(origin-patches (package-source guile-2.0)))) (origin-patches (package-source guile-2.2))))
(source (origin (inherit (package-source guile-2.0)) (source (origin (inherit (package-source guile-2.2))
(patches patches))) (patches patches)))
(guile (package (inherit guile-2.0) (guile (package (inherit guile-2.2)
(name (string-append (package-name guile-2.0) "-static")) (name (string-append (package-name guile-2.2) "-static"))
(source source) (source source)
(synopsis "Statically-linked and relocatable Guile") (synopsis "Statically-linked and relocatable Guile")
;; Remove the 'debug' output (see above for the reason.) ;; Remove the 'debug' output (see above for the reason.)
(outputs (delete "debug" (package-outputs guile-2.0))) (outputs (delete "debug" (package-outputs guile-2.2)))
(propagated-inputs (propagated-inputs
`(("bdw-gc" ,libgc) `(("bdw-gc" ,libgc)
,@(alist-delete "bdw-gc" ,@(alist-delete "bdw-gc"
(package-propagated-inputs guile-2.0)))) (package-propagated-inputs guile-2.2))))
(arguments (arguments
`(;; When `configure' checks for ltdl availability, it `(;; When `configure' checks for ltdl availability, it
;; doesn't try to link using libtool, and thus fails ;; doesn't try to link using libtool, and thus fails
@ -534,7 +534,7 @@ (define %guile-static
(("^guile_LDFLAGS =") (("^guile_LDFLAGS =")
"guile_LDFLAGS = -all-static") "guile_LDFLAGS = -all-static")
;; Add `-ldl' *after* libguile-2.0.la. ;; Add `-ldl' *after* libguile-2.2.la.
(("^guile_LDADD =(.*)$" _ ldadd) (("^guile_LDADD =(.*)$" _ ldadd)
(string-append "guile_LDADD = " (string-append "guile_LDADD = "
(string-trim-right ldadd) (string-trim-right ldadd)
@ -561,13 +561,13 @@ (define %guile-static-stripped
(out (assoc-ref %outputs "out")) (out (assoc-ref %outputs "out"))
(guile1 (string-append in "/bin/guile")) (guile1 (string-append in "/bin/guile"))
(guile2 (string-append out "/bin/guile"))) (guile2 (string-append out "/bin/guile")))
(mkdir-p (string-append out "/share/guile/2.0")) (mkdir-p (string-append out "/share/guile/2.2"))
(copy-recursively (string-append in "/share/guile/2.0") (copy-recursively (string-append in "/share/guile/2.2")
(string-append out "/share/guile/2.0")) (string-append out "/share/guile/2.2"))
(mkdir-p (string-append out "/lib/guile/2.0/ccache")) (mkdir-p (string-append out "/lib/guile/2.2/ccache"))
(copy-recursively (string-append in "/lib/guile/2.0/ccache") (copy-recursively (string-append in "/lib/guile/2.2/ccache")
(string-append out "/lib/guile/2.0/ccache")) (string-append out "/lib/guile/2.2/ccache"))
(mkdir (string-append out "/bin")) (mkdir (string-append out "/bin"))
(copy-file guile1 guile2) (copy-file guile1 guile2)

View file

@ -0,0 +1,78 @@
This hack makes Guile default to UTF-8. This avoids calls to
`iconv_open'; `iconv_open' tries to open shared objects that aren't
available during bootstrap, so using UTF-8 avoids that (and UTF-8 has
built-in conversions in glibc, too.)
diff --git a/libguile/bytevectors.c b/libguile/bytevectors.c
index 7cd753009..de92653a4 100644
--- a/libguile/bytevectors.c
+++ b/libguile/bytevectors.c
@@ -1918,7 +1918,7 @@ utf_encoding_name (char *name, size_t utf_width, SCM endianness)
if (scm_i_is_narrow_string (str)) \
{ \
err = mem_iconveh (scm_i_string_chars (str), c_strlen, \
- "ISO-8859-1", c_utf_name, \
+ "UTF-8", c_utf_name, \
iconveh_question_mark, NULL, \
&c_utf, &c_utf_len); \
if (SCM_UNLIKELY (err)) \
diff --git a/libguile/ports.c b/libguile/ports.c
index 2a25cd58e..bdaf921ca 100644
--- a/libguile/ports.c
+++ b/libguile/ports.c
@@ -959,7 +959,9 @@ canonicalize_encoding (const char *enc)
char *ret;
int i;
- if (!enc || encoding_matches (enc, sym_ISO_8859_1))
+ if (enc == NULL)
+ return sym_UTF_8;
+ if (encoding_matches (enc, sym_ISO_8859_1))
return sym_ISO_8859_1;
if (encoding_matches (enc, sym_UTF_8))
return sym_UTF_8;
@@ -4182,7 +4184,7 @@ scm_init_ports (void)
scm_c_define ("%default-port-conversion-strategy",
scm_make_fluid_with_default (sym_substitute));
/* Use the locale as the default port encoding. */
- scm_i_set_default_port_encoding (locale_charset ());
+ scm_i_set_default_port_encoding ("UTF-8");
scm_c_register_extension ("libguile-" SCM_EFFECTIVE_VERSION,
"scm_init_ice_9_ports",
diff --git a/libguile/strings.c b/libguile/strings.c
index 5c49e33d8..0131e6dc8 100644
--- a/libguile/strings.c
+++ b/libguile/strings.c
@@ -1561,7 +1561,7 @@ scm_i_default_string_failed_conversion_handler (void)
SCM
scm_from_locale_stringn (const char *str, size_t len)
{
- return scm_from_stringn (str, len, locale_charset (),
+ return scm_from_stringn (str, len, "UTF-8",
scm_i_default_string_failed_conversion_handler ());
}
@@ -1885,7 +1885,7 @@ char *
scm_to_locale_stringn (SCM str, size_t *lenp)
{
return scm_to_stringn (str, lenp,
- locale_charset (),
+ "UTF-8",
scm_i_default_string_failed_conversion_handler ());
}
@@ -2216,11 +2216,11 @@ scm_to_stringn (SCM str, size_t *lenp, const char *encoding,
len = 0;
enc = encoding;
if (enc == NULL)
- enc = "ISO-8859-1";
+ enc = "UTF-8";
if (scm_i_is_narrow_string (str))
{
ret = mem_iconveh (scm_i_string_chars (str), ilen,
- "ISO-8859-1", enc,
+ "UTF-8", enc,
(enum iconv_ilseq_handler) handler, NULL,
&buf, &len);