Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Clean up default INC paths and install CORE distribution
We install the modules that come with rakudo itself as a CORE distribution
into a CompUnit::Repository::Installation. No more need to manually precompile
modules in the Makefile
  • Loading branch information
niner committed Nov 21, 2015
1 parent 3c814de commit 4291711
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 34 deletions.
9 changes: 3 additions & 6 deletions src/core/Inc.pm
Expand Up @@ -75,17 +75,14 @@ RAKUDO_MODULE_DEBUG("Init @INC with {specs}")
// (%ENV<HOMEDRIVE> // '') ~ (%ENV<HOMEPATH> // '') -> $home {
my $ver := nqp::p6box_s(nqp::atkey($compiler, 'version'));
my $path := "$home/.perl6/$ver";
@INC.append: "file#$path/lib", "inst#$path";
@INC.append: "inst#$path";
%CUSTOM_LIB<home> = $path;
}
}
@INC.append:
"file#$prefix/lib",
"file#$prefix/vendor/lib",
"file#$prefix/site/lib",
"inst#$prefix",
"inst#$prefix/site",
"inst#$prefix/vendor",
"inst#$prefix/site";
"inst#$prefix";

%CUSTOM_LIB<perl> = $prefix;
%CUSTOM_LIB<vendor> = "$prefix/vendor";
Expand Down
16 changes: 1 addition & 15 deletions tools/build/Makefile-JVM.in
Expand Up @@ -407,23 +407,9 @@ j-install: j-all tools/build/create-jvm-runner.pl
$(CP) $(PERL6_JAR) $(DESTDIR)$(PERL6_LANG_DIR)/runtime
$(CP) $(PERL6_DEBUG_JAR) $(DESTDIR)$(PERL6_LANG_DIR)/runtime
$(CP) $(RUNTIME_JAR) $(DESTDIR)$(PERL6_LANG_DIR)/runtime
$(CP) lib/NativeCall.pm $(DESTDIR)$(PERL6_LANG_DIR)/lib
$(CP) lib/NativeCall.pm.jar $(DESTDIR)$(PERL6_LANG_DIR)/lib
$(MKPATH) $(DESTDIR)$(PERL6_LANG_DIR)/lib/NativeCall
$(CP) lib/NativeCall/Types.pm $(DESTDIR)$(PERL6_LANG_DIR)/lib/NativeCall
$(CP) lib/NativeCall/Types.pm.jar $(DESTDIR)$(PERL6_LANG_DIR)/lib/NativeCall
$(MKPATH) $(DESTDIR)$(PERL6_LANG_DIR)/lib/NativeCall/Compiler
$(CP) lib/NativeCall/Compiler/GNU.pm $(DESTDIR)$(PERL6_LANG_DIR)/lib/NativeCall/Compiler
$(CP) lib/NativeCall/Compiler/GNU.pm.jar $(DESTDIR)$(PERL6_LANG_DIR)/lib/NativeCall/Compiler
$(CP) lib/NativeCall/Compiler/MSVC.pm $(DESTDIR)$(PERL6_LANG_DIR)/lib/NativeCall/Compiler
$(CP) lib/NativeCall/Compiler/MSVC.pm.jar $(DESTDIR)$(PERL6_LANG_DIR)/lib/NativeCall/Compiler
$(CP) lib/Test.pm $(DESTDIR)$(PERL6_LANG_DIR)/lib
$(CP) lib/Test.pm.jar $(DESTDIR)$(PERL6_LANG_DIR)/lib
.@slash@$(J_RUNNER) tools/build/install-core-dist.pl
$(CP) lib/newline.pm6 $(DESTDIR)$(PERL6_LANG_DIR)/lib
$(CP) lib/newline.pm6.jar $(DESTDIR)$(PERL6_LANG_DIR)/lib
$(MKPATH) $(DESTDIR)$(PERL6_LANG_DIR)/lib/Pod/To
$(CP) lib/Pod/To/Text.pm $(DESTDIR)$(PERL6_LANG_DIR)/lib/Pod/To
$(CP) lib/Pod/To/Text.pm.jar $(DESTDIR)$(PERL6_LANG_DIR)/lib/Pod/To
$(PERL) tools/build/create-jvm-runner.pl install "$(DESTDIR)" $(PREFIX) $(NQP_PREFIX) $(NQP_JARS)
$(PERL) tools/build/create-jvm-runner.pl install-debug "$(DESTDIR)" $(PREFIX) $(NQP_PREFIX) $(NQP_JARS)

