From 3fc764005b9a40e9d378871fd85ef35876e63a2d Mon Sep 17 00:00:00 2001 From: Florian Boor Date: Tue, 16 May 2006 09:54:54 +0000 Subject: lua-gtk2: Add GTK bindings for LUA. --- packages/lua/lua-gtk2/.mtn2git_empty | 0 packages/lua/lua-gtk2/lua-gtk2-0.3_fixbuild.patch | 352 ++++++++++++++++++++++ packages/lua/lua-gtk2_0.3.bb | 24 ++ 3 files changed, 376 insertions(+) create mode 100644 packages/lua/lua-gtk2/.mtn2git_empty create mode 100644 packages/lua/lua-gtk2/lua-gtk2-0.3_fixbuild.patch create mode 100644 packages/lua/lua-gtk2_0.3.bb (limited to 'packages') diff --git a/packages/lua/lua-gtk2/.mtn2git_empty b/packages/lua/lua-gtk2/.mtn2git_empty new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/lua/lua-gtk2/lua-gtk2-0.3_fixbuild.patch b/packages/lua/lua-gtk2/lua-gtk2-0.3_fixbuild.patch new file mode 100644 index 0000000000..1115b6ffb6 --- /dev/null +++ b/packages/lua/lua-gtk2/lua-gtk2-0.3_fixbuild.patch @@ -0,0 +1,352 @@ +diff -NbBur lua-gtk2-0.3_orig/configure lua-gtk2-0.3/configure +--- lua-gtk2-0.3_orig/configure 2005-08-16 19:32:07.000000000 +0200 ++++ lua-gtk2-0.3/configure 2006-05-14 02:52:39.000000000 +0200 +@@ -2,25 +2,19 @@ + + # examine system + +-CFLAGS="$(pkg-config gtk+-2.0 --cflags) $(pkg-config lua50 --cflags) -I build-linux -I src" ++CFLAGS="-g -Wall -DLINUX -Os -fomit-frame-pointer -Wall $(pkg-config gtk+-2.0 --cflags) $(pkg-config lua50 --cflags) -I build-linux -I src" + VERSION="0.3" +- +-if which gcc-4.0 > /dev/null; then +- GCC=gcc-4.0 +-elif which gcc > /dev/null; then +- GCC=gcc +-else +- @echo "No GCC found." +- exit 1 +-fi +- +-if true; then +- CFLAGS2="-DLINUX" +- LIBS="" # -lgtk-x11-2.0" +-else +- CFLAGS2="-DWIN32" +- LIBS="" +-fi ++PREFIX="/usr/local" ++GCC=arm-linux-gcc ++HGCC=gcc ++ ++#if true; then ++# CFLAGS2="-DLINUX" ++# LIBS="" # -lgtk-x11-2.0" ++#else ++# CFLAGS2="-DWIN32" ++# LIBS="" ++#fi + + + # build makefile +@@ -28,13 +22,14 @@ + cat > Makefile < /dev/null; then ++ GCC=gcc-4.0 ++elif which gcc > /dev/null; then ++ GCC=gcc ++else ++ @echo "No GCC found." ++ exit 1 ++fi ++ ++if true; then ++ CFLAGS2="-DLINUX" ++ LIBS="" # -lgtk-x11-2.0" ++else ++ CFLAGS2="-DWIN32" ++ LIBS="" ++fi ++ ++ ++# build makefile ++ ++cat > Makefile < \$@ ++ ++data/gtkdata.structs.c: ++ (cd data; ../script/gen-list.pl) ++ ++build-linux/%.o: build-linux/%.c ++ @echo \$@ ++ @\${CC} \${CFLAGS} -c -o \$@ \$< ++ ++build-linux/%.o: src/%.c ++ @echo \$@ ++ @\${CC} \${CFLAGS} -c -o \$@ \$< ++ ++build-linux/%.s: src/%.c ++ @echo \$@ ++ @\${CC} \${CFLAGS} -S -o \$@ \$< ++ ++build-linux/%.luac: src/%.lua ++ @echo \$@ ++ @luac -s -o \$@ \$< ++ ++clean: ++ rm -f \${ODIR}libluagtk2.so \${ODIR}generate \${ODIR}_*.c \${ODIR}*.o ++ rm -f \${ODIR}file2c \${ODIR}override.luac \${ODIR}main ++ ++install: all ++ mkdir -p ~/.lua50 ++ cp gtk2.lua ~/.lua50 ++ ln -sf \$(PWD)/build-linux/libluagtk2.so ~/.lua50 ++ ++tar: ++ (cd ..; ln -s lua-gtk2 lua-gtk2-\${VERSION}; tar czvhf lua-gtk2-\${VERSION}.tar.gz \\ ++ lua-gtk2-\${VERSION} --exclude old --exclude "build-*" --exclude foreign --exclude lua50 \\ ++ --exclude test-dll; rm lua-gtk2-\${VERSION}) ++ ++EOF ++ ++mkdir -p build-linux build-win32 ++ +diff -NbBur lua-gtk2-0.3_orig/gtk2.lua lua-gtk2-0.3/gtk2.lua +--- lua-gtk2-0.3_orig/gtk2.lua 2005-08-16 19:26:14.000000000 +0200 ++++ lua-gtk2-0.3/gtk2.lua 1970-01-01 01:00:00.000000000 +0100 +@@ -1,16 +0,0 @@ +- +--- if compiled in, _gtk is set. +-if _gtk == nil then +- +- local init, err = loadlib(os.getenv("HOME") .. "/.lua50/libluagtk2.so", +- "luaopen_gtk2") +- if err then +- print(err) +- return +- end +- gtk = init() +- +-else +- gtk = _gtk +-end +- +diff -NbBur lua-gtk2-0.3_orig/gtk2.lua.in lua-gtk2-0.3/gtk2.lua.in +--- lua-gtk2-0.3_orig/gtk2.lua.in 1970-01-01 01:00:00.000000000 +0100 ++++ lua-gtk2-0.3/gtk2.lua.in 2006-05-15 01:20:24.000000000 +0200 +@@ -0,0 +1,16 @@ ++ ++-- if compiled in, _gtk is set. ++if _gtk == nil then ++ ++ local init, err = loadlib("PREFIX/lib/lua50/libluagtk2.so", ++ "luaopen_gtk2") ++ if err then ++ print(err) ++ return ++ end ++ gtk = init() ++ ++else ++ gtk = _gtk ++end ++ +diff -NbBur lua-gtk2-0.3_orig/Makefile lua-gtk2-0.3/Makefile +--- lua-gtk2-0.3_orig/Makefile 2005-08-16 19:32:08.000000000 +0200 ++++ lua-gtk2-0.3/Makefile 2006-05-16 03:09:41.000000000 +0200 +@@ -1,31 +1,46 @@ + # automatically generated makefile + +-# CFLAGS :=-DLINUX -Os -fomit-frame-pointer -Wall -DXTHREADS -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/X11R6/include -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include//lua50 -I build-linux -I src +-# CFLAGS :=-DLINUX -O2 -fomit-frame-pointer -Wall -DXTHREADS -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/X11R6/include -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include//lua50 -I build-linux -I src +-CFLAGS :=-DLINUX -g -Wall -DXTHREADS -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/X11R6/include -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include//lua50 -I build-linux -I src ++PACKAGE_CFLAGS =-g -Wall -DLINUX -Os -fomit-frame-pointer -Wall -DXTHREADS -DXUSE_MTSAFE_API `pkg-config --cflags gtk+-2.0` + HASH :=hash2 + ODIR :=build-linux/ + VERSION :=0.3 +-CC :=gcc-4.0 ++CC :=arm-linux-gcc ++HGCC :=gcc ++PREFIX := /usr/local ++LIBDIR := $(PREFIX)/lib/ + +-all: ${ODIR}libluagtk2.so ${ODIR}main ++all: ${ODIR}libluagtk2.so ${ODIR}main gtk2.lua + +-Makefile: configure +- ./configure ++%.lua %.lua.in: ++ sed 's:PREFIX:$(PREFIX):' < '$@.in' > $@ + + ${ODIR}libluagtk2.so: ${ODIR}libluagtk2.o ${ODIR}${HASH}.o ${ODIR}hash.o ${ODIR}_funclist.o ${ODIR}_structlist.o ${ODIR}_enumlist.o ${ODIR}_override.o + @echo $@ +- @${CC} -shared -o $@ $^ /usr/lib/libffi.a ++ @${CC} -shared -o $@ $^ ${LIBDIR}/libffi.a + +-${ODIR}generate: ${ODIR}generate.o ${ODIR}${HASH}.o ++${ODIR}file2c: ++ @echo $@ ++ @${HGCC} -o $@ src/file2c.c ++ ++${ODIR}generate.o: ++ @echo $@ ++ @${HGCC} -c -o $@ src/generate.c ++ ++${ODIR}${HASH}_host.o: ++ @echo $@ ++ @${HGCC} -c -o $@ src/${HASH}.c ++ ++${ODIR}generate: ${ODIR}generate.o ${ODIR}${HASH}_host.o ++ @echo $@ ++ @${HGCC} -Wall -g -o $@ $^ + + ${ODIR}main.o: src/main.c + @echo $@ +- @${CC} -Wall -c -g -o $@ $^ -I /usr/include/lua50 ++ @${HGCC} $(CFLAGS) -Wall -c -g -o $@ $^ -I /usr/include/lua50 + + ${ODIR}main: ${ODIR}main.o + @echo $@ +- @${CC} -o $@ $^ -llua50 -llualib50 ++ @${HGCC} $(CFLAGS) $(PACKAGE_CFLAGS) -o $@ $^ -llua -llualib + + ${ODIR}libluagtk2.o: src/libluagtk2.c ${ODIR}_typelist.c src/structinfo.h src/hash.h + +@@ -52,15 +67,15 @@ + + build-linux/%.o: build-linux/%.c + @echo $@ +- @${CC} ${CFLAGS} -c -o $@ $< ++ @${CC} $(PACKAGE_CFLAGS) $(CFLAGS) -c -o $@ $< + + build-linux/%.o: src/%.c + @echo $@ +- @${CC} ${CFLAGS} -c -o $@ $< ++ @${CC} $(PACKAGE_CFLAGS) $(CFLAGS) -c -o $@ $< + + build-linux/%.s: src/%.c + @echo $@ +- @${CC} ${CFLAGS} -S -o $@ $< ++ @${CC} $(PACKAGE_CFLAGS) $(CFLAGS) -S -o $@ $< + + build-linux/%.luac: src/%.lua + @echo $@ +@@ -68,12 +83,13 @@ + + clean: + rm -f ${ODIR}libluagtk2.so ${ODIR}generate ${ODIR}_*.c ${ODIR}*.o +- rm -f ${ODIR}file2c ${ODIR}override.luac ${ODIR}main ++ rm -f ${ODIR}file2c ${ODIR}override.luac ${ODIR}main gtk2.lua + + install: all +- mkdir -p ~/.lua50 +- cp gtk2.lua ~/.lua50 +- ln -sf $(PWD)/build-linux/libluagtk2.so ~/.lua50 ++ install -d $(DESTDIR)/$(PREFIX)/share/lua ++ install gtk2.lua $(DESTDIR)/$(PREFIX)/share/lua ++ install -d $(DESTDIR)/$(PREFIX)/lib/lua50 ++ install $(PWD)/build-linux/libluagtk2.so $(DESTDIR)/$(PREFIX)/lib/lua50 + + tar: + (cd ..; ln -s lua-gtk2 lua-gtk2-${VERSION}; tar czvhf lua-gtk2-${VERSION}.tar.gz \ +diff -NbBur lua-gtk2-0.3_orig/src/libluagtk2.c lua-gtk2-0.3/src/libluagtk2.c +--- lua-gtk2-0.3_orig/src/libluagtk2.c 2005-08-16 18:22:00.000000000 +0200 ++++ lua-gtk2-0.3/src/libluagtk2.c 2006-05-15 01:31:09.000000000 +0200 +@@ -27,9 +27,9 @@ + + static const char *dll_list[] = { + #ifdef LINUX +- "/usr/lib/libgtk-x11-2.0.so", +- "/usr/lib/libgdk-x11-2.0.so", +- "/usr/lib/libpango-1.0.so", ++ "/usr/lib/libgtk-x11-2.0.so.0", ++ "/usr/lib/libgdk-x11-2.0.so.0", ++ "/usr/lib/libpango-1.0.so.0", + #endif + #ifdef WIN32 + "C:/GTK/bin/libgtk-win32-2.0-0.dll", diff --git a/packages/lua/lua-gtk2_0.3.bb b/packages/lua/lua-gtk2_0.3.bb new file mode 100644 index 0000000000..4071bb1f04 --- /dev/null +++ b/packages/lua/lua-gtk2_0.3.bb @@ -0,0 +1,24 @@ +DESCRIPTION = "GTK bindings for LUA" +LICENSE = "GPL2" +PRIORITY = "optional" +DEPENDS = "gtk+ lua-native perl-native readline libffi" +RDEPENDS = "lua" +MAINTAINER = "Florian Boor " +SECTION = "libs" + +inherit gpe + +SRC_URI = "http://luaforge.net/frs/download.php/989/${P}.tar.gz \ + file://lua-gtk2-0.3_fixbuild.patch;patch=1" + +FILES_${PN} = "${datadir}/lua ${libdir}/lua50" + +CFLAGS_append = " -I '${S}/build-linux' -I src -DLINUX -I${STAGING_INCDIR} -L${STAGING_LIBDIR} -L${STAGING_LIBDIR}/../../${BUILD_SYS}/lib" + +do_compile () { + oe_runmake PREFIX='${prefix}' HGCC='${BUILD_CC}' LIBDIR='${STAGING_LIBDIR}' ODIR='build-linux/' CFLAGS='${CFLAGS}' +} + +do_configure_append () { + cd ${S} && mkdir build-linux +} -- cgit v1.2.3