Merge lp:~michel-slm/lunatic-python/trunk into lp:lunatic-python

Proposed by Michel Lind
Status: Needs review
Proposed branch: lp:~michel-slm/lunatic-python/trunk
Merge into: lp:lunatic-python
Diff against target: 63 lines (+20/-7)
3 files modified
.bzrignore (+3/-0)
setup.py (+15/-4)
src/luainpython.c (+2/-3)
To merge this branch: bzr merge lp:~michel-slm/lunatic-python/trunk
Reviewer Review Type Date Requested Status
Gustavo Niemeyer Needs Fixing
Review via email: mp+12019@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Michel Lind (michel-slm) wrote :

I created two separate changes, and committed them separately for easy merging:
revno 8: make setup.py use pkg-config. I defaulted to using lua.pc, as that is the upstream name,
  but this is overridden by setting the environment variable LUAPCNAME
revno 9: switch fully to the Lua 5.1 API; drop lua_open.

Looks like some other branches have diverged even further; I will look into what they are doing next. Would be nice to merge in some lunit tests.

lp:~michel-slm/lunatic-python/trunk updated
10. By Michel Lind

Merge niemeyer's revision 8: fix number conversion

Revision history for this message
Gustavo Niemeyer (niemeyer) wrote :

Thanks for the changes. The modifications about lua_open look good.

The changes to use pkg-config add boilerplate and in the end
turn setup.py into something that actually doesn't work out of
the box unless an environment variable is set.

I'm happy to integrate the former, but I'd like to keep the
latter simple as it currently is if you don't mind.

Can you please separate it out?

review: Needs Fixing

Unmerged revisions

10. By Michel Lind

Merge niemeyer's revision 8: fix number conversion

9. By Michel Lind

luainpython.c:
  fully switch to Lua 5.1 API; drop deprecated lua_open

8. By Michel Lind

setup.py:
  use pkg-config to discover Lua installation if possible
  fallback to upstream Lua's defaults
.bzrignore:
  ignore build directory and common temporary files

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added file '.bzrignore'
--- .bzrignore 1970-01-01 00:00:00 +0000
+++ .bzrignore 2011-03-30 23:06:50 +0000
@@ -0,0 +1,3 @@
1./build
2*#*#
3*~
04
=== modified file 'setup.py'
--- setup.py 2008-05-28 15:48:32 +0000
+++ setup.py 2011-03-30 23:06:50 +0000
@@ -1,8 +1,8 @@
1#!/usr/bin/python1#!/usr/bin/python
2from distutils.core import setup, Extension2from distutils.core import setup, Extension
3from distutils.sysconfig import get_python_lib, get_python_version3from distutils.sysconfig import get_python_lib, get_python_version
4import glob
5import os4import os
5import commands
66
7if os.path.isfile("MANIFEST"):7if os.path.isfile("MANIFEST"):
8 os.unlink("MANIFEST")8 os.unlink("MANIFEST")
@@ -10,10 +10,21 @@
10# You may have to change these10# You may have to change these
11PYLIBS = ["python"+get_python_version(), "pthread", "util"]11PYLIBS = ["python"+get_python_version(), "pthread", "util"]
12PYLIBDIR = [get_python_lib(standard_lib=True)+"/config"]12PYLIBDIR = [get_python_lib(standard_lib=True)+"/config"]
13#LUALIBS = ["lua", "lualib"]13LUAPCNAME = os.getenv("LUAPCNAME")
14LUALIBS = ["lua5.1"]14LUALIBS=["lua"]
15LUALIBDIR = []15LUALIBDIR = []
16LUAINCDIR = glob.glob("/usr/include/lua*")16LUAINCDIR=["/usr/include"]
17if not LUAPCNAME:
18 PKGBASE='pkg-config lua '
19else:
20 PKGBASE='pkg-config %s ' % (LUAPCNAME,)
21status, output = commands.getstatusoutput(PKGBASE + '--exists')
22if status == 0:
23 LUALIBS = [os.popen(PKGBASE + '--libs').readline().split()[0][2:]]
24 LUALIBDIR = [os.popen(PKGBASE + '--variable=libdir').readline().strip()]
25 LUAINCDIR = [os.popen(PKGBASE + '--variable=includedir').readline().strip()]
26else:
27 print "*** WARN *** lua .pc file not found -- using defaults"
1728
18setup(name="lunatic-python",29setup(name="lunatic-python",
19 version = "1.0",30 version = "1.0",
2031
=== modified file 'src/luainpython.c'
--- src/luainpython.c 2010-03-29 21:13:32 +0000
+++ src/luainpython.c 2011-03-30 23:06:50 +0000
@@ -486,10 +486,9 @@
486 m = Py_InitModule("lua", lua_methods);486 m = Py_InitModule("lua", lua_methods);
487487
488 if (!L) {488 if (!L) {
489 L = lua_open();489 L = luaL_newstate();
490 luaopen_base(L);490 luaL_openlibs(L);
491 luaopen_python(L);491 luaopen_python(L);
492 luaL_openlibs(L);
493 lua_settop(L, 0);492 lua_settop(L, 0);
494 }493 }
495}494}

Subscribers

People subscribed via source and target branches

to all changes: