Patchwork [11/11] gnu: guile-2.0: support mingw.

login
register
mail settings
Submitter Jan Nieuwenhuizen
Date May 8, 2016, 8:42 p.m.
Message ID <1462740169-15029-12-git-send-email-janneke@gnu.org>
Download mbox | patch
Permalink /patch/12151/
State New
Headers show

Comments

Jan Nieuwenhuizen - May 8, 2016, 8:42 p.m.
* gnu/packages/guile.scm (guile-2.0): Support mingw.
---
 gnu/packages/guile.scm | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
Andy Wingo - May 9, 2016, 7:48 a.m.
On Sun 08 May 2016 22:42, Jan Nieuwenhuizen <janneke@gnu.org> writes:

> * gnu/packages/guile.scm (guile-2.0): Support mingw.
> ---
>  gnu/packages/guile.scm | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm
> index 53ea3e5..3fd9ded 100644
> --- a/gnu/packages/guile.scm
> +++ b/gnu/packages/guile.scm
> @@ -135,11 +135,12 @@ without requiring the source code to be rewritten.")
>                "1qh3j7308qvsjgwf7h94yqgckpbgz2k3yqdkzsyhqcafvfka9l5f"))
>              (patches (search-patches "guile-arm-fixes.patch"))))
>     (build-system gnu-build-system)
> -   (native-inputs `(("pkgconfig" ,pkg-config)))
> +   (native-inputs `(("pkgconfig" ,pkg-config)
> +                    ,@(if (mingw-target?) `(("bash" ,bash)) '())))

AFAIU we can remove the "bash" thing here, as we decided to punt on
(ice-9 popen); sound right to you?

> @@ -168,7 +169,9 @@ 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 bash
> +                           (string-append bash "/bin/bash")
> +                           "bash")))))

Needs a comment here explaining that although we should always have bash
as an input, it isn't packaged yet on mingw so we are falling back to
finding it in the run-time path if needed.

FWIW although Windows doesn't support `fork', `open-process' should work
in Windows, and we should therefore be able to get (ice-9 popen) working
in Windows eventually.

Andy

Patch

diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm
index 53ea3e5..3fd9ded 100644
--- a/gnu/packages/guile.scm
+++ b/gnu/packages/guile.scm
@@ -135,11 +135,12 @@  without requiring the source code to be rewritten.")
               "1qh3j7308qvsjgwf7h94yqgckpbgz2k3yqdkzsyhqcafvfka9l5f"))
             (patches (search-patches "guile-arm-fixes.patch"))))
    (build-system gnu-build-system)
-   (native-inputs `(("pkgconfig" ,pkg-config)))
+   (native-inputs `(("pkgconfig" ,pkg-config)
+                    ,@(if (mingw-target?) `(("bash" ,bash)) '())))
    (inputs `(("libffi" ,libffi)
              ("readline" ,readline)
-             ("bash" ,bash)))
-
+             ,@(libiconv-if-needed)
+             ,@(if (mingw-target?) '() `(("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
@@ -168,7 +169,9 @@  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 bash
+                           (string-append bash "/bin/bash")
+                           "bash")))))
                 %standard-phases)))
 
    (native-search-paths