Permalink
Browse files

Move lgi._core from lgi.so into lgi.core from lgi/core.so

This setup is more natural for Lua module system, because it does not
shadow pure-Lua lgi.lua with lgi.so.
  • Loading branch information...
1 parent 3132434 commit 49e630701b214c03c96b0675d02695d9d762df97 @pavouk committed Nov 4, 2011
View
@@ -8,13 +8,14 @@ test -f ./devsetup.sh || {
build_dir=`pwd`/build
ext=.so; pfx=lib
test x`uname -o` != xCygwin || { ext=.dll; pfx=cyg; }
-test -x $build_dir/src/lgi${ext} && \
+test -x $build_dir/src/core${ext} && \
test -x $build_dir/tests/${pfx}regress${ext} && \
test -r $build_dir/tests/Regress-1.0.typelib || { \
echo 'LGI must be built first.'; return; }
# Create links from files to root 'build' dir.
-(cd $build_dir && ln -sf src/lgi${ext} && \
+(cd $build_dir && mkdir -p lgi && \
+ (cd lgi && ln -sf ../src/core${ext}) && \
ln -sf ../src/*.lua . && \
mkdir -p lgix && (cd lgix && ln -sf ../../src/lgix/* .) && \
ln -sf tests/${pfx}regress${ext} && \
View
@@ -443,7 +443,7 @@ static const struct luaL_reg lgi_reg[] = {
int lgi_addr_repo;
int
-luaopen_lgi__core (lua_State* L)
+luaopen_lgi_core (lua_State* L)
{
CallMutex *mutex;
@@ -484,7 +484,7 @@ luaopen_lgi__core (lua_State* L)
luaL_ref (L, LUA_REGISTRYINDEX); /* Keep thread fixed in registry forever. */
lua_rawset (L, LUA_REGISTRYINDEX);
- /* Register _core interface. */
+ /* Register 'lgi.core' interface. */
lua_newtable (L);
luaL_register (L, NULL, lgi_reg);
View
@@ -17,7 +17,7 @@ next, select =
local package, math = package, math
-- Require core lgi utilities, used during bootstrap.
-local core = require 'lgi._core'
+local core = require 'lgi.core'
-- Initialize GI wrapper from the core.
local gi = core.gi
View
@@ -10,7 +10,6 @@
local select, type, pairs = select, type, pairs
local lgi = require 'lgi'
-local core = require 'lgi._core'
local Clutter = lgi.Clutter
local GObject = lgi.GObject
@@ -10,7 +10,7 @@
local select, type, pairs, tostring = select, type, pairs, tostring
local lgi = require 'lgi'
-local core = require 'lgi._core'
+local core = require 'lgi.core'
local bytes = require 'bytes'
local gi = core.gi
local GLib = lgi.GLib
@@ -11,7 +11,7 @@
local type, pairs, ipairs, unpack = type, pairs, ipairs, unpack or table.unpack
-local core = require 'lgi._core'
+local core = require 'lgi.core'
local gi = core.gi
local repo = core.repo
@@ -10,7 +10,7 @@
local pairs = pairs
-local core = require 'lgi._core'
+local core = require 'lgi.core'
local gi = core.gi
local repo = core.repo
@@ -9,7 +9,7 @@
------------------------------------------------------------------------------
local assert, pairs, ipairs = assert, pairs, ipairs
-local core = require 'lgi._core'
+local core = require 'lgi.core'
local repo = core.repo
-- Add synthetic GObject.Type, containing well-known GType constants
@@ -10,7 +10,7 @@
local assert, pairs = assert, pairs
local lgi = require 'lgi'
-local core = require 'lgi._core'
+local core = require 'lgi.core'
local repo = core.repo
local gi = core.gi
local Type = repo.GObject.Type
View
@@ -10,7 +10,7 @@
local select, type, pairs, unpack = select, type, pairs, unpack
local lgi = require 'lgi'
-local core = require 'lgi._core'
+local core = require 'lgi.core'
local Gdk = lgi.Gdk
-- Gdk.Rectangle does not exist at all, beacuse it is aliased to
View
@@ -10,6 +10,5 @@
local select, type, pairs = select, type, pairs
local lgi = require 'lgi'
-local core = require 'lgi._core'
local Gio = lgi.Gio
local GObject = lgi.GObject
View
@@ -9,7 +9,7 @@
------------------------------------------------------------------------------
local lgi = require 'lgi'
-local gi = require('lgi._core').gi
+local gi = require('lgi.core').gi
local GLib = lgi.GLib
local Gst = lgi.Gst
View
@@ -10,8 +10,7 @@
local select, type, pairs, unpack = select, type, pairs, unpack
local lgi = require 'lgi'
-local core = require 'lgi._core'
-local gi = core.gi
+local core = require 'lgi.core'
local Gtk = lgi.Gtk
local Gdk = lgi.Gdk
local GObject = lgi.GObject
View
@@ -13,18 +13,17 @@ def apply_lua_so_name(self):
def build(bld):
bld(
features = 'c cshlib luaext',
-
source = ['core.c',
'gi.c',
'buffer.c',
'callable.c',
'marshal.c',
'record.c',
'object.c'],
- target = 'lgi',
+ target = 'core',
uselib = ['LUA', 'GI'],
cflags = bld.env.CCFLAGS,
- install_path = '${LUA_INSTALL_CMOD}',
+ install_path = '${LUA_INSTALL_CMOD}/lgi',
)
bld.install_files('${LUA_INSTALL_LMOD}/', 'lgi.lua')
bld.install_files('${LUA_INSTALL_LMOD}/lgix/',
View
@@ -9,7 +9,7 @@
--
------------------------------------------------------------------------------
-local lgi_core = require 'lgi._core'
+local lgi_core = require 'lgi.core'
local gi = lgi_core.gi
require 'debugger'

0 comments on commit 49e6307

Please sign in to comment.