]> Dogcows Code - chaz/p5-Alien-ZMQ/commitdiff
do not bother building the zeromq test programs
authorCharles McGarvey <chazmcgarvey@brokenzipper.com>
Sun, 20 Jan 2013 02:17:08 +0000 (19:17 -0700)
committerCharles McGarvey <chazmcgarvey@brokenzipper.com>
Sun, 20 Jan 2013 04:13:00 +0000 (21:13 -0700)
Some of the tests require pthreads, and the build system isn't always correct
about when it shouldn't try to build such tests.

dist.ini
files/zeromq-3.2.2-no-tests.patch [new file with mode: 0644]
inc/My/Build.pm

index c7407a3ada186a1cedbf9de7c883e3dc066bb2c9..38844d018ab0107031c7bea5318321b03590a346 100644 (file)
--- a/dist.ini
+++ b/dist.ini
@@ -36,5 +36,6 @@ Cwd = 0
 Digest::SHA = 0
 File::Path = 0
 File::Spec::Functions = 0
+IPC::Run = 0
 LWP::Simple = 0
 
diff --git a/files/zeromq-3.2.2-no-tests.patch b/files/zeromq-3.2.2-no-tests.patch
new file mode 100644 (file)
index 0000000..0c3c57f
--- /dev/null
@@ -0,0 +1,13 @@
+--- a/Makefile.in      2012-11-23 00:58:57.000000000 -0700
++++ b/Makefile.in      2013-01-18 23:08:21.794836073 -0700
+@@ -256,8 +256,8 @@
+ top_builddir = @top_builddir@
+ top_srcdir = @top_srcdir@
+ ACLOCAL_AMFLAGS = -I config
+-@BUILD_PGM_FALSE@SUBDIRS = src doc perf tests
+-@BUILD_PGM_TRUE@SUBDIRS = foreign/openpgm src doc perf tests
++@BUILD_PGM_FALSE@SUBDIRS = src doc
++@BUILD_PGM_TRUE@SUBDIRS = foreign/openpgm src doc
+ DIST_SUBDIRS = foreign/openpgm src doc perf tests builds/msvc
+ EXTRA_DIST = \
+       autogen.sh      \
index ca4a02a2b9d2df820d3366efcf90222bc1ef993c..a6a55f489e38e68b16bdc7d24688d8e99bc9deae 100644 (file)
@@ -10,6 +10,7 @@ use Cwd qw/realpath/;
 use Digest::SHA qw/sha1_hex/;
 use File::Path qw/remove_tree/;
 use File::Spec::Functions qw/catdir catfile/;
+use IPC::Run qw/run/;
 use LWP::Simple qw/getstore RC_OK/;
 use Module::Build;
 
@@ -33,7 +34,7 @@ sub ACTION_code {
         %vars = $self->probe_zeromq;
     }
 
-    if ($vars{inc_version} && $vars{lib_version}) {
+    if ($vars{inc_version} && $vars{lib_version} && $vars{inc_dir} && $vars{lib_dir}) {
         say "Found ØMQ $vars{lib_version}; skipping installation";
     } else {
         say "ØMQ not found; building from source...";
@@ -42,7 +43,7 @@ sub ACTION_code {
 
     # write vars to ZMQ.pm
     my $module = catfile qw/blib lib Alien ZMQ.pm/;
-    open my $LIB, "<$module" or die "Cannot read module";
+    open my $LIB, '<', $module or die "Cannot read module";
     my $lib = do { local $/; <$LIB> };
     close $LIB;
     $lib =~ s/^sub inc_dir.*$/sub inc_dir { "$vars{inc_dir}" }/m;
@@ -51,12 +52,12 @@ sub ACTION_code {
     $lib =~ s/^sub lib_version.*$/sub lib_version { v$vars{lib_version} }/m;
     my @stats = stat $module;
     chmod 0644, $module;
-    open $LIB, ">$module" or die "Cannot write config to module";
+    open $LIB, '>', $module or die "Cannot write config to module";
     print $LIB $lib;
     close $LIB;
     chmod $stats[2], $module;
 
-    open my $TARGET, ">build-zeromq";
+    open my $TARGET, '>', "build-zeromq";
     print $TARGET time, "\n";
     close $TARGET;
 }
@@ -67,7 +68,7 @@ sub probe_zeromq {
     my %config = $cb->get_config;
 
     my $src = "test-$$.c";
-    open my $SRC, ">$src";
+    open my $SRC, '>', $src;
     print $SRC <<END;
 #include <stdio.h>
 #include <zmq.h>
@@ -164,7 +165,7 @@ sub install_zeromq {
 
     say "Verifying...";
     my $sha1sum = Digest::SHA->new;
-    open my $ARCHIVE, "<$archive";
+    open my $ARCHIVE, '<', $archive or die "Can't open source archive";
     binmode $ARCHIVE;
     $sha1sum->addfile($ARCHIVE);
     close $ARCHIVE;
@@ -178,10 +179,15 @@ sub install_zeromq {
     my $basedir = $self->base_dir;
     my $datadir = catdir($basedir, "share");
     my $srcdir  = catdir($basedir, "zeromq-$version");
+    chdir $srcdir;
+
+    say "Patching...";
+    for my $patch (glob("$basedir/files/zeromq-$version-*.patch")) {
+       run ["patch"], '<', $patch or die "Failed to patch ØMQ";
+    }
 
     say "Configuring...";
     my @config = $cb->split_like_shell($self->args('zmq-config') || "");
-    chdir $srcdir;
     $cb->do_system(qw/sh configure CPPFLAGS=-Wno-error/, "--prefix=$prefix", @config)
         or die "Failed to configure ØMQ";
 
This page took 0.029136 seconds and 4 git commands to generate.