summaryrefslogtreecommitdiff
path: root/devel/p5-Coro
diff options
context:
space:
mode:
authorAnton Berezin <tobez@FreeBSD.org>2003-01-27 09:53:40 +0000
committerAnton Berezin <tobez@FreeBSD.org>2003-01-27 09:53:40 +0000
commit6d7f547b0abd6d653801364fc09e2e7cb1a51255 (patch)
tree0dbdc3550ac2e1850c783c3c1baaa91d00e88f45 /devel/p5-Coro
parentUpdate to 2.06. (diff)
Add p5-Coro, a collection of perl modules that bring coroutines to
perl5.
Notes
Notes: svn path=/head/; revision=74076
Diffstat (limited to 'devel/p5-Coro')
-rw-r--r--devel/p5-Coro/Makefile47
-rw-r--r--devel/p5-Coro/distinfo1
-rw-r--r--devel/p5-Coro/files/patch-Coro:Makefile.PL69
-rw-r--r--devel/p5-Coro/pkg-comment1
-rw-r--r--devel/p5-Coro/pkg-descr10
-rw-r--r--devel/p5-Coro/pkg-plist26
6 files changed, 154 insertions, 0 deletions
diff --git a/devel/p5-Coro/Makefile b/devel/p5-Coro/Makefile
new file mode 100644
index 000000000000..10b738147929
--- /dev/null
+++ b/devel/p5-Coro/Makefile
@@ -0,0 +1,47 @@
+# New ports collection makefile for: Coro
+# Date created: 27 Jan 2003
+# Whom: tobez
+#
+# $FreeBSD$
+#
+
+PORTNAME= Coro
+PORTVERSION= 0.6
+CATEGORIES= devel
+MASTER_SITES= ${MASTER_SITE_PERL_CPAN}
+MASTER_SITE_SUBDIR= Coro
+PKGNAMEPREFIX= p5-
+
+MAINTAINER= tobez@FreeBSD.org
+
+BUILD_DEPENDS= ${SITE_PERL}/${PERL_ARCH}/Event.pm:${PORTSDIR}/devel/p5-Event \
+ ${SITE_PERL}/${PERL_ARCH}/Scalar/Util.pm:${PORTSDIR}/lang/p5-Scalar-List-Utils
+RUN_DEPENDS= ${BUILD_DEPENDS}
+
+SITE_PERL= ${PREFIX}/lib/perl5/site_perl/${PERL_VER}
+PERL_CONFIGURE= yes
+
+.include <bsd.port.pre.mk>
+
+.if ${PERL_LEVEL} < 500600
+BROKEN= "This port requires perl 5.6 or newer"
+.endif
+
+MANPREFIX= ${PREFIX}/lib/perl5/${PERL_VERSION}
+MAN3= Coro.3 \
+ Coro::Channel.3 \
+ Coro::Cont.3 \
+ Coro::Event.3 \
+ Coro::Handle.3 \
+ Coro::MakeMaker.3 \
+ Coro::RWLock.3 \
+ Coro::Semaphore.3 \
+ Coro::SemaphoreSet.3 \
+ Coro::Signal.3 \
+ Coro::Socket.3 \
+ Coro::Specific.3 \
+ Coro::State.3 \
+ Coro::Timer.3 \
+ Coro::Util.3
+
+.include <bsd.port.post.mk>
diff --git a/devel/p5-Coro/distinfo b/devel/p5-Coro/distinfo
new file mode 100644
index 000000000000..c35e38035b5c
--- /dev/null
+++ b/devel/p5-Coro/distinfo
@@ -0,0 +1 @@
+MD5 (Coro-0.6.tar.gz) = 88f53f60471e04923845b06befd3403c
diff --git a/devel/p5-Coro/files/patch-Coro:Makefile.PL b/devel/p5-Coro/files/patch-Coro:Makefile.PL
new file mode 100644
index 000000000000..25f2f335d4e1
--- /dev/null
+++ b/devel/p5-Coro/files/patch-Coro:Makefile.PL
@@ -0,0 +1,69 @@
+$FreeBSD$
+
+--- Coro/Makefile.PL.orig Mon Jan 27 10:25:21 2003
++++ Coro/Makefile.PL Mon Jan 27 10:27:04 2003
+@@ -24,62 +24,15 @@ if ($^O =~ /win32/i or $^O =~ /cygwin/)
+ $iface = "s";
+ }
+
+-print <<EOF;
+-
+-Version 0.12 introduced C context sharing. This makes it possible to share
+-the C stack and context between many coroutines, resulting in memory
+-savings and slight speed gains, at the cost of potential (but mostly
+-theoretical) segfaults. On my Linux/x86 machine this decreased the size
+-of a new coroutine from 9k to 5k, but the savings are much more apparent
+-on machines without mmap or good memory management. This algorithm relies
+-on the non-fact that the same machine stack pointer indicates the same
+-function call nesting level, which usually works good enough but might
+-fail...
+-
+-The default (enabled) has been in-use on productions servers for some time
+-now, without any problem reports so far.
+-
+-EOF
+-
+-print "Do you want to enable C context sharing (y/n) [y]? ";
+-
+-if (<> !~ /^\s*n/i) {
++if (1 || <> !~ /^\s*n/i) {
+ print "\nExperimental context sharing enabled.\n\n";
+ $DEFINE .= " -DCORO_LAZY_STACK";
+ }
+
+ if ($iface) {
+- print <<EOF;
+-
+-Coro can use various ways to implement coroutines at the C level:
+-
+-u The unix ucontext functions are newer and not implemented in older
+- unices (or broken libc's like glibc-2.2.2 and below). They allow very
+- fast coroutine creation and fast switching, and, most importantly, are
+- very stable.
+-
+-s If the ucontext functions are not working or you don't want
+- to use them for other reasons you can try a workaround using
+- setjmp/longjmp/sigaltstack (also standard unix functions). Coroutine
+- creation is rather slow, but switching is very fast as well (often much
+- faster than with the ucontext functions). Unfortunately, glibc-2.1 and
+- below don't even feature a working sigaltstack.
+-
+-l Older GNU/Linux systems (glibc-2.1 and below) need this hack. Since it is
+- very linux-specific it is also quite fast for newer versions; when it
+- works, that is...
+-
+-i IRIX. For some reason, SGI really does not like to follow the unix
+- standard (does that surprise you?), so this workaround might be needed
+- (it's fast), although s and u should also work now.
+-
+-EOF
+-
+ retry:
+- print "Use which implementation,\n",
+- "<s>etjmp/longjump, <u>context, <i>rix or <l>inux [$iface]? ";
+
+- my $r = <>;
++ my $r = "s" || <>;
+ $iface = lc $1 if $r =~ /(\S)/;
+
+ if ($iface eq "u") {
diff --git a/devel/p5-Coro/pkg-comment b/devel/p5-Coro/pkg-comment
new file mode 100644
index 000000000000..81be5ab1c340
--- /dev/null
+++ b/devel/p5-Coro/pkg-comment
@@ -0,0 +1 @@
+Coro - coroutine process abstraction for perl
diff --git a/devel/p5-Coro/pkg-descr b/devel/p5-Coro/pkg-descr
new file mode 100644
index 000000000000..49586cb71b74
--- /dev/null
+++ b/devel/p5-Coro/pkg-descr
@@ -0,0 +1,10 @@
+This module collection manages coroutines. Coroutines are similar to
+threads but don't run in parallel.
+
+In this module, coroutines are defined as "callchain + lexical variables
++ @_ + $_ + $@ + $^W + C stack), that is, a coroutine has it's own
+callchain, it's own set of lexicals and it's own set of perl's most
+important global variables.
+
+Author: Marc Lehmann <pcg@goof.com>
+WWW: http://search.cpan.org/search?dist=Coro
diff --git a/devel/p5-Coro/pkg-plist b/devel/p5-Coro/pkg-plist
new file mode 100644
index 000000000000..41b51e1655de
--- /dev/null
+++ b/devel/p5-Coro/pkg-plist
@@ -0,0 +1,26 @@
+lib/perl5/site_perl/%%PERL_VER%%/%%PERL_ARCH%%/auto/Coro/Event/Event.so
+lib/perl5/site_perl/%%PERL_VER%%/%%PERL_ARCH%%/auto/Coro/Event/Event.bs
+lib/perl5/site_perl/%%PERL_VER%%/%%PERL_ARCH%%/auto/Coro/State/State.so
+lib/perl5/site_perl/%%PERL_VER%%/%%PERL_ARCH%%/auto/Coro/State/State.bs
+lib/perl5/site_perl/%%PERL_VER%%/%%PERL_ARCH%%/auto/Coro/.packlist
+lib/perl5/site_perl/%%PERL_VER%%/%%PERL_ARCH%%/Coro.pm
+lib/perl5/site_perl/%%PERL_VER%%/%%PERL_ARCH%%/Coro/Cont.pm
+lib/perl5/site_perl/%%PERL_VER%%/%%PERL_ARCH%%/Coro/State.pm
+lib/perl5/site_perl/%%PERL_VER%%/%%PERL_ARCH%%/Coro/Channel.pm
+lib/perl5/site_perl/%%PERL_VER%%/%%PERL_ARCH%%/Coro/Semaphore.pm
+lib/perl5/site_perl/%%PERL_VER%%/%%PERL_ARCH%%/Coro/SemaphoreSet.pm
+lib/perl5/site_perl/%%PERL_VER%%/%%PERL_ARCH%%/Coro/RWLock.pm
+lib/perl5/site_perl/%%PERL_VER%%/%%PERL_ARCH%%/Coro/CoroAPI.h
+lib/perl5/site_perl/%%PERL_VER%%/%%PERL_ARCH%%/Coro/Specific.pm
+lib/perl5/site_perl/%%PERL_VER%%/%%PERL_ARCH%%/Coro/Timer.pm
+lib/perl5/site_perl/%%PERL_VER%%/%%PERL_ARCH%%/Coro/MakeMaker.pm
+lib/perl5/site_perl/%%PERL_VER%%/%%PERL_ARCH%%/Coro/Signal.pm
+lib/perl5/site_perl/%%PERL_VER%%/%%PERL_ARCH%%/Coro/Handle.pm
+lib/perl5/site_perl/%%PERL_VER%%/%%PERL_ARCH%%/Coro/Util.pm
+lib/perl5/site_perl/%%PERL_VER%%/%%PERL_ARCH%%/Coro/Event.pm
+lib/perl5/site_perl/%%PERL_VER%%/%%PERL_ARCH%%/Coro/Socket.pm
+@dirrm lib/perl5/site_perl/%%PERL_VER%%/%%PERL_ARCH%%/auto/Coro/Event
+@dirrm lib/perl5/site_perl/%%PERL_VER%%/%%PERL_ARCH%%/auto/Coro/State
+@dirrm lib/perl5/site_perl/%%PERL_VER%%/%%PERL_ARCH%%/auto/Coro
+@dirrm lib/perl5/site_perl/%%PERL_VER%%/%%PERL_ARCH%%/Coro
+@unexec rmdir %D/lib/perl5/site_perl/%%PERL_VER%%/mach 2>/dev/null || true