~ruther/guix-local

97b07aaa419bfa069bb217fca2f158f6ea0804a1 — Eric Bavier 10 years ago 7b158c4
gnu: Add perl-module-pluggable.

This Perl module was moved out of Perl core in v5.19.0.

* gnu/packages/perl.scm (perl-module-pluggable): New variable.
* gnu/packages/patches/perl-module-pluggable-search.patch: New patch.
* gnu-system.am (dist_patch_DATA): Add it.
3 files changed, 47 insertions(+), 1 deletions(-)

M gnu-system.am
A gnu/packages/patches/perl-module-pluggable-search.patch
M gnu/packages/perl.scm
M gnu-system.am => gnu-system.am +1 -0
@@ 627,6 627,7 @@ dist_patch_DATA =						\
  gnu/packages/patches/perl-net-ssleay-disable-ede-test.patch	\
  gnu/packages/patches/perl-no-build-time.patch			\
  gnu/packages/patches/perl-no-sys-dirs.patch			\
  gnu/packages/patches/perl-module-pluggable-search.patch	\
  gnu/packages/patches/perl-source-date-epoch.patch		\
  gnu/packages/patches/perl-tk-x11-discover.patch		\
  gnu/packages/patches/pidgin-add-search-path.patch		\

A gnu/packages/patches/perl-module-pluggable-search.patch => gnu/packages/patches/perl-module-pluggable-search.patch +25 -0
@@ 0,0 1,25 @@
Fix Perl module Module::Pluggable such that it can find plugins that live in
symlinked directories.

Patch borrowed/adapted from Nixpkgs.

--- Module-Pluggable-5.2/lib/Module/Pluggable/Object.pm   2015-04-08 23:28:48.120164135 -0500
+++ Module-Pluggable-5.2/lib/Module/Pluggable/Object.pm   2015-04-08 23:30:27.032166704 -0500
@@ -164,7 +164,7 @@
         my $sp = catdir($dir, (split /::/, $searchpath));

         # if it doesn't exist or it's not a dir then skip it
-        next unless ( -e $sp && -d _ ); # Use the cached stat the second time
+        next unless ( -e $sp );

         my @files = $self->find_files($sp);

@@ -279,7 +279,7 @@
                              (my $path = $File::Find::name) =~ s#^\\./##;
                              push @files, $path;
                            }
-                      }, $search_path );
+                      }, "$search_path/." );
     }
     #chdir $cwd;
     return @files;
\ No newline at end of file

M gnu/packages/perl.scm => gnu/packages/perl.scm +21 -1
@@ 2,7 2,7 @@
;;; Copyright © 2012, 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2015 Eric Bavier <bavier@member.fsf.org>
;;; Copyright © 2015, 2016 Eric Bavier <bavier@member.fsf.org>
;;; Copyright © 2015 Eric Dvorsak <eric@dvorsak.fr>
;;; Copyright © 2016 Mark H Weaver <mhw@netris.org>
;;;


@@ 3077,6 3077,26 @@ strictly correct manner with ExtUtils::MakeMaker, and will run on any Perl
installation version 5.005 or newer.")
    (license (package-license perl))))

(define-public perl-module-pluggable
  (package
    (name "perl-module-pluggable")
    (version "5.2")
    (source
     (origin
       (method url-fetch)
       (uri (string-append "mirror://cpan/authors/id/S/SI/SIMONW/"
                           "Module-Pluggable-" version ".tar.gz"))
       (sha256
        (base32
         "1px6qmszmfc69v36vd8d92av4nkrif6xf4nrj3xv647xwi2svwmk"))
       (patches (list (search-patch "perl-module-pluggable-search.patch")))))
    (build-system perl-build-system)
    (home-page "http://search.cpan.org/dist/Module-Pluggable")
    (synopsis "Give your Perl module the ability to have plugins")
    (description "This module provides a simple but extensible way of having
'plugins' for your Perl module.")
    (license (package-license perl))))

(define-public perl-module-runtime
  (package
    (name "perl-module-runtime")