--- luabind-0.7.orig/src/Makefile.am +++ luabind-0.7/src/Makefile.am @@ -0,0 +1,33 @@ +LIBTOOL = /usr/bin/libtool --tag=luabind + +AM_CPPFLAGS = \ + -O2 \ + -ftemplate-depth-100 \ + -I. -I.. -I/usr/include/lua50 + +AM_CFLAGS = \ + -Wall\ + -g + +AM_LDFLAGS = -lstdc++ -llua50 -llualib50 + +lib_LTLIBRARIES = \ + libluabind.la + +libluabind_la_SOURCES = \ + class.cpp \ + error.cpp \ + object_rep.cpp \ + scope.cpp \ + class_info.cpp \ + find_best_match.cpp \ + open.cpp \ + stack_content_by_name.cpp \ + class_registry.cpp function.cpp \ + overload_rep.cpp weak_ref.cpp \ + class_rep.cpp \ + implicit_cast.cpp \ + pcall.cpp \ + wrapper_base.cpp \ + create_class.cpp \ + link_compatibility.cpp ref.cpp --- luabind-0.7.orig/debian/changelog +++ luabind-0.7/debian/changelog @@ -0,0 +1,6 @@ +luabind (0.7-0ubuntu1) feisty; urgency=low + + * Initial release (LP: #94556) + * Added new libtool/auto-tools based build system + + -- Arthur Loiret Mon, 2 Apr 2007 16:46:04 +0200 --- luabind-0.7.orig/debian/compat +++ luabind-0.7/debian/compat @@ -0,0 +1 @@ +5 --- luabind-0.7.orig/debian/control +++ luabind-0.7/debian/control @@ -0,0 +1,75 @@ +Source: luabind +Priority: optional +XSBC-Original-Maintainer: Arthur Loiret +Maintainer: Ubuntu MOTU Developers +Build-Depends: debhelper (>= 5), autotools-dev, autoconf, automake, libtool, liblua50-dev, liblualib50-dev, libboost-dev, libboost-python-dev +Standards-Version: 3.7.2 +Section: libs + +Package: libluabind-doc +Section: doc +Architecture: all +Recommends: libluabind0 +Description: luabind c++ binding for lua: documentation files + Luabind is a library that helps you create bindings between C++ and Lua. + It has the ability to expose functions and classes, written in C++, to + Lua. It will also supply the functionality to define classes in lua and + let them derive from other lua classes or C++ classes. Lua classes can + override virtual functions from their C++ baseclasses. It is written + towards Lua 5.x, and does not work with Lua 4. + . + This package contains the luabind runtime libraries, for applications that + have been built with luabind. + . + Luabind is released under the terms of the MIT license. + +Package: libluabind-examples +Section: libdevel +Architecture: all +Recommends: libluabind0 +Description: luabind c++ binding for lua: examples files + Luabind is a library that helps you create bindings between C++ and Lua. + It has the ability to expose functions and classes, written in C++, to + Lua. It will also supply the functionality to define classes in lua and + let them derive from other lua classes or C++ classes. Lua classes can + override virtual functions from their C++ baseclasses. It is written + towards Lua 5.x, and does not work with Lua 4. + . + This package contains the luabind runtime libraries, for applications that + have been built with luabind. + . + Luabind is released under the terms of the MIT license. + +Package: libluabind-dev +Section: libdevel +Architecture: any +Depends: libluabind0 (= ${Source-Version}), liblua50-dev, liblualib50-dev, libboost-dev, libboost-python-dev +Description: luabind c++ binding for lua: static library and headers + Luabind is a library that helps you create bindings between C++ and Lua. + It has the ability to expose functions and classes, written in C++, to + Lua. It will also supply the functionality to define classes in lua and + let them derive from other lua classes or C++ classes. Lua classes can + override virtual functions from their C++ baseclasses. It is written + towards Lua 5.x, and does not work with Lua 4. + . + This package contains the luabind runtime libraries, for applications that + have been built with luabind. + . + Luabind is released under the terms of the MIT license. + +Package: libluabind0 +Section: libs +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: luabind c++ binding for lua: runtime library + Luabind is a library that helps you create bindings between C++ and Lua. + It has the ability to expose functions and classes, written in C++, to + Lua. It will also supply the functionality to define classes in lua and + let them derive from other lua classes or C++ classes. Lua classes can + override virtual functions from their C++ baseclasses. It is written + towards Lua 5.x, and does not work with Lua 4. + . + This package contains all files necessary to develop applications which + use luabind. + . + Luabind is released under the terms of the MIT license. --- luabind-0.7.orig/debian/copyright +++ luabind-0.7/debian/copyright @@ -0,0 +1,41 @@ +This package was debianized by Arthur Loiret on +Sat, 10 Mar 2007 22:36:17 +0100. + +It was downloaded from http://www.rasterbar.com/products/luabind.html + +Upstream Author: Daniel Wallin + Arvid Norberg + +Copyright (C) 2005 Rasterbar Software + (C) 2003 Daniel Wallin, Arvid Norberg + (C) 1994-2003 Tecgraf, PUC-Rio. All rights reserved. + src/ref.cpp + src/weak_ref.cpp + doc/docs.html + doc/docs.rst + doc/out_value.rst + doc/pure_out_value.rst + +License: + + Permission is hereby granted, free of charge, to any person obtaining a copy of + this software and associated documentation files (the "Software"), to deal in + the Software without restriction, including without limitation the rights to + use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies + of the Software, and to permit persons to whom the Software is furnished to do + so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + + +The Debian packaging is (C) 2007, Arthur Loiret and +is licensed under the GPL, see `/usr/share/common-licenses/GPL'. --- luabind-0.7.orig/debian/rules +++ luabind-0.7/debian/rules @@ -0,0 +1,86 @@ +#!/usr/bin/make -f + +#export DH_VERBOSE=1 + +CFLAGS = -Wall -g + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif + +configure: configure-stamp +configure-stamp: + dh_testdir + # Add here commands to configure the package. + touch NEWS README AUTHORS ChangeLog + aclocal + autoconf + automake -a -f + ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info CFLAGS="$(CFLAGS)" LDFLAGS="-Wl,-z,defs" + + touch configure-stamp + +build: build-stamp + +build-stamp: configure-stamp + dh_testdir + + # Add here commands to compile the package. + rm -f makefile src/makefile + $(MAKE) + + touch $@ + +clean: + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp + + rm -rf aclocal.m4 autom4te.cache/ configure NEWS README AUTHORS ChangeLog COPYING depcomp install-sh missing config.status Makefile Makefile.in src/Makefile src/Makefile.in + # Add here commands to clean up after the build process. + -$(MAKE) clean + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + # Add here commands to install the package into debian/luabind. + $(MAKE) install DESTDIR=$(CURDIR)/debian/luabind + find . -type f -name "*.cpp" -or -name "*.hpp" | xargs chmod 666 + find . -type f -name "Jamfile" -or -name "*.jam" -or -name "makefile" | xargs rm -f + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot + dh_installchangelogs + dh_installdocs debian/copyright + dh_installdocs -p libluabind-doc doc/* + mv debian/libluabind-doc/usr/share/doc/libluabind-doc/changes.txt \ + debian/libluabind-doc/usr/share/doc/libluabind-doc/changelog && \ + gzip -9 debian/libluabind-doc/usr/share/doc/libluabind-doc/changelog + dh_installexamples -p libluabind-examples debian/examples/* + dh_install + dh_link + dh_strip + dh_compress + dh_fixperms + dh_makeshlibs + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure --- luabind-0.7.orig/debian/examples/hello_world/hello_world.cpp +++ luabind-0.7/debian/examples/hello_world/hello_world.cpp @@ -0,0 +1,51 @@ +// Copyright (c) 2005 Daniel Wallin and Arvid Norberg + +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: + +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. + +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +// ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +// SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR +// ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE +// OR OTHER DEALINGS IN THE SOFTWARE. + +extern "C" +{ + #include "lua.h" + #include "lualib.h" + #include "lauxlib.h" +} + +#include +#include + +void greet() +{ + std::cout << "hello world!\n"; +} + +extern "C" int init(lua_State* L) +{ + using namespace luabind; + + open(L); + + module(L) + [ + def("greet", &greet) + ]; + + return 0; +} + --- luabind-0.7.orig/debian/examples/hello_world/Makefile +++ luabind-0.7/debian/examples/hello_world/Makefile @@ -0,0 +1,12 @@ +all: hello_world + +CPPFLAGS = -I/usr/include/lua50 -I/usr/include/luabind/ \ + -I/sw/include -L/sw/lib + +hello_world: hello_world.cpp + g++ $(CPPFLAGS) -c hello_world.cpp + g++ -shared -o hello_world.so hello_world.o -llua50 -llualib50 -lluabind + +clean: + rm -f *.o *.so *~ + --- luabind-0.7.orig/debian/examples/hello_world/README +++ luabind-0.7/debian/examples/hello_world/README @@ -0,0 +1,9 @@ +this example will build an extension module as a shared library, use +loadlib() from within the lua interpreter to load the library, it will +then export a function named greet() which you can call. + +$ lua +> loadlib('./hello_world.so', 'init')() +> greet() +Hello world! +> --- luabind-0.7.orig/debian/examples/glut/glut_bind.cpp +++ luabind-0.7/debian/examples/glut/glut_bind.cpp @@ -0,0 +1,182 @@ +extern "C" +{ + #include "lua.h" + #include "lauxlib.h" + #include "lualib.h" +} + +#include +#include +#include +#include + + +#include +#include +#include + +struct glut_constants {}; +struct gl_constants {}; + +using luabind::object; + +namespace glut_bindings +{ + object displayfunc; + + void displayfunc_callback() + { + displayfunc(); + } + + void set_displayfunc(object const& fun) + { + glutDisplayFunc(&displayfunc_callback); + displayfunc = fun; + } + + object idlefunc; + + void idlefunc_callback() + { + idlefunc(); + } + + void set_idlefunc(object const& fun) + { + glutIdleFunc(&idlefunc_callback); + idlefunc = fun; + } + + + object reshapefunc; + + void reshapefunc_callback(int w, int h) + { + reshapefunc(w, h); + } + + void set_reshapefunc(object const& fun) + { + reshapefunc = fun; + } + + object keyboardfunc; + + void keyboardfunc_callback(unsigned char key, int x, int y) + { + keyboardfunc(key, x, y); + } + + void set_keyboardfunc(object const& fun) + { + glutKeyboardFunc(&keyboardfunc_callback); + keyboardfunc = fun; + } + + object mousefunc; + + void mousefunc_callback(int button, int state, int x, int y) + { + mousefunc(button, state, x, y); + } + + void set_mousefunc(object const& fun) + { + mousefunc = fun; + } +} + +void bind_glut(lua_State* L) +{ + using namespace luabind; + using namespace glut_bindings; + + open(L); + + module(L) + [ + def("glutInitWindowSize", &glutInitWindowSize), + def("glutInitWindowPosition", &glutInitWindowPosition), + def("glutInitDisplayMode", &glutInitDisplayMode), + + class_("glut") + .enum_("constants") + [ + value("RGB", GLUT_RGB), + value("RGBA", GLUT_RGBA), + value("INDEX", GLUT_INDEX), + value("SINGLE", GLUT_SINGLE), + value("DOUBLE", GLUT_DOUBLE), + value("DEPTH", GLUT_DEPTH), + value("STENCIL", GLUT_STENCIL), + value("LEFT_BUTTON", GLUT_LEFT_BUTTON), + value("MIDDLE_BUTTON", GLUT_MIDDLE_BUTTON), + value("RIGHT_BUTTON", GLUT_RIGHT_BUTTON), + value("UP", GLUT_UP), + value("DOWN", GLUT_DOWN), + value("ELAPSED_TIME", GLUT_ELAPSED_TIME) + ], + + def("glutCreateWindow", &glutCreateWindow), + def("glutDestroyWindow", &glutDestroyWindow), + def("glutFullScreen", &glutFullScreen), + def("glutDisplayFunc", &set_displayfunc), + def("glutKeyboardFunc", &set_keyboardfunc), + def("glutReshapeFunc", &set_reshapefunc), + def("glutIdleFunc", &set_idlefunc), + def("glutMainLoop", &glutMainLoop), + def("glutSwapBuffers", &glutSwapBuffers), + def("glutGet", &glutGet), + def("glutSolidSphere", &glutSolidSphere), + def("glutWireSphere", &glutWireSphere), + def("glutWireTeapot", &glutWireTeapot), + def("glutSolidTeapot", &glutSolidTeapot), + + // -- opengl + + class_("gl") + .enum_("constants") + [ + value("COLOR_BUFFER_BIT", GL_COLOR_BUFFER_BIT), + value("DEPTH_BUFFER_BIT", GL_DEPTH_BUFFER_BIT), + value("TRIANGLES", GL_TRIANGLES), + value("MODELVIEW", GL_MODELVIEW), + value("PROJECTION", GL_PROJECTION) + ], + + def("glBegin", &glBegin), + def("glVertex3", &glVertex3f), + def("glEnd", &glEnd), + def("glClear", &glClear), + def("glPushMatrix", &glPushMatrix), + def("glPopMatrix", &glPopMatrix), + def("glRotate", &glRotatef), + def("glColor3", &glColor3f), + def("glColor4", &glColor4f), + def("glMatrixMode", &glMatrixMode), + def("glLoadIdentity", &glLoadIdentity), + def("glViewport", &glViewport), + def("glTranslate", &glTranslatef), + + // -- glu + + def("gluPerspective", &gluPerspective) + ]; +} + +int main(int argc, char* argv[]) +{ + lua_State* L = lua_open(); + lua_baselibopen(L); + lua_mathlibopen(L); + bind_glut(L); + + glutInit (&argc, argv); + + lua_dofile(L, "./glut_bind.lua"); + + lua_close(L); + return 0; +} + --- luabind-0.7.orig/debian/examples/glut/Makefile +++ luabind-0.7/debian/examples/glut/Makefile @@ -0,0 +1,12 @@ +all: glut_bind + +CPPFLAGS = -I/usr/include/lua50 -I/usr/include/luabind/ \ + -I/sw/include -L/sw/lib + +glut_bind: glut_bind.cpp + g++ $(CPPFLAGS) -c glut_bind.cpp + g++ -o glut_bind glut_bind.o -lGL -lGLU -lglut -llua50 -llualib50 -lluabind + +clean: + rm -f glut_bind *.o *.so *~ + --- luabind-0.7.orig/debian/examples/glut/README +++ luabind-0.7/debian/examples/glut/README @@ -0,0 +1,5 @@ +this example shoes how to wrap C/C++ functions in a lua file, build with make +and execute with ./glut_bind. An openGL window should open. + +$ make +$ ./glut_bind --- luabind-0.7.orig/debian/examples/glut/glut_bind.lua +++ luabind-0.7/debian/examples/glut/glut_bind.lua @@ -0,0 +1,79 @@ +quit = false + +function resize_func(w, h) + local ratio = w / h + + print('====== resize') + + glMatrixMode(gl.PROJECTION) + glLoadIdentity() + + glViewport(0,0,w,h) + + gluPerspective(45,ratio,1,1000) + + glMatrixMode(gl.MODELVIEW) + glLoadIdentity() +end + +angle = 0 +angle2 = 0 +previous_time = 0 + +function display_func() + + if quit then return end + + local cur_time = glutGet(glut.ELAPSED_TIME) + local delta = (cur_time - previous_time) / 1000 + previous_time = cur_time + + glClear(gl.COLOR_BUFFER_BIT + gl.DEPTH_BUFFER_BIT) + + glPushMatrix() + + glTranslate(0,0,-5) + glRotate(angle, 0, 1, 0) + glRotate(angle2, 0, 0, 1) + glColor3(1,0,0) +-- glutWireSphere(0.75, 10, 10) + glutSolidTeapot(0.75) +-- glColor3(1,1,1) +-- glutWireTeapot(0.75) + + glPopMatrix() + + angle = angle + 200 * delta + angle2 = angle2 + 170 * delta + + frames = frames + 1 + + if math.mod(frames, 100) == 0 then + local fps = frames * 1000 / (glutGet(glut.ELAPSED_TIME) - start_time); + print('fps: ' .. fps .. ' time: ' .. glutGet(glut.ELAPSED_TIME) .. ' frames: ' .. frames) + end + + glutSwapBuffers() +end + +function keyboard_func(key,x,y) + print('keyboard' .. key) + if key == 27 then glutDestroyWindow(window) quit = true end +end + +glutInitWindowSize(600,600) +glutInitWindowPosition(0,0) +glutInitDisplayMode(glut.RGB + glut.DOUBLE + glut.DEPTH) +window = glutCreateWindow("luabind, glut-bindings") +glutDisplayFunc(display_func) +glutIdleFunc(display_func) +glutKeyboardFunc(keyboard_func) +glutReshapeFunc(resize_func) + +resize_func(600,600) + +start_time = glutGet(glut.ELAPSED_TIME) +frames = 0 + +glutMainLoop() + --- luabind-0.7.orig/debian/libluabind0.install +++ luabind-0.7/debian/libluabind0.install @@ -0,0 +1,2 @@ +debian/luabind/usr/lib/libluabind.so.0 /usr/lib/ +debian/luabind/usr/lib/libluabind.so.0.0.0 /usr/lib/ --- luabind-0.7.orig/debian/watch +++ luabind-0.7/debian/watch @@ -0,0 +1,2 @@ +version=3 +http://qa.debian.org/watch/sf.php?project=luabind luabind-(.*).zip --- luabind-0.7.orig/debian/libluabind-dev.install +++ luabind-0.7/debian/libluabind-dev.install @@ -0,0 +1,6 @@ +debian/luabind/usr/lib/libluabind.so /usr/lib/ + +debian/luabind/usr/lib/libluabind.a /usr/lib/ +debian/luabind/usr/lib/libluabind.la /usr/lib/ + +luabind/* usr/include/luabind/ --- luabind-0.7.orig/Makefile.am +++ luabind-0.7/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = src --- luabind-0.7.orig/configure.ac +++ luabind-0.7/configure.ac @@ -0,0 +1,13 @@ +AC_PREREQ(2.60) + +AC_INIT(luabind, 0.7, freacky22527@free.fr) + +AM_INIT_AUTOMAKE + +AC_PROG_CXX +AC_PROG_RANLIB +AC_PROG_MAKE_SET + +AC_CONFIG_FILES([Makefile src/Makefile]) + +AC_OUTPUT