summaryrefslogtreecommitdiff
path: root/perl-5.22.1-Provide-ExtUtils-MM-methods-as-standalone-ExtUtils-M.patch
blob: 0bc383f5b630aadb0385da2af0580273c4d61d0e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
From 9575301256f67116eccdbb99b38fc804ba3dcf53 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
Date: Mon, 18 Apr 2016 16:24:03 +0200
Subject: [PATCH] Provide ExtUtils::MM methods as standalone
 ExtUtils::MM::Utils
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

If you cannot afford depending on ExtUtils::MakeMaker, you can
depend on ExtUtils::MM::Utils instead.

<https://bugzilla.redhat.com/show_bug.cgi?id=1129443>

Signed-off-by: Petr Písař <ppisar@redhat.com>
---
 MANIFEST                                         |  1 +
 cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM/Utils.pm | 68 ++++++++++++++++++++++++
 2 files changed, 69 insertions(+)
 create mode 100644 cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM/Utils.pm

diff --git a/MANIFEST b/MANIFEST
index 6af238c..d4f0c56 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -1037,6 +1037,7 @@ cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_OS390.pm
 cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_OS390.pm				MakeMaker methods for OS 390
 cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_QNX.pm					MakeMaker methods for QNX
 cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm					MakeMaker methods for Unix
+cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM/Utils.pm				Independed MM methods
 cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_UWIN.pm					MakeMaker methods for U/WIN
 cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_VMS.pm					MakeMaker methods for VMS
 cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_VOS.pm					MakeMaker methods for VOS
diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM/Utils.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM/Utils.pm
new file mode 100644
index 0000000..6bbc0d8
--- /dev/null
+++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM/Utils.pm
@@ -0,0 +1,68 @@
+package ExtUtils::MM::Utils;
+
+require 5.006;
+
+use strict;
+use vars qw($VERSION);
+$VERSION = '7.11_06';
+$VERSION = eval $VERSION;  ## no critic [BuiltinFunctions::ProhibitStringyEval]
+
+=head1 NAME
+
+ExtUtils::MM::Utils - ExtUtils::MM methods without dependency on ExtUtils::MakeMaker
+
+=head1 SYNOPSIS
+
+    require ExtUtils::MM::Utils;
+    MM->maybe_command($file);
+
+=head1 DESCRIPTION
+
+This is a collection of L<ExtUtils::MM> subroutines that are used by many
+other modules but that do not need full-featured L<ExtUtils::MakeMaker>. The
+issue with L<ExtUtils::MakeMaker> is it pulls in Perl header files and that is
+an overkill for small subroutines.
+
+An example is the L<IPC::Cmd> that caused installing GCC just because of
+three-line I<maybe_command()> from L<ExtUtils::MM_Unix>.
+
+The intentions is to use L<ExtUtils::MM::Utils> instead of
+L<ExtUtils::MakeMaker> for these trivial methods. You can still call them via
+L<MM> class name.
+
+=head1 METHODS
+
+=over 4
+
+=item maybe_command
+
+Returns true, if the argument is likely to be a command.
+
+=cut
+
+if (!exists $INC{'ExtUtils/MM.pm'}) {
+    *MM::maybe_command = *ExtUtils::MM::maybe_command = \&maybe_command;
+}
+
+sub maybe_command {
+    my($self,$file) = @_;
+    return $file if -x $file && ! -d $file;
+    return;
+}
+
+1;
+
+=back
+
+=head1 BUGS
+
+These methods are copied from L<ExtUtils::MM_Unix>. Other operating systems
+are not supported yet. The reason is this
+L<a hack for Linux
+distributions|https://bugzilla.redhat.com/show_bug.cgi?id=1129443>.
+
+=head1 SEE ALSO
+
+L<ExtUtils::MakeMaker>, L<ExtUtils::MM>
+
+=cut
-- 
2.5.5