From 58119427c89da0012ffec82e246c923a59088599 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Tue, 12 Apr 2016 15:49:43 +0200 Subject: [PATCH 9/9] gnu: guile-2.0: support mingw. WIP: builds, links, segfaults. * gnu/packages/patches/guile-remove-utf8.patch: New file. * gnu-system.am: Add it. * gnu/packages/guile.scm (guile-2.0): Support mingw. --- gnu/packages/guile.scm | 60 +++++++++++++++++++++++++--- gnu/packages/patches/guile-remove-utf8.patch | 16 ++++++++ 2 files changed, 71 insertions(+), 5 deletions(-) create mode 100644 gnu/packages/patches/guile-remove-utf8.patch diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm index fe043cb..bfde659 100644 --- a/gnu/packages/guile.scm +++ b/gnu/packages/guile.scm @@ -30,6 +30,7 @@ #:use-module (gnu packages libffi) #:use-module (gnu packages autotools) #:use-module (gnu packages flex) + #:use-module (gnu packages libiconv) #:use-module (gnu packages libunistring) #:use-module (gnu packages linux) #:use-module (gnu packages m4) @@ -132,13 +133,19 @@ without requiring the source code to be rewritten.") (sha256 (base32 "1qh3j7308qvsjgwf7h94yqgckpbgz2k3yqdkzsyhqcafvfka9l5f")) - (patches (list (search-patch "guile-arm-fixes.patch"))))) + (patches (list (search-patch "guile-arm-fixes.patch") + (search-patch "guile-remove-utf8.patch"))))) (build-system gnu-build-system) - (native-inputs `(("pkgconfig" ,pkg-config))) + (native-inputs `(("pkgconfig" ,pkg-config) + ,@(if (equal? (%current-target-system) "i686-w64-mingw32") + `(("bash" ,bash) + ("guile" ,guile-2.0)) + '()))) (inputs `(("libffi" ,libffi) ("readline" ,readline) - ("bash" ,bash))) - + ,@(if (equal? (%current-target-system) "i686-w64-mingw32") + `(("libiconv" ,libiconv)) + `(("bash" ,bash))))) (propagated-inputs `( ;; These ones aren't normally needed here, but since `libguile-2.0.la' ;; reads `-lltdl -lunistring', adding them here will add the needed @@ -167,7 +174,11 @@ without requiring the source code to be rewritten.") (let ((bash (assoc-ref inputs "bash"))) (substitute* "module/ice-9/popen.scm" (("/bin/sh") - (string-append bash "/bin/bash"))))) + ,(if (equal? (%current-target-system) "i686-w64-mingw32") + "cmd.exe" + `(if bash + (string-append bash "/bin/bash") + "bash")))))) %standard-phases))) (native-search-paths @@ -194,6 +205,45 @@ without requiring the source code to be rewritten.") ;; in the `base' module, and thus changing it entails a full rebuild. guile-2.0) +(define-public cross-guile + (package + (inherit guile-2.0) + (name "cross-guile") + (version "2.0.11") + + (source (origin + (method url-fetch) + (uri (string-append "mirror://gnu/guile/guile-" version + ".tar.xz")) + (sha256 + (base32 + "1qh3j7308qvsjgwf7h94yqgckpbgz2k3yqdkzsyhqcafvfka9l5f")) + (patches (list (search-patch "guile-arm-fixes.patch") + (search-patch "guile-remove-utf8.patch"))))) + + (self-native-input? #f) + (native-inputs `(("bash" ,bash) + ("guile" ,guile-2.0) + ("pkgconfig" ,pkg-config))) + + (inputs `(("libffi" ,libffi) + ("readline" ,readline) + ,@(if (equal? (%current-target-system) "i686-w64-mingw32") + `(("libiconv" ,libiconv)) + `(("bash" ,bash))))) + (arguments + `(#:phases (modify-phases %standard-phases + (add-before 'configure 'pre-configure + (lambda* (#:key inputs #:allow-other-keys) + (let ((bash (assoc-ref inputs "bash"))) + (substitute* "module/ice-9/popen.scm" + (("/bin/sh") + ,(if (equal? (%current-target-system) "i686-w64-mingw32") + "cmd.exe" + (if bash + (string-append bash "/bin/bash") + "bash")))))))))))) + (define-public guile-next (package (inherit guile-2.0) (name "guile-next") diff --git a/gnu/packages/patches/guile-remove-utf8.patch b/gnu/packages/patches/guile-remove-utf8.patch new file mode 100644 index 0000000..da195c0 --- /dev/null +++ b/gnu/packages/patches/guile-remove-utf8.patch @@ -0,0 +1,16 @@ +--- guile-2.0.11/libguile/Makefile.in.orig 2016-04-11 07:46:38.792593661 +0200 ++++ guile-2.0.11/libguile/Makefile.in 2016-04-11 07:55:44.410618808 +0200 +@@ -3735,11 +3735,11 @@ + flex -t $(srcdir)/c-tokenize.lex > $@ || { rm $@; false; } + + # This page is for maintenance of the lists of CPP symbols that are eventually +-# included in error.c (‘errno’ values: E*) and posix.c (signal names: SIG*), ++# included in error.c (`errno' values: E*) and posix.c (signal names: SIG*), + # in the funcs scm_init_{error,posix}, respectively. + # + # The lists (files cpp-{E,SIG}.syms) are not included verbatim, but processed +-# (via pattern rule ‘.syms.c’ below) so that each CPP symbol is transformed to ++# (via pattern rule `.syms.c' below) so that each CPP symbol is transformed to + # fragment of #ifdef'd C code that defines a Scheme variable of the same name. + # The resulting files, cpp-{E,SIG}.c, are the ones #include:d. + # -- 2.7.3