Skip to content

Commit

Permalink
Move lgi._core from lgi.so into lgi.core from lgi/core.so
Browse files Browse the repository at this point in the history
This setup is more natural for Lua module system, because it does not
shadow pure-Lua lgi.lua with lgi.so.
  • Loading branch information
pavouk committed Nov 4, 2011
1 parent 3132434 commit 49e6307
Show file tree
Hide file tree
Showing 15 changed files with 17 additions and 20 deletions.
5 changes: 3 additions & 2 deletions devsetup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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} && \
Expand Down
4 changes: 2 additions & 2 deletions src/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion src/lgi.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion src/lgix/Clutter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/lgix/GLib-Variant.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/lgix/GObject-Closure.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/lgix/GObject-Object.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/lgix/GObject-Type.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/lgix/GObject-Value.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/lgix/Gdk.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion src/lgix/Gio.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion src/lgix/Gst.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 1 addition & 2 deletions src/lgix/Gtk.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions src/wscript
Original file line number Diff line number Diff line change
Expand Up @@ -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/',
Expand Down
2 changes: 1 addition & 1 deletion tools/dump-typelib.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
--
------------------------------------------------------------------------------

local lgi_core = require 'lgi._core'
local lgi_core = require 'lgi.core'
local gi = lgi_core.gi
require 'debugger'

Expand Down

0 comments on commit 49e6307

Please sign in to comment.