guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 2/2] gnu: perl: Enable threading support.


From: Ben Woodcroft
Subject: [PATCH 2/2] gnu: perl: Enable threading support.
Date: Tue, 20 Sep 2016 14:56:07 +1000

* 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 <address@hidden>
 ;;; Copyright © 2012 Nikita Karetnikov <address@hidden>
 ;;; Copyright © 2014, 2015 Mark H Weaver <address@hidden>
+;;; Copyright © 2016 Ben Woodcroft <address@hidden>
 ;;;
 ;;; 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

[Prev in Thread] Current Thread [Next in Thread]