Subject: bug#26582: [PATCH] gnu: pcre: Fix Check for Hurd systems.

From: rennes <[email-masked]>
Date: Fri, 21 Apr 2017 21:40:03 -0500

Hello,

On 04/20/2017 04:27:29 PM, Ludovic Courtès wrote:
> >
> > I moved zlib and readline to 'native-inputs'.
> 
> Are you sure they need to be native inputs?  Both are libraries, so I
> imagine they’re used at run time, not at build time; they should be
> inputs, in this case.
> 
I added system types: "--build=" and "--host=" to 'configure'. Now  
detects correctly the inputs.

Built successfully on Linux x86_64, GNU/Hurd and cross-compiling with  
target 'i586-pc-gnu'.
Thanks for the guide

From 05f159e343173708b85c5e45b6cfe64e3939c68d Mon Sep 17 00:00:00 2001
From: rennes <[email-masked]>
Date: Fri, 21 Apr 2017 21:22:08 -0500
Subject: [PATCH] gnu: pcre: Fix Check for Hurd systems.

* gnu/packages/pcre.scm (pcre)[arguments]: Add "--disable-stack-for-recursion".	
---
 gnu/packages/pcre.scm | 43 ++++++++++++++++++++++++++++++++++---------
 1 file changed, 34 insertions(+), 9 deletions(-)

diff --git a/gnu/packages/pcre.scm b/gnu/packages/pcre.scm
index 1946f5229..ca51ff7ec 100644
--- a/gnu/packages/pcre.scm
+++ b/gnu/packages/pcre.scm
@@ -5,6 +5,7 @@
 ;;; Copyright © 2016 Leo Famulari <[email-masked]>
 ;;; Copyright © 2017 Marius Bakke <[email-masked]>
 ;;; Copyright © 2017 Ludovic Courtès <[email-masked]>
+;;; Copyright © 2017 Rene Saavedra <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -24,6 +25,7 @@
 (define-module (gnu packages pcre)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (gnu packages compression)
+  #:use-module (gnu packages hurd)  
   #:use-module (gnu packages readline)
   #:use-module (gnu packages)
   #:use-module (guix packages)
@@ -54,15 +56,38 @@
              ("readline" ,readline)
              ("zlib" ,zlib)))
    (arguments
-    '(#:disallowed-references ("doc")
-      #:configure-flags '("--enable-utf"
-                          "--enable-pcregrep-libz"
-                          "--enable-pcregrep-libbz2"
-                          "--enable-pcretest-libreadline"
-                          "--enable-unicode-properties"
-                          "--enable-pcre16"
-                          "--enable-pcre32"
-                          "--enable-jit")))
+    `(#:disallowed-references ("doc")
+      #:phases
+      (modify-phases %standard-phases
+        (replace 'configure
+                 (lambda* (#:key outputs build target #:allow-other-keys)
+                   (let* ((out (assoc-ref outputs "out"))
+                          (bin (assoc-ref outputs "bin"))
+                          (doc (assoc-ref outputs "doc")))
+                     (setenv "CONFIG_SHELL" (which "bash"))
+                     (zero?
+                      (system* "./configure"
+                               (string-append "--prefix=" out)
+                               (string-append "--bindir=" bin)
+                               (string-append "--docdir=" doc)
+                               (string-append "--build=" build)
+                               (string-append "--host=" (or target build))
+                               "--enable-utf"
+                               "--enable-pcregrep-libz"
+                               "--enable-pcregrep-libbz2"
+                               "--enable-pcretest-libreadline"
+                               "--enable-unicode-properties"
+                               "--enable-pcre16"
+                               "--enable-pcre32"
+                               "--enable-jit"
+                               ;; On GNU/Hurd systems FAIL 'RunTest' with 'segmentation
+                               ;; fault' in Check phase, to pass the test we can disable
+                               ;; "--enable-jit" or set "--disable-stack-for-recursion"
+                               ;; argument.
+                               ,@(if (hurd-triplet? (or (%current-system)
+                                                        ( %current-target-system)))
+                                     '("--disable-stack-for-recursion")
+                                     '())))))))))
    (synopsis "Perl Compatible Regular Expressions")
    (description
     "The PCRE library is a set of functions that implement regular expression
-- 
2.12.0