]> Dogcows Code - chaz/p5-Alien-ZMQ/blob - inc/My/Build/Windows.pm
add support for the MSWin32 platform
[chaz/p5-Alien-ZMQ] / inc / My / Build / Windows.pm
1 package My::Build::Windows;
2
3 use warnings FATAL => 'all';
4 use strict;
5
6 use Config;
7 use File::Spec::Functions qw/catdir/;
8 use My::Util;
9
10 use base 'My::Build';
11
12 sub probe_zeromq {
13 # probing on windows is not supported
14 }
15
16 sub install_zeromq {
17 my $self = shift;
18
19 my $version = $self->notes('zmq-version');
20 my ($archive, $sha1);
21 # check of this is a 32-bit or 64-bit perl
22 if ($Config{ptrsize} == 8) {
23 $archive = $self->notes('zmq-win64-dist');
24 $sha1 = $self->notes('zmq-win64-sha1');
25 } else {
26 $archive = $self->notes('zmq-win32-dist');
27 $sha1 = $self->notes('zmq-win32-sha1');
28 }
29
30 print "Downloading libzmq $version installer from miru.hk...\n";
31 My::Util::download($archive, "setup.exe");
32 $self->add_to_cleanup('setup.exe');
33
34 print "Verifying...\n";
35 My::Util::verify("setup.exe", $sha1);
36
37 my $prefix = catdir($self->install_destination("lib"), qw/auto share dist Alien-ZMQ/);
38 my $basedir = $self->base_dir;
39 my $destdir = catdir($basedir, "share");
40 $self->add_to_cleanup($destdir);
41
42 print "Installing...\n";
43 system(qw|setup.exe /S|, "/D=$destdir") == 0 or die "Failed to install libzmq";
44
45 (
46 inc_version => $version,
47 lib_version => $version,
48 inc_dir => catdir($prefix, "include"),
49 lib_dir => catdir($prefix, "lib"),
50 );
51 }
52
53 1;
This page took 0.038853 seconds and 4 git commands to generate.