--- /dev/null
+--- 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 \
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;
%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...";
# 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;
$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;
}
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>
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;
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";