Skip to content

Commit

Permalink
initial import
Browse files Browse the repository at this point in the history
  • Loading branch information
bastibe committed May 18, 2011
0 parents commit 621a9a6
Show file tree
Hide file tree
Showing 13 changed files with 1,833 additions and 0 deletions.
504 changes: 504 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions MANIFEST.in
@@ -0,0 +1,2 @@
recursive-include src *.c *.h
include MANIFEST.in python.lua LICENSE Makefile
25 changes: 25 additions & 0 deletions Makefile
@@ -0,0 +1,25 @@
#
# Simple wrapper for setup.py script
#

DESTDIR=/
PYTHON=python

prefix=/usr
bindir=$(prefix)/bin

all:
$(PYTHON) setup.py build

install:
$(PYTHON) setup.py install \
--root=$(DESTDIR) \
--prefix=$(prefix) \
--install-scripts=$(bindir)

dist:
$(PYTHON) setup.py sdist

rpm:
$(PYTHON) setup.py bdist_rpm

14 changes: 14 additions & 0 deletions PKG-INFO
@@ -0,0 +1,14 @@
Metadata-Version: 1.0
Name: lunatic-python
Version: 1.0
Summary: Two-way bridge between Python and Lua
Home-page: http://labix.org/lunatic-python
Author: Gustavo Niemeyer
Author-email: gustavo@niemeyer.net
License: LGPL
Description: Lunatic Python is a two-way bridge between Python and Lua, allowing these
languages to intercommunicate. Being two-way means that it allows Lua inside
Python, Python inside Lua, Lua inside Python inside Lua, Python inside Lua
inside Python, and so on.

Platform: UNKNOWN
6 changes: 6 additions & 0 deletions README
@@ -0,0 +1,6 @@
this is a fork of Lunatic Python, which can be found on the 'net at http://labix.org/lunatic-python.

Sadly, Lunatic Python is very much outdated and won't work with either a current Python or Lua.

This is an updated version of lunatic-python that works with Python 2.7 and Lua 5.1.
I tried contacting the original author of Lunatic Python, but got no response.
23 changes: 23 additions & 0 deletions python.lua
@@ -0,0 +1,23 @@
local path = os.getenv("LUA_SOPATH")
if path then
func = loadlib(path.."/lua-python.so", "luaopen_python")
if func then
func()
return
end
end
local modmask = "/usr/lib/python%d.%d/site-packages/lua-python.so"
local loaded = false
for i = 10, 2, -1 do
for j = 10, 2, -1 do
func = loadlib(string.format(modmask, i, j), "luaopen_python")
if func then
loaded = true
func()
break
end
end
end
if not loaded then
error("unable to find python module")
end
3 changes: 3 additions & 0 deletions setup.cfg
@@ -0,0 +1,3 @@
[bdist_rpm]
doc_files = python.lua LICENSE
use_bzip2 = 1
43 changes: 43 additions & 0 deletions setup.py
@@ -0,0 +1,43 @@
#!/usr/bin/python
from distutils.core import setup, Extension
from distutils.sysconfig import get_python_lib, get_python_version
import os

if os.path.isfile("MANIFEST"):
os.unlink("MANIFEST")

# You may have to change these
PYLIBS = ["python"+get_python_version(), "pthread", "util"]
PYLIBDIR = [get_python_lib(standard_lib=True)+"/config"]
LUALIBS = ["lua"]
LUALIBDIR = []

setup(name="lunatic-python",
version = "1.0",
description = "Two-way bridge between Python and Lua",
author = "Gustavo Niemeyer",
author_email = "gustavo@niemeyer.net",
url = "http://labix.org/lunatic-python",
license = "LGPL",
long_description =
"""\
Lunatic Python is a two-way bridge between Python and Lua, allowing these
languages to intercommunicate. Being two-way means that it allows Lua inside
Python, Python inside Lua, Lua inside Python inside Lua, Python inside Lua
inside Python, and so on.
""",
ext_modules = [
Extension("lua-python",
["src/pythoninlua.c", "src/luainpython.c"],
library_dirs=PYLIBDIR,
libraries=PYLIBS,
extra_compile_args=["-rdynamic"],
extra_link_args=["-rdynamic"]),
Extension("lua",
["src/pythoninlua.c", "src/luainpython.c"],
library_dirs=LUALIBDIR,
libraries=LUALIBS,
extra_compile_args=["-rdynamic"],
extra_link_args=["-rdynamic"]),
],
)

0 comments on commit 621a9a6

Please sign in to comment.