summaryrefslogtreecommitdiff
path: root/lang/p5-Switch
diff options
context:
space:
mode:
authorobache <obache@pkgsrc.org>2011-10-28 09:14:41 +0000
committerobache <obache@pkgsrc.org>2011-10-28 09:14:41 +0000
commit7f43ce3cdb5558d49a9e952bc7168e382c6ea921 (patch)
tree93365382dd5dca6b57c1955be2906c250f03e472 /lang/p5-Switch
parent6f7caf158a63eab43424620d2ba1bf2f3df0333f (diff)
downloadpkgsrc-7f43ce3cdb5558d49a9e952bc7168e382c6ea921.tar.gz
Import p5-Switch-2.16 as lang/p5-Switch.
Switch.pm provides the syntax and semantics for an explicit case mechanism for Perl. The syntax is minimal, introducing only the keywords C<switch> and C<case> and conforming to the general pattern of existing Perl control structures. The semantics are particularly rich, allowing any one (or more) of early 30 forms of matching to be used when comparing a switch value with its various cases.
Diffstat (limited to 'lang/p5-Switch')
-rw-r--r--lang/p5-Switch/DESCR6
-rw-r--r--lang/p5-Switch/Makefile23
-rw-r--r--lang/p5-Switch/distinfo6
-rw-r--r--lang/p5-Switch/patches/patch-Switch.pm16
4 files changed, 51 insertions, 0 deletions
diff --git a/lang/p5-Switch/DESCR b/lang/p5-Switch/DESCR
new file mode 100644
index 00000000000..92d13b3e5a5
--- /dev/null
+++ b/lang/p5-Switch/DESCR
@@ -0,0 +1,6 @@
+Switch.pm provides the syntax and semantics for an explicit case mechanism for
+Perl. The syntax is minimal, introducing only the keywords C<switch> and
+C<case> and conforming to the general pattern of existing Perl control
+structures. The semantics are particularly rich, allowing any one (or more) of
+early 30 forms of matching to be used when comparing a switch value with its
+various cases.
diff --git a/lang/p5-Switch/Makefile b/lang/p5-Switch/Makefile
new file mode 100644
index 00000000000..cdcefdafd0e
--- /dev/null
+++ b/lang/p5-Switch/Makefile
@@ -0,0 +1,23 @@
+# $NetBSD: Makefile,v 1.1.1.1 2011/10/28 09:14:41 obache Exp $
+#
+
+DISTNAME= Switch-2.16
+PKGNAME= p5-${DISTNAME}
+CATEGORIES= lang perl5
+MASTER_SITES= ${MASTER_SITE_PERL_CPAN:=../../authors/id/R/RG/RGARCIA/}
+
+MAINTAINER= pkgsrc-users@NetBSD.org
+HOMEPAGE= http://search.cpan.org/dist/Switch/
+COMMENT= Switch statement for Perl
+LICENSE= ${PERL5_LICENSE}
+
+PKG_DESTDIR_SUPPORT= user-destdir
+
+DEPENDS+= p5-Text-Balanced-[0-9]*:../../textproc/p5-Text-Balanced
+DEPENDS+= p5-Filter-[0-9]*:../../textproc/p5-Filter
+
+PERL5_PACKLIST= auto/Switch/.packlist
+USE_LANGUAGES= # none
+
+.include "../../lang/perl5/module.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/lang/p5-Switch/distinfo b/lang/p5-Switch/distinfo
new file mode 100644
index 00000000000..e8415a380c9
--- /dev/null
+++ b/lang/p5-Switch/distinfo
@@ -0,0 +1,6 @@
+$NetBSD: distinfo,v 1.1.1.1 2011/10/28 09:14:41 obache Exp $
+
+SHA1 (Switch-2.16.tar.gz) = 2737a2b5e64a9d715528fa50a8d967710106220e
+RMD160 (Switch-2.16.tar.gz) = 0b93b8ecea9d2e83d757e95fb4056d6b706b1f60
+Size (Switch-2.16.tar.gz) = 13185 bytes
+SHA1 (patch-Switch.pm) = f1bde131fcb5ef85e4f888f7fde7f6b0417318d6
diff --git a/lang/p5-Switch/patches/patch-Switch.pm b/lang/p5-Switch/patches/patch-Switch.pm
new file mode 100644
index 00000000000..0dc00a31136
--- /dev/null
+++ b/lang/p5-Switch/patches/patch-Switch.pm
@@ -0,0 +1,16 @@
+$NetBSD: patch-Switch.pm,v 1.1.1.1 2011/10/28 09:14:41 obache Exp $
+
+* misuses the (;$) prototype
+ https://rt.cpan.org/Public/Bug/Display.html?id=60380
+
+--- Switch.pm.orig 2009-10-23 07:52:51.000000000 +0000
++++ Switch.pm
+@@ -146,7 +146,7 @@ sub filter_blocks
+ die "Bad $keyword statement (problem in the code block?) near $Switch::file line ", line(substr($source,0, pos $source), $line), "\n";
+ };
+ my $code = filter_blocks(substr($source,$pos[0],$pos[4]-$pos[0]),line(substr($source,0,$pos[0]),$line));
+- $code =~ s/{/{ local \$::_S_W_I_T_C_H; Switch::switch $arg;/;
++ $code =~ s/{/{ local \$::_S_W_I_T_C_H; Switch::switch($arg);/;
+ $text .= $code . 'continue {last}';
+ next component;
+ }