From b5178b325409b1eaf953f8f3007a180cbd27b167 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Sat, 21 Apr 2018 01:08:56 -0400 Subject: gnu: perl: Hack the replacement perl to think it is version 5.26.1. Fixes . This is a followup to commits 217b8c2e061a5b637e198f1ed9960d4abe2b0a46, 44b98b00026e62766620dbc4330a305282d61069, and 35fbe194c3da264859a5addc661b9fbc2dc8ecc7. Complications arise when grafting perl unless the version of the replacement perl matches that of the original. So, here we add 'perl/fixed', which is built from the perl-5.26.2 source but hacked to believe it is version 5.26.1. * gnu/packages/perl.scm (perl)[replacement]: Use perl/fixed, not perl-5.26.2. (perl-5.26.2): Remove compatibility symlinks. (perl/fixed): New variable. --- gnu/packages/perl.scm | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) (limited to 'gnu/packages') diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm index 5b52ec071a..9de8c3fdf7 100644 --- a/gnu/packages/perl.scm +++ b/gnu/packages/perl.scm @@ -62,7 +62,7 @@ (define-public perl (package (name "perl") (version "5.26.1") - (replacement perl-5.26.2) + (replacement perl/fixed) (source (origin (method url-fetch) (uri (string-append "mirror://cpan/src/5.0/perl-" @@ -171,22 +171,26 @@ (define-public perl-5.26.2 version ".tar.gz")) (sha256 (base32 - "03gpnxx1g6hvlh0v4aqx00580h787sfywp1vlvw64q2xcbm9qbsp")))) + "03gpnxx1g6hvlh0v4aqx00580h787sfywp1vlvw64q2xcbm9qbsp")))))) + +;; When grafting perl, complications arise when the replacement perl has a +;; different version number than the original. So, here we create a version +;; of perl-5.26.2 that thinks it is version 5.26.1. See +;; and . +(define perl/fixed + (package + (inherit perl-5.26.2) + (version "5.26.1") (arguments - (substitute-keyword-arguments (package-arguments perl) + (substitute-keyword-arguments (package-arguments perl-5.26.2) ((#:phases phases) `(modify-phases ,phases - ;; The path to several installed components include the Perl - ;; version number, and these is not rewritten by grafting. See - ;; and . - (add-after 'install 'install-compatibility-symlinks - (lambda* (#:key outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out"))) - (symlink "perl5.26.2" (string-append out "/bin/perl5.26.1")) - (symlink "5.26.2" (string-append out "/lib/perl5/5.26.1")) - (symlink "5.26.2" - (string-append out "/lib/perl5/site_perl/5.26.1")) - #t))))))))) + (add-after 'unpack 'revert-perl-subversion + (lambda _ + (substitute* "patchlevel.h" + (("^#define PERL_SUBVERSION 2") + "#define PERL_SUBVERSION 1")) + #t)))))))) (define-public perl-algorithm-c3 (package -- cgit v1.2.3