Alien-Kiwisolver
view release on metacpan or search on metacpan
use alienfile;
use strict;
use warnings;
use ExtUtils::CppGuess;
my $guess = ExtUtils::CppGuess->new;
my $cppstdflag = $guess->cpp_standard_flag('C++11');
die "Need to have full C++11 support, compiler @{[ (split ' ', $guess->compiler_command)[0] ]} only supports $cppstdflag"
if ( $guess->is_gcc || $guess->is_clang ) && $cppstdflag =~ /\Qc++0x\E/;
share {
requires 'Net::SSLeay' => 0;
requires 'IO::Socket::SSL' => 0;
requires 'File::Copy::Recursive' => 0;
requires 'Path::Tiny' => 0;
plugin Download => (
url => 'https://github.com/nucleic/kiwi/archive/main.zip',
);
plugin Extract => 'zip';
patch sub {
Path::Tiny->new("kiwi/variable.h")->edit_utf8(sub {
s/private:\n/$&friend int* get_refcount( kiwi::Variable* obj );/s;
});
Path::Tiny->new("kiwi/constraint.h")->edit_utf8(sub {
s/private:\n/$&friend int* get_refcount( kiwi::Constraint* obj );/s;
});
};
build [
sub {
my ($build) = @_;
my @dirs;
$build->log("copy to prefix");
my $prefix_abs = Path::Tiny::path($build->install_prop->{prefix});
my $kiwi_include_dest = $prefix_abs->child('include');
$kiwi_include_dest->mkpath;
File::Copy::Recursive::dircopy( 'kiwi', $kiwi_include_dest->child('kiwi') );
},
];
gather sub {
my($build) = @_;
my $prefix = $build->runtime_prop->{prefix};
my $cflags = "-I$prefix/include";
my $libs = "";
$build->runtime_prop->{cppstdflag} = $cppstdflag;
$build->runtime_prop->{cflags} = $cflags;
$build->runtime_prop->{cflags_static} = $cflags;
$build->runtime_prop->{libs} = $libs;
$build->runtime_prop->{libs_static} = $libs;
};
};
( run in 0.476 second using v1.01-cache-2.11-cpan-119454b85a5 )