* gnu/packages/perl.scm (perl)[arguments]: Enable threading support.
* gnu/packages/commencement.scm (perl-boot0): Do not inherit 'configure'
phase from perl.
---
 gnu/packages/commencement.scm | 57 +++++++++++++++++++++++++++++--------------
 gnu/packages/perl.scm         |  4 +++
 2 files changed, 43 insertions(+), 18 deletions(-)

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 8f1ecf8..60822a9 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -3,6 +3,7 @@
 ;;; Copyright © 2014 Andreas Enge <andr...@enge.fr>
 ;;; Copyright © 2012 Nikita Karetnikov <nik...@karetnikov.org>
 ;;; Copyright © 2014, 2015 Mark H Weaver <m...@netris.org>
+;;; Copyright © 2016 Ben Woodcroft <donttrust...@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -269,24 +270,44 @@
                                   (package-native-inputs gcc))))))
 
 (define perl-boot0
-  (let ((perl (package
-                (inherit perl)
-                (name "perl-boot0")
-                (replacement #f)
-                (arguments
-                 ;; At the very least, this must not depend on GCC & co.
-                 (let ((args `(#:disallowed-references
-                               ,(list %bootstrap-binutils))))
-                   (substitute-keyword-arguments (package-arguments perl)
-                     ((#:phases phases)
-                      `(modify-phases ,phases
-                         ;; Pthread support is missing in the bootstrap 
compiler
-                         ;; (broken spec file), so disable it.
-                         (add-before 'configure 'disable-pthreads
-                           (lambda _
-                             (substitute* "Configure"
-                               (("^libswanted=(.*)pthread" _ before)
-                                (string-append "libswanted=" 
before)))))))))))))
+  (let ((perl
+         (package
+           (inherit perl)
+           (name "perl-boot0")
+           (replacement #f)
+           (arguments
+            ;; At the very least, this must not depend on GCC & co.
+            (let ((args `(#:disallowed-references
+                          ,(list %bootstrap-binutils))))
+              (substitute-keyword-arguments (package-arguments perl)
+                ((#:phases phases)
+                 `(modify-phases ,phases
+                    ;; Pthread support is missing in the bootstrap compiler
+                    ;; (broken spec file), so disable it.
+                    (add-before 'configure 'disable-pthreads
+                      (lambda _
+                        (substitute* "Configure"
+                          (("^libswanted=(.*)pthread" _ before)
+                           (string-append "libswanted=" before)))))
+                   ;; This phase is largely shared with 'perl' but we
+                   ;; configure without threading support.
+                    (replace 'configure
+                      (lambda* (#:key inputs outputs #:allow-other-keys)
+                        (let ((out  (assoc-ref outputs "out"))
+                              (libc (assoc-ref inputs "libc")))
+                          (zero?
+                           (system*
+                            "./Configure"
+                            (string-append "-Dprefix=" out)
+                            (string-append "-Dman1dir=" out "/share/man/man1")
+                            (string-append "-Dman3dir=" out "/share/man/man3")
+                            "-de" "-Dcc=gcc"
+                            "-Uinstallusrbinperl"
+                            "-Dinstallstyle=lib/perl5"
+                            "-Duseshrplib"
+                            (string-append "-Dlocincpth=" libc "/include")
+                            (string-append "-Dloclibpth=" libc
+                                           "/lib"))))))))))))))
     (package-with-bootstrap-guile
      (package-with-explicit-inputs perl
                                    %boot0-inputs
diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm
index f0c4e36..273e4d0 100644
--- a/gnu/packages/perl.scm
+++ b/gnu/packages/perl.scm
@@ -77,6 +77,9 @@
              #t))
          (replace
           'configure
+          ;; This configure phase is largely shared with 'perl-boot0', so if
+          ;; changes are made in this phase they may also be applicable
+          ;; there.
           (lambda* (#:key inputs outputs #:allow-other-keys)
             (let ((out  (assoc-ref outputs "out"))
                   (libc (assoc-ref inputs "libc")))
@@ -89,6 +92,7 @@
                         "-Uinstallusrbinperl"
                         "-Dinstallstyle=lib/perl5"
                         "-Duseshrplib"
+                        "-Dusethreads"
                         (string-append "-Dlocincpth=" libc "/include")
                         (string-append "-Dloclibpth=" libc "/lib"))))))
 
-- 
2.10.0


Reply via email to