I've attached a patch to fix the hints file and the test suite for perlbrew perls.
-Rob
On Mon Dec 06 21:28:56 2010, ANDREMAR wrote:
Show quoted text> The auto-detection for 64-bit fails if I use a perlbrew built perl.
>
> Not sure what the correct fix is, but I just did export ARCHFLAGS, and
> made the top most check of the if in hints/darwin.pl check for that, and
> use that in case it existed
diff -Naur Mac-FSEvents-0.04/hints/darwin.pl Mac-FSEvents-0.04-rhoelz/hints/darwin.pl
--- Mac-FSEvents-0.04/hints/darwin.pl 2009-10-22 08:56:00.000000000 -0500
+++ Mac-FSEvents-0.04-rhoelz/hints/darwin.pl 2011-05-29 15:43:47.000000000 -0500
@@ -3,15 +3,15 @@
use Config;
if ( $Config{myarchname} =~ /i386/ ) {
- if ( $Config{version} =~ /^5\.10/ ) {
- # 5.10, build as 10.5+ with Snow Leopard 64-bit support
- $arch = "-arch x86_64 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5";
+ my $os_version = qx(system_profiler SPSoftwareDataType);
+ if($os_version =~ /System Version: Mac OS X 10\.(\d+)/) {
+ if($1 >= 5) { # Leopard and up
+ $arch = "-arch x86_64 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5";
+ } else {
+ $arch = "-arch i386 -arch ppc";
+ }
}
- else {
- # 5.8.x, build for 10.3+ 32-bit universal
- $arch = "-arch i386 -arch ppc";
- }
-
+
print "Adding $arch\n";
my $ccflags = $Config{ccflags};
diff -Naur Mac-FSEvents-0.04/t/05event.t Mac-FSEvents-0.04-rhoelz/t/05event.t
--- Mac-FSEvents-0.04/t/05event.t 2009-02-28 13:48:58.000000000 -0600
+++ Mac-FSEvents-0.04-rhoelz/t/05event.t 2011-05-29 15:36:04.000000000 -0500
@@ -8,7 +8,7 @@
use IO::Select;
use Mac::FSEvents;
-use Test::More tests => 4;
+use Test::More tests => 7;
my $tmpdir = "$FindBin::Bin/tmp";
@@ -35,25 +35,27 @@
local $SIG{ALRM} = sub { die "alarm\n" };
alarm 3;
+ my $seen_event;
READ:
while ( my @events = $fs->read_events ) {
for my $event ( @events ) {
my $path = $event->path;
$since = $event->id;
if ( $tmp->filename =~ /^$path/ ) {
- ok( 1, 'event received (poll interface)' );
+ $seen_event = 1;
last READ;
}
}
}
+ ok( $seen_event, 'event received (poll interface)' );
alarm 0;
};
if ( $@ ) {
die $@ unless $@ eq "alarm\n";
- ok( 0, 'event received (poll interface)' );
}
+ ok( ! $@, 'event received (poll interface)' );
$fs->stop;
}
@@ -78,24 +80,26 @@
my $sel = IO::Select->new($fh);
+ my $seen_event;
READ:
while ( $sel->can_read ) {
for my $event ( $fs->read_events ) {
my $path = $event->path;
if ( $tmp->filename =~ /^$path/ ) {
- ok( 1, 'event received (select interface)' );
+ $seen_event = 1;
last READ;
}
}
}
+ ok( $seen_event, 'event received (select interface)' );
alarm 0;
};
if ( $@ ) {
die $@ unless $@ eq "alarm\n";
- ok( 0, 'event received (select interface)' );
}
+ ok( ! $@, 'event received (select interface)' );
$fs->stop;
}
@@ -114,26 +118,28 @@
local $SIG{ALRM} = sub { die "alarm\n" };
alarm 3;
+ my $seen_event;
READ:
while ( my @events = $fs->read_events ) {
for my $event ( @events ) {
if ( $event->history_done ) {
- ok( 1, 'history event received' );
+ $seen_event = 1;
last READ;
}
}
}
+ ok( $seen_event, 'history event received' );
alarm 0;
};
if ( $@ ) {
die $@ unless $@ eq "alarm\n";
- ok( 0, 'history event received' );
}
+ ok( ! $@, 'history event received' );
$fs->stop;
}
# clean up
-rmtree $tmpdir if -d $tmpdir;
\ No newline at end of file
+rmtree $tmpdir if -d $tmpdir;