Alien-Tidyp
view release on metacpan or search on metacpan
bugtracker => 'http://rt.cpan.org/NoAuth/Bugs.html?Dist=Alien-Tidyp',
repository => 'http://github.com/kmx/alien-tidyp',
}
},
get_options => { srctarball => { type => '=s' } }, # option: Build.PL --srctarball=<url_or_filename>
);
$builder->create_build_script();
if ($builder->check_installed_tidyp()) {
my $ans = $builder->prompt("Tidyp detected, wanna use tidyp already installed on your system?", 'y');
$builder->notes('installed_tidyp', undef) unless (lc($ans) eq 'y');
}
# delete build marker (= force rebuild after running Build.PL)
unlink 'build_done';
# set what tidyp tarball we are gonna use
$builder->notes('tidyp_url', [
'http://github.com/downloads/petdance/tidyp/tidyp-1.04.tar.gz',
'https://github.com/downloads/petdance/tidyp/tidyp-1.04.tar.gz',
inc/My/Builder.pm view on Meta::CPAN
elsif ($tarball) {
die "###ERROR### Wrong value of --srctarball option (non existing file or invalid URL)\n";
}
else {
$archive = $self->fetch_file(\@url, $sha1, $download) || die "###ERROR### Download failed\n";
}
print STDERR "Checking checksum '$archive'...\n";
#extract source codes
my $extract_src = 'y';
$extract_src = $self->prompt("Overwrite existing sources? (y/n)", "n") if (-d $self->notes('tidyp_src'));
if (lc($extract_src) eq 'y') {
my $ae = Archive::Extract->new( archive => $archive );
$self->notes('tidyp_src');
$ae->extract(to => $build_src) || die "###ERROR### Cannot extract tarball ", $ae->error;
die "###ERROR### Cannot find expected dir='",$self->notes('tidyp_src'),"'" unless -d $self->notes('tidyp_src');
}
# go for build
$self->build_binaries($build_out, $self->notes('tidyp_src'));
# store info about build into future Alien::Tidyp::ConfigData
inc/My/Builder/Unix.pm view on Meta::CPAN
#hack - use updated config.guess + config.sub - remove when fixed in tidyp distribution
require File::Copy;
File::Copy::copy("patches/config.sub","$srcdir/config.sub");
File::Copy::copy("patches/config.guess","$srcdir/config.guess");
#end of hack
chdir $srcdir;
# do './configure ...'
my $run_configure = 'y';
$run_configure = $self->prompt("Run ./configure again? (y/n)", "n") if (-f "config.status");
if (lc($run_configure) eq 'y') {
my @cmd = ( './configure', '--enable-shared=no', '--disable-dependency-tracking', "--prefix=$prefixdir");
if ($^O eq 'darwin') {
#this is fix for https://rt.cpan.org/Ticket/Display.html?id=66382
push @cmd, "CFLAGS=$Config{ccflags} -fPIC";
push @cmd, "LDFLAGS=$Config{ldflags}";
}
else {
#FIXME maybe use %Config values for all UNIX systems (not now, maybe in the future)
push @cmd, 'CFLAGS=-fPIC';
( run in 1.419 second using v1.01-cache-2.11-cpan-0b5f733616e )