Alien-Plotly-Orca

 view release on metacpan or  search on metacpan

alienfile  view on Meta::CPAN

#!perl
use alienfile;

use lib 'util';
use MyInstallUtil;

# For Windows and OSX we download from Anaconda repo instead as plotly-orca's
# github releases page. This is because latter's Windows and OSX downloads
# still needs installation.
# For Linux we still use the AppImage from plotly-orca's github repo releases,
# as that's a bundle of everything needed so we can probably avoid dependency
# issues.

my $plotly_orca_version          = '1.3.1';
my $plotly_orca_version_anaconda = '1.3.1-1';

my $anaconda_base_url =
  "https://anaconda.org/plotly/plotly-orca/${plotly_orca_version}/download";
my $make_url_anaconda = sub {

    # $_[0] is one of "win-64", "osx-64", "linux-64"
    # see also https://anaconda.org/plotly/plotly-orca/files
    join( '/',
        $anaconda_base_url, $_[0],
        "plotly-orca-${plotly_orca_version_anaconda}.tar.bz2" );
};

my $github_base_url = "https://github.com/plotly/orca/releases/download";
my $make_url_github = sub {

    # $_[0] is one of the file names on https://github.com/plotly/orca/releases
    join( '/', $github_base_url, "v${plotly_orca_version}", $_[0] );
};

my %download_url = (
    MSWin32 => $make_url_anaconda->('win-64'),
    darwin  => $make_url_anaconda->('osx-64'),
    linux => $make_url_github->("orca-${plotly_orca_version}.AppImage"),
);

die 'Unsupported OS' unless grep { $^O eq $_ } ( keys %download_url );

if ( MyInstallUtil::need_xvfb() and not MyInstallUtil::can_xvfb() ) {
    die "plotly-orca requires a running X service. "
      . "But your host seems to be headless and you don't have xvfb at all. "
      . "Please install xvfb.";
}



plugin 'Probe::CommandLine' => (
    command => MyInstallUtil::wrap_orca('orca'),
    args    => ['-h'],
    match   => qr/plotly/i,
);

configure {
    requires 'Capture::Tiny'         => 0;
    requires 'File::Which'           => 0;
    requires 'Path::Tiny'            => 0;
    requires 'File::Copy::Recursive' => 0;
};

share {



( run in 1.352 second using v1.01-cache-2.11-cpan-b50b6a40fd4 )