~ubuntu-branches/ubuntu/vivid/nqp/vivid-proposed

« back to all changes in this revision

Viewing changes to tools/build/install-moar-runner.pl

  • Committer: Package Import Robot
  • Author(s): Alessandro Ghedini
  • Date: 2013-11-01 12:09:18 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20131101120918-kx51sl0sxl3exsxi
Tags: 2013.10-1
* New upstream release
* Bump versioned (Build-)Depends on parrot
* Update patches
* Install new README.pod
* Fix vcs-field-not-canonical
* Do not install rubyish examples
* Do not Depends on parrot-devel anymore
* Add 07_disable-serialization-tests.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/perl
 
2
# Copyright (C) 2013, The Perl Foundation.
 
3
 
 
4
use strict;
 
5
use warnings;
 
6
use 5.008;
 
7
use File::Spec;
 
8
 
 
9
my ($prefix) = @ARGV;
 
10
 
 
11
unless (File::Spec->file_name_is_absolute($prefix)) {
 
12
    $prefix = File::Spec->rel2abs($prefix);
 
13
}
 
14
 
 
15
my $lib_dir = File::Spec->catfile($prefix, 'languages', 'nqp', 'lib');
 
16
my $nqp_mvm = File::Spec->catfile($prefix, 'languages', 'nqp', 'lib', 'nqp.moarvm');
 
17
 
 
18
if ($^O eq 'MSWin32') {
 
19
    my $install_to = File::Spec->catfile($prefix, 'bin', 'nqp.bat');
 
20
    my $moar       = File::Spec->catfile($prefix, 'bin', 'moar.exe');
 
21
    open my $fh, ">", $install_to
 
22
        or die "Could not open $install_to: $!";
 
23
    print $fh '@ "' . $moar . '" --libpath="' . $lib_dir . '" "' . $nqp_mvm . '" %*' . "\n";
 
24
    close $fh
 
25
        or die "Could not close $install_to: $!";
 
26
}
 
27
else {
 
28
    my $install_to = File::Spec->catfile($prefix, 'bin', 'nqp');
 
29
    my $moar       = File::Spec->catfile($prefix, 'bin', 'moar');
 
30
    open my $fh, ">", $install_to
 
31
        or die "Could not open $install_to: $!";
 
32
    print $fh "#!/bin/sh\n";
 
33
    print $fh "exec $moar --libpath=$lib_dir $nqp_mvm \"\$\@\"\n";
 
34
    close $fh
 
35
        or die "Could not close $install_to: $!";
 
36
    chmod 0755, $install_to;
 
37
}