Expand Down
14 changes: 1 addition & 13 deletions tools/build/Makefile-Moar.in
Expand Up @@ -260,19 +260,7 @@ m-install: m-all tools/build/create-moar-runner.pl
$(CP) $(PERL6_MOAR) $(PERL6_DEBUG_MOAR) $(DESTDIR)$(PERL6_LANG_DIR)/runtime
$(MKPATH) $(DESTDIR)$(PERL6_LANG_DIR)/runtime/dynext
$(CP) $(M_PERL6_OPS_DLL) $(DESTDIR)$(PERL6_LANG_DIR)/runtime/dynext
$(CP) lib/NativeCall.pm lib/Test.pm lib/newline.pm6 $(DESTDIR)$(PERL6_LANG_DIR)/lib
$(CP) lib/NativeCall.pm.moarvm lib/Test.pm.moarvm lib/newline.pm6.moarvm $(DESTDIR)$(PERL6_LANG_DIR)/lib
$(MKPATH) $(DESTDIR)$(PERL6_LANG_DIR)/lib/NativeCall
$(CP) lib/NativeCall/Types.pm $(DESTDIR)$(PERL6_LANG_DIR)/lib/NativeCall
$(CP) lib/NativeCall/Types.pm.moarvm $(DESTDIR)$(PERL6_LANG_DIR)/lib/NativeCall
$(MKPATH) $(DESTDIR)$(PERL6_LANG_DIR)/lib/NativeCall/Compiler
$(CP) lib/NativeCall/Compiler/GNU.pm $(DESTDIR)$(PERL6_LANG_DIR)/lib/NativeCall/Compiler
$(CP) lib/NativeCall/Compiler/GNU.pm.moarvm $(DESTDIR)$(PERL6_LANG_DIR)/lib/NativeCall/Compiler
$(CP) lib/NativeCall/Compiler/MSVC.pm $(DESTDIR)$(PERL6_LANG_DIR)/lib/NativeCall/Compiler
$(CP) lib/NativeCall/Compiler/MSVC.pm.moarvm $(DESTDIR)$(PERL6_LANG_DIR)/lib/NativeCall/Compiler
$(MKPATH) $(DESTDIR)$(PERL6_LANG_DIR)/lib/Pod/To
$(CP) lib/Pod/To/Text.pm $(DESTDIR)$(PERL6_LANG_DIR)/lib/Pod/To
$(CP) lib/Pod/To/Text.pm.moarvm $(DESTDIR)$(PERL6_LANG_DIR)/lib/Pod/To
.@slash@$(M_RUNNER) tools/build/install-core-dist.pl
$(PERL) tools/build/create-moar-runner.pl "$(MOAR)" perl6.moarvm $(DESTDIR)$(PREFIX)/bin/perl6-m "$(PERL6_LANG_DIR)/runtime" "" "$(M_LIBPATH)" "$(PERL6_LANG_DIR)/lib" "$(PERL6_LANG_DIR)/runtime"
$(PERL) tools/build/create-moar-runner.pl "$(MOAR)" perl6-debug.moarvm $(DESTDIR)$(PREFIX)/bin/perl6-debug-m "$(PERL6_LANG_DIR)/runtime" "" "$(M_LIBPATH)" "$(PERL6_LANG_DIR)/lib" "$(PERL6_LANG_DIR)/runtime"
$(CHMOD) 755 $(DESTDIR)$(PREFIX)/bin/perl6-m$(M_BAT)
Expand Down
30 changes: 30 additions & 0 deletions tools/build/install-core-dist.pl
@@ -0,0 +1,30 @@
use lib "inst#repo";
my $v = run("git", "describe", :out).out.lines[0];
$v //= $*PERL6.version;

my %provides =
"Test" => "lib/Test.pm",
"NativeCall" => "lib/NativeCall.pm",
"NativeCall::Types" => "lib/NativeCall/Types.pm",
"NativeCall::Compiler::GNU" => "lib/NativeCall/Compiler/GNU.pm",
"NativeCall::Compiler::MSVC" => "lib/NativeCall/Compiler/MSVC.pm",
"Pod::To::Text" => "lib/Pod/To/Text.pm",
;

$*REPO.repo-chain[* - 1].install(
dist => class :: {
method metainfo() {
{
name => "CORE",
auth => "perl",
ver => $v.Str,
provides => %provides,
}
}
}.new,
|%provides.values,
);

note "installed!";

# vim: ft=perl6

0 comments on commit 4291711

Please sign in to comment.