Navigation Menu

Skip to content
This repository has been archived by the owner on Jun 9, 2018. It is now read-only.

Commit

Permalink
Hack for Parrot 1.0, in order to load external library.
Browse files Browse the repository at this point in the history
Currently, Parrot is not able to load languages/lua/library/*.pbc,
so libraries are put in library/lua/*.pbc
  • Loading branch information
fperrad committed Mar 16, 2009
1 parent d71495b commit 396ba52
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
6 changes: 4 additions & 2 deletions config/makefiles/root.in
Expand Up @@ -418,8 +418,10 @@ install: installable
$(CHMOD) 0755 $(BIN_DIR)/parrot-luap@exe@
-$(MKPATH) $(LIB_DIR)/languages/lua
$(CP) lua.pbc $(LIB_DIR)/languages/lua/lua.pbc
-$(MKPATH) $(LIB_DIR)/languages/lua/library
$(CP) library/*.pbc $(LIB_DIR)/languages/lua/library
# -$(MKPATH) $(LIB_DIR)/languages/lua/library
# $(CP) library/*.pbc $(LIB_DIR)/languages/lua/library
-$(MKPATH) $(LIB_DIR)/library/lua
$(CP) library/*.pbc $(LIB_DIR)/library/lua
-$(MKPATH) $(MANDIR)/man1
pod2man lua.pir > $(MANDIR)/man1/parrot-lua.1
pod2man luap.pir > $(MANDIR)/man1/parrot-luap.1
Expand Down
3 changes: 2 additions & 1 deletion src/lib/luapackage.pir
Expand Up @@ -65,7 +65,8 @@ LIST
_loaders[$P2] = loader_PBCroot

setpath(_package, 'path', 'LUA_PATH', './?.lua;languages/lua/src/lib/?.lua')
setpath(_package, 'pbcpath', 'LUA_PBCPATH', 'languages/lua/library/?.pbc;./?.pbc;./?.pir')
# setpath(_package, 'pbcpath', 'LUA_PBCPATH', 'languages/lua/library/?.pbc;./?.pbc;./?.pir')
setpath(_package, 'pbcpath', 'LUA_PBCPATH', 'languages/lua/library/?.pbc;lua/?.pbc;./?.pbc;./?.pir')

.local pmc _lua__REGISTRY
_lua__REGISTRY = get_hll_global '_REGISTRY'
Expand Down
4 changes: 2 additions & 2 deletions t/package.t
Expand Up @@ -284,7 +284,7 @@ print(type(package.pbcpath))
print(package.pbcpath)
CODE
string
languages/lua/library/?.pbc;./?.pbc;./?.pir
languages/lua/library/?.pbc;lua/?.pbc;./?.pbc;./?.pir
OUTPUT

$ENV{LUA_PBCPATH} = "?.pbc";
Expand All @@ -298,7 +298,7 @@ $ENV{LUA_PBCPATH} = ";;languages/lua/?.pbc";
language_output_is( 'lua', << 'CODE', << 'OUTPUT', 'table package.pbcpath' );
print(package.pbcpath)
CODE
;languages/lua/library/?.pbc;./?.pbc;./?.pir;languages/lua/?.pbc
;languages/lua/library/?.pbc;lua/?.pbc;./?.pbc;./?.pir;languages/lua/?.pbc
OUTPUT

delete $ENV{LUA_PBCPATH};
Expand Down

0 comments on commit 396ba52

Please sign in to comment.