Skip to content
Permalink
Browse files

Replace all remaining references to absolute install paths.

Make them dynamic relative to the executable.
  • Loading branch information...
patzim committed Jan 13, 2019
1 parent aed2923 commit f20a2b6ee0d3c3099f461f2c5cd8a564c68a0df7
Showing with 17 additions and 10 deletions.
  1. +1 −6 src/core/CompUnit/RepositoryRegistry.pm6
  2. +14 −0 src/main.nqp
  3. +2 −4 src/vm/moar/ModuleLoaderVMConfig.nqp
@@ -83,12 +83,7 @@ class CompUnit::RepositoryRegistry {
}
}

my $prefix := nqp::existskey($ENV,'RAKUDO_PREFIX')
?? nqp::atkey($ENV,'RAKUDO_PREFIX')
!! nqp::concat(
nqp::atkey(nqp::getcomp('perl6').config,'libdir'),
"{$sep}perl6"
);
my str $prefix = nqp::getcurhllsym('$PERL6_HOME');

# XXX Various issues with this stuff on JVM , TEMPORARY
my str $home;
@@ -2,6 +2,20 @@ use Perl6::Grammar;
use Perl6::Actions;
use Perl6::Compiler;

# Determine Perl6 and NQP dirs.
my $sep := nqp::backendconfig()<osname> eq 'MSWin32' ?? '\\' !! '/';
my $exec-dir := nqp::substr(nqp::execname(), 0, nqp::rindex(nqp::execname(), $sep));
my $perl6-home := nqp::getenvhash()<PERL6_HOME> // $exec-dir ~ '/../share/perl6';
if (nqp::substr($perl6-home, nqp::chars($perl6-home) - 1) eq $sep) {
$perl6-home := nqp::substr($perl6-home, 0, nqp::chars($perl6-home) - 1);
}
my $nqp-home := nqp::getenvhash()<NQP_HOME> // $exec-dir ~ '/../share/nqp';
if (nqp::substr($nqp-home, nqp::chars($nqp-home) - 1) eq $sep) {
$nqp-home := nqp::substr($nqp-home, 0, nqp::chars($nqp-home) - 1);
}
nqp::bindhllsym('perl6', '$PERL6_HOME', $perl6-home);
nqp::bindhllsym('perl6', '$NQP_HOME', $nqp-home);

# Initialize Rakudo runtime support.
nqp::p6init();

@@ -1,11 +1,9 @@
role Perl6::ModuleLoaderVMConfig {
method vm_search_paths() {
my @search_paths;
@search_paths.push(nqp::backendconfig<libdir> ~ '/perl6/lib');
@search_paths.push(nqp::getcurhllsym('$PERL6_HOME') ~ '/lib');
# XXX CHEAT: Goes away when we implement :from<nqp>.
@search_paths.push(nqp::backendconfig<libdir> ~ '/nqp/lib');
# Keep share dir, moarvm has some files there
@search_paths.push(nqp::backendconfig<prefix> ~ '/share/nqp/lib');
@search_paths.push(nqp::getcurhllsym('$NQP_HOME') ~ '/lib');
@search_paths
}

0 comments on commit f20a2b6

Please sign in to comment.
You can’t perform that action at this time.