--- /dev/null
+# ChangeLog for dev-lua/luvit
+# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
+# $Header: $
+
+*luvit-0.2.0 (31 Mar 2012)
+
+ 31 Mar 2012; hasufell <julian.ospald@googlemail.com>
+ +files/0.2.0-includes.patch, +luvit-0.2.0.ebuild,
+ +files/0.2.0-makefile.patch, +metadata.xml:
+ New Ebuild for bug 406403 thanks to Tommy[D] chithead Enlik and ssuominen
+
--- /dev/null
+AUX 0.2.0-includes.patch 8769 RMD160 d18f383a083a93944d61e9407dc861742980c222 SHA1 6ec07c7da7acf8303f44dfbaaf12146c0a7e7dc9 SHA256 787378b6617f75f572e916efc6ff7f714c3006026e63c7d5d074783c2c88ab22
+AUX 0.2.0-makefile.patch 8788 RMD160 f9d463dff174321e92514740c58b4c3e2c8c0909 SHA1 3e6a4f1c178055cce901c5cba560950855c898c3 SHA256 3d058f634b06c4815354c1c09a2b56fa3b6963defb5299c927b961e9dac38d52
+DIST luvit-0.2.0.tar.gz 2518781 RMD160 77c1c1e678939b1e4af599454a17a489e810ab24 SHA1 27cb759207d7b034743509d1fa7dfce6032b7f5b SHA256 ce02b8ad6dac979344d82e8685ad7acfc0cf9cb4e54465888df62bb3d4e99c37
+EBUILD luvit-0.2.0.ebuild 1172 RMD160 11d95ff1cd69dc1f8c94094cfb9977f55c94ed1d SHA1 316246508dfcf99af651f416dc3076be12171d59 SHA256 6c62981b262a30763800d89034552c5527b1e63bf183576091dbda7551800c5b
+MISC ChangeLog 372 RMD160 2fa1ca77fb8a3ea7aec8a5fa6c8720e859ac6861 SHA1 89640bbbdf55e53a2636e30b7a47922f98001fd0 SHA256 85529ede95a8d0323d8a70ddb03dce4b8e4739ef81d94b7cfc434bda73777f47
+MISC metadata.xml 214 RMD160 efd8175069efb91061298ff4584218b633e44678 SHA1 d372fdbfcb7fd07a4082961d3f3527be4fca1d60 SHA256 c1f09dc7d5313cd2da7b82259c7846ed23144d62b15e59680ada90e2b6b4d154
--- /dev/null
+--- luvit-0.2.0/src/lconstants.h 2012-02-25 07:02:11.000000000 +0100
++++ luvit-0.2.0/src/lconstants.h 2012-03-29 16:46:40.000000000 +0200
+@@ -37,8 +37,8 @@
+ # include <openssl/ssl.h>
+ #endif
+
+-#include "lua.h"
+-#include "lauxlib.h"
++#include <luajit-2.0/lua.h>
++#include <luajit-2.0/lauxlib.h>
+ #include "utils.h"
+
+ LUALIB_API int luaopen_constants(lua_State *L);
+--- luvit-0.2.0/src/lenv.h 2012-02-25 07:02:11.000000000 +0100
++++ luvit-0.2.0/src/lenv.h 2012-03-29 16:46:40.000000000 +0200
+@@ -18,8 +18,8 @@
+ #ifndef LENV
+ #define LENV
+
+-#include "lua.h"
+-#include "lauxlib.h"
++#include <luajit-2.0/lua.h>
++#include <luajit-2.0/lauxlib.h>
+ #include "utils.h"
+
+ LUALIB_API int luaopen_env (lua_State *L);
+--- luvit-0.2.0/src/lhttp_parser.h 2012-02-25 07:02:11.000000000 +0100
++++ luvit-0.2.0/src/lhttp_parser.h 2012-03-29 16:46:40.000000000 +0200
+@@ -18,8 +18,8 @@
+ #ifndef LHTTP_PARSER
+ #define LHTTP_PARSER
+
+-#include "lua.h"
+-#include "lauxlib.h"
++#include <luajit-2.0/lua.h>
++#include <luajit-2.0/lauxlib.h>
+ #include "utils.h"
+
+ LUALIB_API int luaopen_http_parser (lua_State *L);
+--- luvit-0.2.0/src/los.h 2012-02-25 07:02:11.000000000 +0100
++++ luvit-0.2.0/src/los.h 2012-03-29 16:46:40.000000000 +0200
+@@ -18,8 +18,8 @@
+ #ifndef LOS
+ #define LOS
+
+-#include "lua.h"
+-#include "lauxlib.h"
++#include <luajit-2.0/lua.h>
++#include <luajit-2.0/lauxlib.h>
+
+ LUALIB_API int luaopen_os_binding (lua_State *L);
+
+--- luvit-0.2.0/src/luv.c 2012-02-25 07:02:11.000000000 +0100
++++ luvit-0.2.0/src/luv.c 2012-03-29 16:46:40.000000000 +0200
+@@ -16,7 +16,7 @@
+ */
+
+ #include "luv.h"
+-#include "uv.h"
++#include <uv.h>
+ #include <stdlib.h>
+ #include <assert.h>
+ #include <string.h>
+--- luvit-0.2.0/src/luv_dns.h 2012-02-25 07:02:11.000000000 +0100
++++ luvit-0.2.0/src/luv_dns.h 2012-03-29 16:46:40.000000000 +0200
+@@ -18,10 +18,10 @@
+ #ifndef LUV_DNS
+ #define LUV_DNS
+
+-#include "lua.h"
+-#include "lauxlib.h"
+-#include "uv.h"
+-#include "ares.h"
++#include <luajit-2.0/lua.h>
++#include <luajit-2.0/lauxlib.h>
++#include <uv.h>
++#include <ares.h>
+ #include "utils.h"
+
+ /* Wrapped functions exposed to lua */
+--- luvit-0.2.0/src/luv_fs.h 2012-02-25 07:02:11.000000000 +0100
++++ luvit-0.2.0/src/luv_fs.h 2012-03-29 16:46:40.000000000 +0200
+@@ -18,9 +18,9 @@
+ #ifndef LUV_FS
+ #define LUV_FS
+
+-#include "lua.h"
+-#include "lauxlib.h"
+-#include "uv.h"
++#include <luajit-2.0/lua.h>
++#include <luajit-2.0/lauxlib.h>
++#include <uv.h>
+ #include "utils.h"
+
+ void luv_push_stats_table(lua_State* L, struct stat* s);
+--- luvit-0.2.0/src/luv_fs_watcher.h 2012-02-25 07:02:11.000000000 +0100
++++ luvit-0.2.0/src/luv_fs_watcher.h 2012-03-29 16:46:40.000000000 +0200
+@@ -18,9 +18,9 @@
+ #ifndef LUV_FS_WATCHER
+ #define LUV_FS_WATCHER
+
+-#include "lua.h"
+-#include "lauxlib.h"
+-#include "uv.h"
++#include <luajit-2.0/lua.h>
++#include <luajit-2.0/lauxlib.h>
++#include <uv.h>
+ #include "utils.h"
+ #include "luv_handle.h"
+
+--- luvit-0.2.0/src/luv.h 2012-02-25 07:02:11.000000000 +0100
++++ luvit-0.2.0/src/luv.h 2012-03-29 16:46:40.000000000 +0200
+@@ -18,8 +18,8 @@
+ #ifndef LUV
+ #define LUV
+
+-#include "lua.h"
+-#include "lauxlib.h"
++#include <luajit-2.0/lua.h>
++#include <luajit-2.0/lauxlib.h>
+ #include "utils.h"
+
+ LUALIB_API int luaopen_uv_native (lua_State *L);
+--- luvit-0.2.0/src/luv_handle.h 2012-02-25 07:02:11.000000000 +0100
++++ luvit-0.2.0/src/luv_handle.h 2012-03-29 16:46:40.000000000 +0200
+@@ -18,9 +18,9 @@
+ #ifndef LUV_HANDLE
+ #define LUV_HANDLE
+
+-#include "lua.h"
+-#include "lauxlib.h"
+-#include "uv.h"
++#include <luajit-2.0/lua.h>
++#include <luajit-2.0/lauxlib.h>
++#include <uv.h>
+ #include "utils.h"
+
+ typedef struct {
+--- luvit-0.2.0/src/luvit_init.c 2012-02-25 07:02:11.000000000 +0100
++++ luvit-0.2.0/src/luvit_init.c 2012-03-29 16:46:40.000000000 +0200
+@@ -20,12 +20,12 @@
+ #include <stdlib.h>
+ #include <limits.h> /* PATH_MAX */
+
+-#include "lua.h"
+-#include "lualib.h"
+-#include "lauxlib.h"
++#include <luajit-2.0/lua.h>
++#include <luajit-2.0/lualib.h>
++#include <luajit-2.0/lauxlib.h>
+
+ #include "luvit.h"
+-#include "uv.h"
++#include <uv.h>
+ #include "utils.h"
+ #include "los.h"
+ #include "luv.h"
+--- luvit-0.2.0/src/luvit_main.c 2012-02-25 07:02:11.000000000 +0100
++++ luvit-0.2.0/src/luvit_main.c 2012-03-29 16:46:40.000000000 +0200
+@@ -20,14 +20,14 @@
+ #include <stdlib.h>
+ #include <limits.h> /* PATH_MAX */
+
+-#include "lua.h"
+-#include "lualib.h"
+-#include "lauxlib.h"
++#include <luajit-2.0/lua.h>
++#include <luajit-2.0/lualib.h>
++#include <luajit-2.0/lauxlib.h>
+
+ #ifndef WIN32
+ #include <pthread.h>
+ #endif
+-#include "uv.h"
++#include <uv.h>
+
+ #include "luvit.h"
+ #include "luv.h"
+--- luvit-0.2.0/src/luv_misc.h 2012-02-25 07:02:11.000000000 +0100
++++ luvit-0.2.0/src/luv_misc.h 2012-03-29 16:46:40.000000000 +0200
+@@ -18,9 +18,9 @@
+ #ifndef LUV_MISC
+ #define LUV_MISC
+
+-#include "lua.h"
+-#include "lauxlib.h"
+-#include "uv.h"
++#include <luajit-2.0/lua.h>
++#include <luajit-2.0/lauxlib.h>
++#include <uv.h>
+ #include "utils.h"
+
+ int luv_activate_signal_handler(lua_State* L);
+--- luvit-0.2.0/src/luv_pipe.h 2012-02-25 07:02:11.000000000 +0100
++++ luvit-0.2.0/src/luv_pipe.h 2012-03-29 16:46:40.000000000 +0200
+@@ -18,9 +18,9 @@
+ #ifndef LUV_PIPE
+ #define LUV_PIPE
+
+-#include "lua.h"
+-#include "lauxlib.h"
+-#include "uv.h"
++#include <luajit-2.0/lua.h>
++#include <luajit-2.0/lauxlib.h>
++#include <uv.h>
+ #include "utils.h"
+ #include "luv_stream.h"
+
+--- luvit-0.2.0/src/luv_process.h 2012-02-25 07:02:11.000000000 +0100
++++ luvit-0.2.0/src/luv_process.h 2012-03-29 16:46:41.000000000 +0200
+@@ -18,9 +18,9 @@
+ #ifndef LUV_PROCESS
+ #define LUV_PROCESS
+
+-#include "lua.h"
+-#include "lauxlib.h"
+-#include "uv.h"
++#include <luajit-2.0/lua.h>
++#include <luajit-2.0/lauxlib.h>
++#include <uv.h>
+ #include "utils.h"
+ #include "luv_handle.h"
+
+--- luvit-0.2.0/src/luv_stream.h 2012-02-25 07:02:11.000000000 +0100
++++ luvit-0.2.0/src/luv_stream.h 2012-03-29 16:46:40.000000000 +0200
+@@ -18,9 +18,9 @@
+ #ifndef LUV_STREAM
+ #define LUV_STREAM
+
+-#include "lua.h"
+-#include "lauxlib.h"
+-#include "uv.h"
++#include <luajit-2.0/lua.h>
++#include <luajit-2.0/lauxlib.h>
++#include <uv.h>
+ #include "utils.h"
+ #include "luv_handle.h"
+
+--- luvit-0.2.0/src/luv_tcp.h 2012-02-25 07:02:11.000000000 +0100
++++ luvit-0.2.0/src/luv_tcp.h 2012-03-29 16:46:40.000000000 +0200
+@@ -18,9 +18,9 @@
+ #ifndef LUV_TCP
+ #define LUV_TCP
+
+-#include "lua.h"
+-#include "lauxlib.h"
+-#include "uv.h"
++#include <luajit-2.0/lua.h>
++#include <luajit-2.0/lauxlib.h>
++#include <uv.h>
+ #include "utils.h"
+ #include "luv_stream.h"
+
+--- luvit-0.2.0/src/luv_timer.h 2012-02-25 07:02:11.000000000 +0100
++++ luvit-0.2.0/src/luv_timer.h 2012-03-29 16:46:40.000000000 +0200
+@@ -18,9 +18,9 @@
+ #ifndef LUV_TIMER
+ #define LUV_TIMER
+
+-#include "lua.h"
+-#include "lauxlib.h"
+-#include "uv.h"
++#include <luajit-2.0/lua.h>
++#include <luajit-2.0/lauxlib.h>
++#include <uv.h>
+ #include "utils.h"
+ #include "luv_handle.h"
+
+--- luvit-0.2.0/src/luv_tty.h 2012-02-25 07:02:11.000000000 +0100
++++ luvit-0.2.0/src/luv_tty.h 2012-03-29 16:46:41.000000000 +0200
+@@ -18,9 +18,9 @@
+ #ifndef LUV_TTY
+ #define LUV_TTY
+
+-#include "lua.h"
+-#include "lauxlib.h"
+-#include "uv.h"
++#include <luajit-2.0/lua.h>
++#include <luajit-2.0/lauxlib.h>
++#include <uv.h>
+ #include "utils.h"
+ #include "luv_stream.h"
+
+--- luvit-0.2.0/src/luv_udp.h 2012-02-25 07:02:11.000000000 +0100
++++ luvit-0.2.0/src/luv_udp.h 2012-03-29 16:46:41.000000000 +0200
+@@ -18,9 +18,9 @@
+ #ifndef LUV_UDP
+ #define LUV_UDP
+
+-#include "lua.h"
+-#include "lauxlib.h"
+-#include "uv.h"
++#include <luajit-2.0/lua.h>
++#include <luajit-2.0/lauxlib.h>
++#include <uv.h>
+ #include "utils.h"
+ #include "luv_handle.h"
+
+--- luvit-0.2.0/src/lyajl.c 2012-02-25 07:02:11.000000000 +0100
++++ luvit-0.2.0/src/lyajl.c 2012-03-29 16:46:40.000000000 +0200
+@@ -22,9 +22,9 @@
+
+ #include "lyajl.h"
+ #include "utils.h"
+-#include "yajl/yajl_parse.h"
+-#include "yajl/yajl_gen.h"
+-#include "yajl/yajl_version.h"
++#include <yajl_parse.h>
++#include <yajl_gen.h>
++#include <yajl_version.h>
+
+ static void* yjajl_js_null;
+
+--- luvit-0.2.0/src/lyajl.h 2012-02-25 07:02:11.000000000 +0100
++++ luvit-0.2.0/src/lyajl.h 2012-03-29 16:46:41.000000000 +0200
+@@ -18,8 +18,8 @@
+ #ifndef LYAJL
+ #define LYAJL
+
+-#include "lua.h"
+-#include "lauxlib.h"
++#include <luajit-2.0/lua.h>
++#include <luajit-2.0/lauxlib.h>
+ #include "utils.h"
+
+ LUALIB_API int luaopen_yajl (lua_State *L);
+--- luvit-0.2.0/src/utils.h 2012-02-25 07:02:11.000000000 +0100
++++ luvit-0.2.0/src/utils.h 2012-03-29 16:46:40.000000000 +0200
+@@ -18,10 +18,10 @@
+ #ifndef LUV_UTILS
+ #define LUV_UTILS
+
+-#include "lua.h"
+-#include "lauxlib.h"
+-#include "uv.h"
+-#include "ares.h"
++#include <luajit-2.0/lua.h>
++#include <luajit-2.0/lauxlib.h>
++#include <uv.h>
++#include <ares.h>
+
+ /* C doesn't have booleans on it's own */
+ #ifndef FALSE
--- /dev/null
+--- Makefile.old 2012-02-25 07:02:12.000000000 +0100
++++ Makefile 2012-03-29 17:58:08.000000000 +0200
+@@ -9,21 +9,23 @@
+ HTTP_VERSION=v1.0-61-g4898606
+ BUILDDIR=build
+
+-PREFIX?=/usr/local
+-BINDIR?=${DESTDIR}${PREFIX}/bin
+-INCDIR?=${DESTDIR}${PREFIX}/include/luvit
+-LIBDIR?=${DESTDIR}${PREFIX}/lib/luvit
++# Paths
++PREFIX?=/usr
++LIBDIR?=lib
++BINDIR_LUVIT?=${DESTDIR}${PREFIX}/bin
++INCDIR_LUVIT?=${DESTDIR}${PREFIX}/include/luvit
++LIBDIR_LUVIT?=${DESTDIR}${PREFIX}/${LIBDIR}/luvit
+
+ OS_NAME=$(shell uname -s)
+ MH_NAME=$(shell uname -m)
+ ifeq (${OS_NAME},Darwin)
+ ifeq (${MH_NAME},x86_64)
+-LDFLAGS=-framework CoreServices -pagezero_size 10000 -image_base 100000000
++LDFLAGS+=-framework CoreServices -pagezero_size 10000 -image_base 100000000
+ else
+-LDFLAGS=-framework CoreServices
++LDFLAGS+=-framework CoreServices
+ endif
+ else ifeq (${OS_NAME},Linux)
+-LDFLAGS=-Wl,-E
++LDFLAGS+=-Wl,-E
+ endif
+ # LUAJIT CONFIGURATION #
+ #XCFLAGS=-g
+@@ -35,17 +37,28 @@
+ export Q=
+ MAKEFLAGS+=-e
+
+-LDFLAGS+=-L${BUILDDIR} -lluvit
+-LDFLAGS+=${LUADIR}/src/libluajit.a
+-LDFLAGS+=${UVDIR}/uv.a
+-LDFLAGS+=${YAJLDIR}/yajl.a
+-LDFLAGS+=-Wall -lm -ldl -lpthread
++CC ?= gcc
++
++LDFLAGS += \
++ -L${BUILDDIR} \
++ -Wall
++
++LIBS += \
++ -lluajit-5.1 \
++ -luv \
++ -lyajl \
++ -lhttp_parser \
++ -lluvit -lm -ldl -lpthread -lrt
++
++INCLUDES += \
++ -I${PREFIX}/include/libuv \
++ -I${PREFIX}/include/http-parser \
++ -I${PREFIX}/include/yajl
+
+ ifeq (${OS_NAME},Linux)
+ LDFLAGS+= -lrt
+ endif
+
+-
+ LUVLIBS=${BUILDDIR}/utils.o \
+ ${BUILDDIR}/luv_fs.o \
+ ${BUILDDIR}/luv_dns.o \
+@@ -67,86 +80,37 @@
+ ${BUILDDIR}/los.o \
+ ${BUILDDIR}/lhttp_parser.o
+
+-DEPS=${LUADIR}/src/libluajit.a \
+- ${YAJLDIR}/yajl.a \
+- ${UVDIR}/uv.a \
+- ${HTTPDIR}/http_parser.o
+-
+ all: ${BUILDDIR}/luvit
+
+-${LUADIR}/Makefile:
+- git submodule update --init ${LUADIR}
+-
+-${LUADIR}/src/libluajit.a: ${LUADIR}/Makefile
+- touch -c ${LUADIR}/src/*.h
+- $(MAKE) -C ${LUADIR}
+-
+-${YAJLDIR}/CMakeLists.txt:
+- git submodule update --init ${YAJLDIR}
+-
+-${YAJLDIR}/Makefile: deps/Makefile.yajl ${YAJLDIR}/CMakeLists.txt
+- cp deps/Makefile.yajl ${YAJLDIR}/Makefile
+-
+-${YAJLDIR}/yajl.a: ${YAJLDIR}/Makefile
+- rm -rf ${YAJLDIR}/src/yajl
+- cp -r ${YAJLDIR}/src/api ${YAJLDIR}/src/yajl
+- $(MAKE) -C ${YAJLDIR}
+-
+-${UVDIR}/Makefile:
+- git submodule update --init ${UVDIR}
+-
+-${UVDIR}/uv.a: ${UVDIR}/Makefile
+- $(MAKE) -C ${UVDIR} uv.a
+-
+-${HTTPDIR}/Makefile:
+- git submodule update --init ${HTTPDIR}
+-
+-${HTTPDIR}/http_parser.o: ${HTTPDIR}/Makefile
+- ${MAKE} -C ${HTTPDIR} http_parser.o
+-
+-${BUILDDIR}/%.o: src/%.c ${DEPS}
++${BUILDDIR}/%.o: src/%.c
+ mkdir -p ${BUILDDIR}
+- $(CC) --std=c89 -D_GNU_SOURCE -g -Wall -Werror -c $< -o $@ -I${HTTPDIR} -I${UVDIR}/include -I${LUADIR}/src -I${YAJLDIR}/src/api -I${YAJLDIR}/src -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHTTP_VERSION=\"${HTTP_VERSION}\" -DUV_VERSION=\"${UV_VERSION}\" -DYAJL_VERSIONISH=\"${YAJL_VERSION}\" -DLUVIT_VERSION=\"${VERSION}\" -DLUAJIT_VERSION=\"${LUAJIT_VERSION}\"
++ $(CC) $(CFLAGS) --std=c89 -D_GNU_SOURCE -Wall -Werror -c $< -o $@ ${INCLUDES} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHTTP_VERSION=\"${HTTP_VERSION}\" -DUV_VERSION=\"${UV_VERSION}\" -DYAJL_VERSIONISH=\"${YAJL_VERSION}\" -DLUVIT_VERSION=\"${VERSION}\" -DLUAJIT_VERSION=\"${LUAJIT_VERSION}\"
+
+-${BUILDDIR}/libluvit.a: ${LUVLIBS} ${DEPS}
+- $(AR) rvs ${BUILDDIR}/libluvit.a ${LUVLIBS} ${DEPS}
++${BUILDDIR}/libluvit.a: ${LUVLIBS}
++ $(AR) rvs ${BUILDDIR}/libluvit.a ${LUVLIBS}
+
+ ${BUILDDIR}/luvit: ${BUILDDIR}/libluvit.a ${BUILDDIR}/luvit_main.o
+- $(CC) -g -o ${BUILDDIR}/luvit ${BUILDDIR}/luvit_main.o ${BUILDDIR}/libluvit.a ${LDFLAGS}
++ $(CC) $(CFLAGS) ${LDFLAGS} -o ${BUILDDIR}/luvit ${BUILDDIR}/luvit_main.o ${BUILDDIR}/libluvit.a ${LIBS}
+
+ clean:
+- ${MAKE} -C ${LUADIR} clean
+- ${MAKE} -C ${HTTPDIR} clean
+- ${MAKE} -C ${YAJLDIR} clean
+- ${MAKE} -C ${UVDIR} distclean
+ ${MAKE} -C examples/native clean
+ rm -rf build bundle
+
+ install: all
+- mkdir -p ${BINDIR}
+- install ${BUILDDIR}/luvit ${BINDIR}/luvit
+- cp bin/luvit-config.lua ${BINDIR}/luvit-config
+- chmod +x ${BINDIR}/luvit-config
+- mkdir -p ${LIBDIR}
+- cp lib/luvit/*.lua ${LIBDIR}
+- mkdir -p ${INCDIR}/luajit
+- cp ${LUADIR}/src/lua.h ${INCDIR}/luajit/
+- cp ${LUADIR}/src/lauxlib.h ${INCDIR}/luajit/
+- cp ${LUADIR}/src/luaconf.h ${INCDIR}/luajit/
+- cp ${LUADIR}/src/luajit.h ${INCDIR}/luajit/
+- cp ${LUADIR}/src/lualib.h ${INCDIR}/luajit/
+- mkdir -p ${INCDIR}/http_parser
+- cp ${HTTPDIR}/http_parser.h ${INCDIR}/http_parser/
+- mkdir -p ${INCDIR}/uv
+- cp ${UVDIR}/include/uv.h ${INCDIR}/uv/
+- cp src/*.h ${INCDIR}/
+-
+-
+-bundle: build/luvit ${BUILDDIR}/libluvit.a
+- build/luvit tools/bundler.lua
+- $(CC) --std=c89 -D_GNU_SOURCE -g -Wall -Werror -DBUNDLE -c src/luvit_exports.c -o bundle/luvit_exports.o -I${HTTPDIR} -I${UVDIR}/include -I${LUADIR}/src -I${YAJLDIR}/src/api -I${YAJLDIR}/src -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHTTP_VERSION=\"${HTTP_VERSION}\" -DUV_VERSION=\"${UV_VERSION}\" -DYAJL_VERSIONISH=\"${YAJL_VERSION}\" -DLUVIT_VERSION=\"${VERSION}\" -DLUAJIT_VERSION=\"${LUAJIT_VERSION}\"
+- $(CC) --std=c89 -D_GNU_SOURCE -g -Wall -Werror -DBUNDLE -c src/luvit_main.c -o bundle/luvit_main.o -I${HTTPDIR} -I${UVDIR}/include -I${LUADIR}/src -I${YAJLDIR}/src/api -I${YAJLDIR}/src -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHTTP_VERSION=\"${HTTP_VERSION}\" -DUV_VERSION=\"${UV_VERSION}\" -DYAJL_VERSIONISH=\"${YAJL_VERSION}\" -DLUVIT_VERSION=\"${VERSION}\" -DLUAJIT_VERSION=\"${LUAJIT_VERSION}\"
+- $(CC) -g -o bundle/luvit ${BUILDDIR}/libluvit.a `ls bundle/*.o` ${LDFLAGS}
++ mkdir -p ${BINDIR_LUVIT}
++ install -Dm755 ${BUILDDIR}/luvit ${BINDIR_LUVIT}/luvit
++ install -Dm755 bin/luvit-config.lua ${BINDIR_LUVIT}/luvit-config
++ for i in `ls lib/luvit`; do \
++ install -Dm644 lib/luvit/$$i ${LIBDIR_LUVIT}/$$i; done
++ for i in `ls src/*.h`; do \
++ install -Dm644 $$i ${INCDIR_LUVIT}/$$(basename $$i); done
++
++#bundle: build/luvit-1 ${BUILDDIR}/libluvit.a
++# build/luvit tools/bundler.lua
++# $(CC) --std=c89 -D_GNU_SOURCE -Wall -Werror -DBUNDLE -c src/luvit_exports.c -o bundle/luvit_exports.o -I${HTTPDIR} -I${UVDIR}/include -I${LUADIR}/src -I${YAJLDIR}/src/api -I${YAJLDIR}/src -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHTTP_VERSION=\"${HTTP_VERSION}\" -DUV_VERSION=\"${UV_VERSION}\" -DYAJL_VERSIONISH=\"${YAJL_VERSION}\" -DLUVIT_VERSION=\"${VERSION}\" -DLUAJIT_VERSION=\"${LUAJIT_VERSION}\"
++# $(CC) --std=c89 -D_GNU_SOURCE -Wall -Werror -DBUNDLE -c src/luvit_main.c -o bundle/luvit_main.o -I${HTTPDIR} -I${UVDIR}/include -I${LUADIR}/src -I${YAJLDIR}/src/api -I${YAJLDIR}/src -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHTTP_VERSION=\"${HTTP_VERSION}\" -DUV_VERSION=\"${UV_VERSION}\" -DYAJL_VERSIONISH=\"${YAJL_VERSION}\" -DLUVIT_VERSION=\"${VERSION}\" -DLUAJIT_VERSION=\"${LUAJIT_VERSION}\"
++# $(CC) -o bundle/luvit-1 ${BUILDDIR}/libluvit.a `ls bundle/*.o` ${LDFLAGS}
++
+
+ test: ${BUILDDIR}/luvit
+ cd tests && ../${BUILDDIR}/luvit runner.lua
+@@ -156,26 +120,26 @@
+ api.markdown: $(wildcard lib/*.lua)
+ find lib -name "*.lua" | grep -v "luvit.lua" | sort | xargs -l luvit tools/doc-parser.lua > $@
+
+-DIST_DIR?=${HOME}/luvit.io/dist
+-DIST_NAME=luvit-${VERSION}
+-DIST_FOLDER=${DIST_DIR}/${VERSION}/${DIST_NAME}
+-DIST_FILE=${DIST_FOLDER}.tar.gz
+-tarball:
+- rm -rf ${DIST_FOLDER} ${DIST_FILE}
+- mkdir -p ${DIST_DIR}
+- git clone . ${DIST_FOLDER}
+- cp deps/gitmodules.local ${DIST_FOLDER}/.gitmodules
+- cd ${DIST_FOLDER} ; git submodule update --init
+- find ${DIST_FOLDER} -name ".git*" | xargs rm -r
+- rm -rf ${DIST_FOLDER}/deps/zlib
+- sed -e 's/^VERSION=.*/VERSION=${VERSION}/' \
++#DIST_DIR?=${HOME}/luvit.io/dist
++#DIST_NAME=luvit-${VERSION}
++#DIST_FOLDER=${DIST_DIR}/${VERSION}/${DIST_NAME}
++#DIST_FILE=${DIST_FOLDER}.tar.gz
++#tarball:
++# rm -rf ${DIST_FOLDER} ${DIST_FILE}
++# mkdir -p ${DIST_DIR}
++# git clone . ${DIST_FOLDER}
++# cp deps/gitmodules.local ${DIST_FOLDER}/.gitmodules
++# cd ${DIST_FOLDER} ; git submodule update --init
++# find ${DIST_FOLDER} -name ".git*" | xargs rm -r
++# rm -rf ${DIST_FOLDER}/deps/zlib
++# sed -e 's/^VERSION=.*/VERSION=${VERSION}/' \
+ -e 's/^LUAJIT_VERSION=.*/LUAJIT_VERSION=${LUAJIT_VERSION}/' \
+ -e 's/^UV_VERSION=.*/UV_VERSION=${UV_VERSION}/' \
+ -e 's/^HTTP_VERSION=.*/HTTP_VERSION=${HTTP_VERSION}/' \
+ -e 's/^YAJL_VERSION=.*/YAJL_VERSION=${YAJL_VERSION}/' < ${DIST_FOLDER}/Makefile > ${DIST_FOLDER}/Makefile.patched
+- mv ${DIST_FOLDER}/Makefile.patched ${DIST_FOLDER}/Makefile
+- tar -czf ${DIST_FILE} -C ${DIST_DIR}/${VERSION} ${DIST_NAME}
+- rm -rf ${DIST_FOLDER}
++# mv ${DIST_FOLDER}/Makefile.patched ${DIST_FOLDER}/Makefile
++# tar -czf ${DIST_FILE} -C ${DIST_DIR}/${VERSION} ${DIST_NAME}
++# rm -rf ${DIST_FOLDER}
+
+ .PHONY: test install all api.markdown bundle tarball
+
--- /dev/null
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI=4
+
+inherit eutils toolchain-funcs multilib
+
+DESCRIPTION="Takes node.js' architecture and dependencies and fits it in the Lua language"
+HOMEPAGE="http://luvit.io/"
+SRC_URI="http://${PN}.io/dist/${PV}/${P}.tar.gz"
+
+KEYWORDS="~amd64 ~x86"
+SLOT="0"
+IUSE=""
+LICENSE="Apache-2.0 MIT"
+
+# fails in portage environment
+# succeeds if run manually
+RESTRICT="test"
+
+RDEPEND="dev-lang/luajit:2
+ >=dev-libs/yajl-2.0.2
+ net-libs/http-parser
+ dev-libs/libuv"
+DEPEND="${RDEPEND}
+ dev-util/pkgconfig"
+
+src_prepare() {
+ # fix build system and remove references
+ # to bundled sources
+ epatch "${FILESDIR}"/${PV}-makefile.patch \
+ "${FILESDIR}"/${PV}-includes.patch
+
+ sed \
+ -e "s:^YAJL_VERSION=.*:YAJL_VERSION=$(pkg-config --modversion yajl):" \
+ -e "s:^LUAJIT_VERSION=.*:LUAJIT_VERSION=$(pkg-config --modversion luajit):" \
+ -i Makefile || die "sed failed"
+}
+
+src_configure() {
+ # skip python build system
+ :
+}
+
+src_compile() {
+ rm -r deps || die
+
+ tc-export CC AR
+
+ emake all
+}
+
+src_install() {
+ emake PREFIX=/usr LIBDIR=$(get_libdir) DESTDIR="${D}" install
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>maintainer-wanted@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>