1 diff -NbBur lua-gtk2-0.3_orig/configure lua-gtk2-0.3/configure
2 --- lua-gtk2-0.3_orig/configure 2005-08-16 19:32:07.000000000 +0200
3 +++ lua-gtk2-0.3/configure 2006-05-14 02:52:39.000000000 +0200
8 -CFLAGS="$(pkg-config gtk+-2.0 --cflags) $(pkg-config lua50 --cflags) -I build-linux -I src"
9 +CFLAGS="-g -Wall -DLINUX -Os -fomit-frame-pointer -Wall $(pkg-config gtk+-2.0 --cflags) $(pkg-config lua50 --cflags) -I build-linux -I src"
12 -if which gcc-4.0 > /dev/null; then
14 -elif which gcc > /dev/null; then
17 - @echo "No GCC found."
23 - LIBS="" # -lgtk-x11-2.0"
34 +# LIBS="" # -lgtk-x11-2.0"
44 # automatically generated makefile
46 -# CFLAGS :=-DLINUX -Os -fomit-frame-pointer -Wall $CFLAGS
47 +#CFLAGS := \-DLINUX -Os -fomit-frame-pointer -Wall $CFLAGS
48 # CFLAGS :=-DLINUX -O2 -fomit-frame-pointer -Wall $CFLAGS
49 -CFLAGS :=$CFLAGS2 -g -Wall $CFLAGS
57 all: \${ODIR}libluagtk2.so \${ODIR}main
60 @\${CC} -shared -o \$@ $^ /usr/lib/libffi.a $LIBS
62 \${ODIR}generate: \${ODIR}generate.o \${ODIR}\${HASH}.o
64 + @\${HGCC} -Wall -c -g -o \$@ $^
66 \${ODIR}main.o: src/main.c
69 rm -f \${ODIR}file2c \${ODIR}override.luac \${ODIR}main
73 - cp gtk2.lua ~/.lua50
74 - ln -sf \$(PWD)/build-linux/libluagtk2.so ~/.lua50
75 + install -d \$(DESTDIR)/\$(PREFIX)/lib/lua50
76 + install gtk2.lua \$(DESTDIR)/\$(PREFIX)/lib/lua50
77 + install \$(PWD)/build-linux/libluagtk2.so \$(DESTDIR)/\$(PREFIX)/lib/lua50
80 (cd ..; ln -s lua-gtk2 lua-gtk2-\${VERSION}; tar czvhf lua-gtk2-\${VERSION}.tar.gz \\
81 diff -NbBur lua-gtk2-0.3_orig/configure_orig lua-gtk2-0.3/configure_orig
82 --- lua-gtk2-0.3_orig/configure_orig 1970-01-01 01:00:00.000000000 +0100
83 +++ lua-gtk2-0.3/configure_orig 2006-05-13 18:22:03.000000000 +0200
89 +CFLAGS="$(pkg-config gtk+-2.0 --cflags) $(pkg-config lua50 --cflags) -I build-linux -I src"
92 +if which gcc-4.0 > /dev/null; then
94 +elif which gcc > /dev/null; then
97 + @echo "No GCC found."
103 + LIBS="" # -lgtk-x11-2.0"
112 +cat > Makefile <<EOF
113 +# automatically generated makefile
115 +# CFLAGS :=-DLINUX -Os -fomit-frame-pointer -Wall $CFLAGS
116 +# CFLAGS :=-DLINUX -O2 -fomit-frame-pointer -Wall $CFLAGS
117 +CFLAGS :=$CFLAGS2 -g -Wall $CFLAGS
123 +all: \${ODIR}libluagtk2.so \${ODIR}main
128 +\${ODIR}libluagtk2.so: \${ODIR}libluagtk2.o \${ODIR}\${HASH}.o \${ODIR}hash.o \${ODIR}_funclist.o \${ODIR}_structlist.o \${ODIR}_enumlist.o \${ODIR}_override.o
130 + @\${CC} -shared -o \$@ $^ /usr/lib/libffi.a $LIBS
132 +\${ODIR}generate: \${ODIR}generate.o \${ODIR}\${HASH}.o
134 +\${ODIR}main.o: src/main.c
136 + @\${CC} -Wall -c -g -o \$@ $^ -I /usr/include/lua50
138 +\${ODIR}main: \${ODIR}main.o
140 + @\${CC} -o \$@ $^ -llua50 -llualib50
142 +\${ODIR}libluagtk2.o: src/libluagtk2.c \${ODIR}_typelist.c src/structinfo.h src/hash.h
144 +\${ODIR}_funclist.c: data/gtkdata.funcs \${ODIR}generate
146 + @\${ODIR}generate -s 4096 -o \$@ -p funclist_ -d $<
148 +\${ODIR}_structlist.c: data/gtkdata.structs.c
151 +\${ODIR}_typelist.c: data/gtkdata.types.c
154 +\${ODIR}_enumlist.c: data/gtkdata.enums src/extra_enum
156 + @cat $^ | \${ODIR}generate -s 1201 -o \$@ -p enumlist_ -d -f -
158 +\${ODIR}_override.c: \${ODIR}override.luac \${ODIR}file2c
160 + @\${ODIR}file2c < \$^ > \$@
162 +data/gtkdata.structs.c:
163 + (cd data; ../script/gen-list.pl)
165 +build-linux/%.o: build-linux/%.c
167 + @\${CC} \${CFLAGS} -c -o \$@ \$<
169 +build-linux/%.o: src/%.c
171 + @\${CC} \${CFLAGS} -c -o \$@ \$<
173 +build-linux/%.s: src/%.c
175 + @\${CC} \${CFLAGS} -S -o \$@ \$<
177 +build-linux/%.luac: src/%.lua
179 + @luac -s -o \$@ \$<
182 + rm -f \${ODIR}libluagtk2.so \${ODIR}generate \${ODIR}_*.c \${ODIR}*.o
183 + rm -f \${ODIR}file2c \${ODIR}override.luac \${ODIR}main
187 + cp gtk2.lua ~/.lua50
188 + ln -sf \$(PWD)/build-linux/libluagtk2.so ~/.lua50
191 + (cd ..; ln -s lua-gtk2 lua-gtk2-\${VERSION}; tar czvhf lua-gtk2-\${VERSION}.tar.gz \\
192 + lua-gtk2-\${VERSION} --exclude old --exclude "build-*" --exclude foreign --exclude lua50 \\
193 + --exclude test-dll; rm lua-gtk2-\${VERSION})
197 +mkdir -p build-linux build-win32
199 diff -NbBur lua-gtk2-0.3_orig/gtk2.lua lua-gtk2-0.3/gtk2.lua
200 --- lua-gtk2-0.3_orig/gtk2.lua 2005-08-16 19:26:14.000000000 +0200
201 +++ lua-gtk2-0.3/gtk2.lua 1970-01-01 01:00:00.000000000 +0100
204 --- if compiled in, _gtk is set.
207 - local init, err = loadlib(os.getenv("HOME") .. "/.lua50/libluagtk2.so",
219 diff -NbBur lua-gtk2-0.3_orig/gtk2.lua.in lua-gtk2-0.3/gtk2.lua.in
220 --- lua-gtk2-0.3_orig/gtk2.lua.in 1970-01-01 01:00:00.000000000 +0100
221 +++ lua-gtk2-0.3/gtk2.lua.in 2006-05-15 01:20:24.000000000 +0200
224 +-- if compiled in, _gtk is set.
227 + local init, err = loadlib("PREFIX/lib/lua50/libluagtk2.so",
239 diff -NbBur lua-gtk2-0.3_orig/Makefile lua-gtk2-0.3/Makefile
240 --- lua-gtk2-0.3_orig/Makefile 2005-08-16 19:32:08.000000000 +0200
241 +++ lua-gtk2-0.3/Makefile 2006-05-16 03:09:41.000000000 +0200
243 # automatically generated makefile
245 -# 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
246 -# 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
247 -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
248 +PACKAGE_CFLAGS =-g -Wall -DLINUX -Os -fomit-frame-pointer -Wall -DXTHREADS -DXUSE_MTSAFE_API `pkg-config --cflags gtk+-2.0`
255 +PREFIX := /usr/local
256 +LIBDIR := $(PREFIX)/lib/
258 -all: ${ODIR}libluagtk2.so ${ODIR}main
259 +all: ${ODIR}libluagtk2.so ${ODIR}main gtk2.lua
264 + sed 's:PREFIX:$(PREFIX):' < '$@.in' > $@
266 ${ODIR}libluagtk2.so: ${ODIR}libluagtk2.o ${ODIR}${HASH}.o ${ODIR}hash.o ${ODIR}_funclist.o ${ODIR}_structlist.o ${ODIR}_enumlist.o ${ODIR}_override.o
268 - @${CC} -shared -o $@ $^ /usr/lib/libffi.a
269 + @${CC} -shared -o $@ $^ ${LIBDIR}/libffi.a
271 -${ODIR}generate: ${ODIR}generate.o ${ODIR}${HASH}.o
274 + @${HGCC} -o $@ src/file2c.c
278 + @${HGCC} -c -o $@ src/generate.c
280 +${ODIR}${HASH}_host.o:
282 + @${HGCC} -c -o $@ src/${HASH}.c
284 +${ODIR}generate: ${ODIR}generate.o ${ODIR}${HASH}_host.o
286 + @${HGCC} -Wall -g -o $@ $^
288 ${ODIR}main.o: src/main.c
290 - @${CC} -Wall -c -g -o $@ $^ -I /usr/include/lua50
291 + @${HGCC} $(CFLAGS) -Wall -c -g -o $@ $^ -I /usr/include/lua50
293 ${ODIR}main: ${ODIR}main.o
295 - @${CC} -o $@ $^ -llua50 -llualib50
296 + @${HGCC} $(CFLAGS) $(PACKAGE_CFLAGS) -o $@ $^ -llua -llualib
298 ${ODIR}libluagtk2.o: src/libluagtk2.c ${ODIR}_typelist.c src/structinfo.h src/hash.h
302 build-linux/%.o: build-linux/%.c
304 - @${CC} ${CFLAGS} -c -o $@ $<
305 + @${CC} $(PACKAGE_CFLAGS) $(CFLAGS) -c -o $@ $<
307 build-linux/%.o: src/%.c
309 - @${CC} ${CFLAGS} -c -o $@ $<
310 + @${CC} $(PACKAGE_CFLAGS) $(CFLAGS) -c -o $@ $<
312 build-linux/%.s: src/%.c
314 - @${CC} ${CFLAGS} -S -o $@ $<
315 + @${CC} $(PACKAGE_CFLAGS) $(CFLAGS) -S -o $@ $<
317 build-linux/%.luac: src/%.lua
322 rm -f ${ODIR}libluagtk2.so ${ODIR}generate ${ODIR}_*.c ${ODIR}*.o
323 - rm -f ${ODIR}file2c ${ODIR}override.luac ${ODIR}main
324 + rm -f ${ODIR}file2c ${ODIR}override.luac ${ODIR}main gtk2.lua
328 - cp gtk2.lua ~/.lua50
329 - ln -sf $(PWD)/build-linux/libluagtk2.so ~/.lua50
330 + install -d $(DESTDIR)/$(PREFIX)/share/lua
331 + install gtk2.lua $(DESTDIR)/$(PREFIX)/share/lua
332 + install -d $(DESTDIR)/$(PREFIX)/lib/lua50
333 + install $(PWD)/build-linux/libluagtk2.so $(DESTDIR)/$(PREFIX)/lib/lua50
336 (cd ..; ln -s lua-gtk2 lua-gtk2-${VERSION}; tar czvhf lua-gtk2-${VERSION}.tar.gz \
337 diff -NbBur lua-gtk2-0.3_orig/src/libluagtk2.c lua-gtk2-0.3/src/libluagtk2.c
338 --- lua-gtk2-0.3_orig/src/libluagtk2.c 2005-08-16 18:22:00.000000000 +0200
339 +++ lua-gtk2-0.3/src/libluagtk2.c 2006-05-15 01:31:09.000000000 +0200
342 static const char *dll_list[] = {
344 - "/usr/lib/libgtk-x11-2.0.so",
345 - "/usr/lib/libgdk-x11-2.0.so",
346 - "/usr/lib/libpango-1.0.so",
347 + "/usr/lib/libgtk-x11-2.0.so.0",
348 + "/usr/lib/libgdk-x11-2.0.so.0",
349 + "/usr/lib/libpango-1.0.so.0",
352 "C:/GTK/bin/libgtk-win32-2.0-0.dll",