Alien-wasmtime
view release on metacpan or search on metacpan
use alienfile;
use Path::Tiny qw( path );
use Config;
configure {
requires 'Path::Tiny';
};
my $version = $ENV{ALIEN_WASMTIME_VERSION} || 'v0.27.0';
my $arch = 'x86_64';
if($^O eq 'linux')
{
# archname=x86_64-linux-gnu-thread-multi
if($Config{archname} =~ /^(x86_64|aarch64)-linux/ && $Config{ptrsize} == 8)
{
if($1 eq 'aarch64')
{
$arch = 'aarch64';
}
}
else
{
print "Only x86_64 and arm64 are supported on Linux.\n";
print "If we are missing a binary tarball that could work for your platform, please comment here:\n";
print "https://github.com/perlwasm/Alien-wasmtime/issues/2\n";
exit;
}
}
elsif($^O eq 'MSWin32')
{
if($Config{archname} !~ /^MSWin32-x64/ || $Config{ptrsize} != 8)
{
print "Only x86_64 is supported on Windows.\n";
print "If we are missing a binary tarball that could work for your platform, please comment here:\n";
print "https://github.com/perlwasm/Alien-wasmtime/issues/2\n";
exit;
}
}
elsif($^O eq 'darwin')
{
if($Config{myarchname} !~ /^i386-darwin/ || $Config{ptrsize} != 8)
{
print "Only x86_64 is supported on macOS / darwin\n";
print "If we are missing a binary tarball that could work for your platform, please comment here:\n";
print "https://github.com/perlwasm/Alien-wasmtime/issues/2\n";
exit;
}
}
else
{
print "Operating system not supported.\n";
print "If we are missing a binary tarball that could work for your platform, please comment here:\n";
print "https://github.com/perlwasm/Alien-wasmtime/issues/2\n";
exit;
}
probe sub { 'share' };
share {
if($^O eq 'linux')
{
start_url "https://github.com/bytecodealliance/wasmtime/releases/download/$version/wasmtime-$version-$arch-linux-c-api.tar.xz";
plugin 'Download';
plugin Extract => 'tar.xz';
}
elsif($^O eq 'MSWin32')
{
start_url "https://github.com/bytecodealliance/wasmtime/releases/download/$version/wasmtime-$version-$arch-windows-c-api.zip";
plugin 'Download';
plugin Extract => 'zip';
}
elsif($^O eq 'darwin')
( run in 1.854 second using v1.01-cache-2.11-cpan-bbb979687b5 )