-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.travis.run
63 lines (53 loc) · 1.56 KB
/
.travis.run
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!perl
use strict;
use Cwd ();
use File::Spec;
my $ROOT = Cwd::abs_path( Cwd::cwd() );
my $EXTDIR = File::Spec->catdir($ROOT, "ext");
sub mysystem(@) {
system(@_) == 0 or die "Failed to execute @_: $!";
}
sub run_tests {
mysystem("perl", "Build.PL");
mysystem("./Build", "test");
}
{
my $version = "6.0.0";
my $version_suffix = "a";
my $basename = "gmp-$version";
my $prefix = File::Spec->catfile($EXTDIR, $basename);
if (-e $prefix) {
print STDERR "$prefix already exists\n";
} else {
print STDERR "installing $prefix\n";
my $file = "$basename$version_suffix.tar.xz";
mysystem("curl", "-LO", "https://ftp.gnu.org/gnu/gmp/$file");
mysystem("tar", "xf", $file);
chdir $basename;
mysystem("./configure", "--prefix", $prefix);
mysystem("make");
mysystem("make", "install");
chdir $ROOT;
}
$ENV{GMP_HOME} = $prefix;
}
{
my $version = "3.1.2";
my $basename = "mpfr-$version";
my $prefix = File::Spec->catfile($EXTDIR, $basename);
if (-e $prefix) {
print STDERR "$prefix already exists\n";
} else {
print STDERR "installing $prefix\n";
my $file = "$basename.tar.gz";
mysystem("curl", "-LO", "http://www.mpfr.org/mpfr-$version/$file");
mysystem("tar", "xzf", $file);
chdir $basename;
mysystem("./configure", "--prefix", $prefix, "--with-gmp=$ENV{GMP_HOME}");
mysystem("make");
mysystem("make", "install");
chdir $ROOT;
}
$ENV{MPFR_HOME} = $prefix;
}
run_tests();