Skip to content
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 34 additions & 6 deletions nodebrew
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ sub _cmd_install {
my $target_name = $self->get_type . "-$version";
my $tarball_path = "$src_dir/$target_name.tar.gz";

if ($^O eq 'solaris' && $self->get_type eq 'iojs') {
print "io.js does not supported on Oracle Solaris. \n";
exit;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use error_and_exit

}

$self->clean($version);
mkdir $src_dir;

Expand All @@ -109,15 +114,38 @@ sub _cmd_install {
Nodebrew::Utils::extract_tar($tarball_path, $src_dir);

my $install_dir = $self->get_install_dir;
system qq[
cd "$src_dir/$target_name" &&
./configure --prefix="$install_dir/$version" $configure_opts &&
make &&
make install
];

if ($^O eq 'solaris') {
if ($version =~ /^v0/) {
$configure_opts = join ' ', "--dest-os=solaris --with-dtrace --dest-cpu=x64 --without-mdb", $configure_opts;
system qq[
cd "$src_dir/$target_name" &&
echo "MjAwYTIwMQo+IAkgICAgJ2RlZmluZXMnOiBbJ19HTElCQ1hYX1VTRV9DOTlfTUFUSCddLAo=" | openssl enc -d -base64 | gpatch common.gypi
];
} else {
$configure_opts = join ' ', "--dest-os=solaris --with-dtrace --dest-cpu=x64", $configure_opts;
}
system qq[
cd "$src_dir/$target_name" &&
CC=gcc ./configure --prefix="$install_dir/$version" $configure_opts &&
CC=gcc gmake &&
CC=gcc gmake install
];
} else {
system qq[
cd "$src_dir/$target_name" &&
./configure --prefix="$install_dir/$version" $configure_opts &&
make &&
make install
];
}
}

sub _cmd_install_binary {
if ($^O eq 'solaris') {
print "Does not supported on Oracle Solaris. This option supports only illumos kernel distribution. \n";
exit;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use error_and_exit

}
my ($self, $args) = @_;

my ($version, $release) = $self->find_install_version($args->[0]);
Expand Down