diff mbox

ljsyscall: new package

Message ID 1380070732-1834-1-git-send-email-danomimanchego123@gmail.com
State Superseded
Headers show

Commit Message

Danomi Manchego Sept. 25, 2013, 12:58 a.m. UTC
An FFI implementation of the Linux and NetBSD kernel ABIs for LuaJIT.

Signed-off-by: Danomi Manchego <danomimanchego123@gmail.com>

---

Note: this package requires LuaJIT specifically, so there is a depends-on
in the ljsyscall/Config.in, even though though it is included from a
menu with a "if BR2_PACKAGE_LUA || BR2_PACKAGE_LUAJIT" test around it.
---
 package/Config.in              |    1 +
 package/ljsyscall/Config.in    |    8 ++++++++
 package/ljsyscall/ljsyscall.mk |   36 ++++++++++++++++++++++++++++++++++++
 3 files changed, 45 insertions(+)
 create mode 100644 package/ljsyscall/Config.in
 create mode 100644 package/ljsyscall/ljsyscall.mk

Comments

Thomas De Schampheleire Sept. 25, 2013, 6:04 a.m. UTC | #1
Danomi Manchego <danomimanchego123@gmail.com> wrote:
>An FFI implementation of the Linux and NetBSD kernel ABIs for LuaJIT.
>
>Signed-off-by: Danomi Manchego <danomimanchego123@gmail.com>
>
>---
>
>Note: this package requires LuaJIT specifically, so there is a depends-on
>in the ljsyscall/Config.in, even though though it is included from a
>menu with a "if BR2_PACKAGE_LUA || BR2_PACKAGE_LUAJIT" test around it.
>---
> package/Config.in              |    1 +
> package/ljsyscall/Config.in    |    8 ++++++++
> package/ljsyscall/ljsyscall.mk |   36 ++++++++++++++++++++++++++++++++++++
> 3 files changed, 45 insertions(+)
> create mode 100644 package/ljsyscall/Config.in
> create mode 100644 package/ljsyscall/ljsyscall.mk
>
>diff --git a/package/Config.in b/package/Config.in
>index 1dd60d1..457e5ad 100644
>--- a/package/Config.in
>+++ b/package/Config.in
>@@ -355,6 +355,7 @@ source "package/cgilua/Config.in"
> source "package/copas/Config.in"
> source "package/coxpcall/Config.in"
> source "package/lbase64/Config.in"
>+source "package/ljsyscall/Config.in"
> source "package/luabitop/Config.in"
> source "package/luacjson/Config.in"
> source "package/luacrypto/Config.in"
>diff --git a/package/ljsyscall/Config.in b/package/ljsyscall/Config.in
>new file mode 100644
>index 0000000..0bed738
>--- /dev/null
>+++ b/package/ljsyscall/Config.in
>@@ -0,0 +1,8 @@
>+config BR2_PACKAGE_LJSYSCALL
>+	bool "ljsyscall"
>+	# ljsyscall is specifically for LuaJIT, not Lua.
>+	depends on BR2_PACKAGE_LUAJIT
>+	help
>+	  An FFI implementation of the Linux and NetBSD kernel ABIs for LuaJIT.
>+
>+	  http://github.com/justincormack/ljsyscall
>diff --git a/package/ljsyscall/ljsyscall.mk b/package/ljsyscall/ljsyscall.mk
>new file mode 100644
>index 0000000..25a5ec9
>--- /dev/null
>+++ b/package/ljsyscall/ljsyscall.mk
>@@ -0,0 +1,36 @@
>+################################################################################
>+#
>+# ljsyscall
>+#
>+################################################################################
>+
>+LJSYSCALL_VERSION = v0.8
>+LJSYSCALL_SITE = http://github.com/justincormack/ljsyscall/tarball/$(LJSYSCALL_VERSION)
>+LJSYSCALL_DEPENDENCIES = luajit
>+LJSYSCALL_LICENSE = MIT
>+LJSYSCALL_LICENSE_FILES = COPYRIGHT
>+
>+ifeq ($(BR2_i386),y)
>+LJSYSCALL_ARCH = x86
>+endif
>+ifeq ($(BR2_x86_64),y)
>+LJSYSCALL_ARCH = x64
>+endif
>+ifeq ($(BR2_powerpc),y)
>+LJSYSCALL_ARCH = ppc
>+endif
>+ifeq ($(LJSYSCALL_ARCH),)
>+LJSYSCALL_ARCH = $(BR2_ARCH)
>+endif
>+
>+define LJSYSCALL_INSTALL_TARGET_CMDS
>+	$(INSTALL) -d $(TARGET_DIR)/usr/share/luajit-$(LUAJIT_VERSION)/syscall
>+	$(INSTALL) -t $(TARGET_DIR)/usr/share/luajit-$(LUAJIT_VERSION)/ $(@D)/syscall.lua
>+	$(INSTALL) -t $(TARGET_DIR)/usr/share/luajit-$(LUAJIT_VERSION)/syscall $(@D)/syscall/*.lua
>+
>+	$(INSTALL) -d $(TARGET_DIR)/usr/share/luajit-$(LUAJIT_VERSION)/syscall/linux/$(LJSYSCALL_ARCH)
>+	$(INSTALL) -t $(TARGET_DIR)/usr/share/luajit-$(LUAJIT_VERSION)/syscall/linux/ $(@D)/syscall/linux/*.lua
>+	$(INSTALL) -t $(TARGET_DIR)/usr/share/luajit-$(LUAJIT_VERSION)/syscall/linux/$(LJSYSCALL_ARCH) $(@D)/syscall/linux/$(LJSYSCALL_ARCH)/*.lua
>+endef

Any specific reason why the standard install rule doesn't work?

>+
>+$(eval $(generic-package))

Best regards,
Thomas
Francois Perrad Sept. 25, 2013, 11:31 a.m. UTC | #2
2013/9/25 Danomi Manchego <danomimanchego123@gmail.com>:
> An FFI implementation of the Linux and NetBSD kernel ABIs for LuaJIT.
>
> Signed-off-by: Danomi Manchego <danomimanchego123@gmail.com>
>
> ---
>
> Note: this package requires LuaJIT specifically, so there is a depends-on
> in the ljsyscall/Config.in, even though though it is included from a
> menu with a "if BR2_PACKAGE_LUA || BR2_PACKAGE_LUAJIT" test around it.
> ---
>  package/Config.in              |    1 +
>  package/ljsyscall/Config.in    |    8 ++++++++
>  package/ljsyscall/ljsyscall.mk |   36 ++++++++++++++++++++++++++++++++++++
>  3 files changed, 45 insertions(+)
>  create mode 100644 package/ljsyscall/Config.in
>  create mode 100644 package/ljsyscall/ljsyscall.mk
>
> diff --git a/package/Config.in b/package/Config.in
> index 1dd60d1..457e5ad 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -355,6 +355,7 @@ source "package/cgilua/Config.in"
>  source "package/copas/Config.in"
>  source "package/coxpcall/Config.in"
>  source "package/lbase64/Config.in"
> +source "package/ljsyscall/Config.in"
>  source "package/luabitop/Config.in"
>  source "package/luacjson/Config.in"
>  source "package/luacrypto/Config.in"
> diff --git a/package/ljsyscall/Config.in b/package/ljsyscall/Config.in
> new file mode 100644
> index 0000000..0bed738
> --- /dev/null
> +++ b/package/ljsyscall/Config.in
> @@ -0,0 +1,8 @@
> +config BR2_PACKAGE_LJSYSCALL
> +       bool "ljsyscall"
> +       # ljsyscall is specifically for LuaJIT, not Lua.
> +       depends on BR2_PACKAGE_LUAJIT

not available on all architecture
    depends on BR2_i386 || BR2_x86_64 || BR2_arm || BR2_powerpc || BR2_mips

François

> +       help
> +         An FFI implementation of the Linux and NetBSD kernel ABIs for LuaJIT.
> +
> +         http://github.com/justincormack/ljsyscall
> diff --git a/package/ljsyscall/ljsyscall.mk b/package/ljsyscall/ljsyscall.mk
> new file mode 100644
> index 0000000..25a5ec9
> --- /dev/null
> +++ b/package/ljsyscall/ljsyscall.mk
> @@ -0,0 +1,36 @@
> +################################################################################
> +#
> +# ljsyscall
> +#
> +################################################################################
> +
> +LJSYSCALL_VERSION = v0.8
> +LJSYSCALL_SITE = http://github.com/justincormack/ljsyscall/tarball/$(LJSYSCALL_VERSION)
> +LJSYSCALL_DEPENDENCIES = luajit
> +LJSYSCALL_LICENSE = MIT
> +LJSYSCALL_LICENSE_FILES = COPYRIGHT
> +
> +ifeq ($(BR2_i386),y)
> +LJSYSCALL_ARCH = x86
> +endif
> +ifeq ($(BR2_x86_64),y)
> +LJSYSCALL_ARCH = x64
> +endif
> +ifeq ($(BR2_powerpc),y)
> +LJSYSCALL_ARCH = ppc
> +endif
> +ifeq ($(LJSYSCALL_ARCH),)
> +LJSYSCALL_ARCH = $(BR2_ARCH)
> +endif
> +
> +define LJSYSCALL_INSTALL_TARGET_CMDS
> +       $(INSTALL) -d $(TARGET_DIR)/usr/share/luajit-$(LUAJIT_VERSION)/syscall
> +       $(INSTALL) -t $(TARGET_DIR)/usr/share/luajit-$(LUAJIT_VERSION)/ $(@D)/syscall.lua
> +       $(INSTALL) -t $(TARGET_DIR)/usr/share/luajit-$(LUAJIT_VERSION)/syscall $(@D)/syscall/*.lua
> +
> +       $(INSTALL) -d $(TARGET_DIR)/usr/share/luajit-$(LUAJIT_VERSION)/syscall/linux/$(LJSYSCALL_ARCH)
> +       $(INSTALL) -t $(TARGET_DIR)/usr/share/luajit-$(LUAJIT_VERSION)/syscall/linux/ $(@D)/syscall/linux/*.lua
> +       $(INSTALL) -t $(TARGET_DIR)/usr/share/luajit-$(LUAJIT_VERSION)/syscall/linux/$(LJSYSCALL_ARCH) $(@D)/syscall/linux/$(LJSYSCALL_ARCH)/*.lua
> +endef
> +
> +$(eval $(generic-package))
> --
> 1.7.9.5
>
> _______________________________________________
> buildroot mailing list
> buildroot@busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
Francois Perrad Sept. 25, 2013, 11:41 a.m. UTC | #3
2013/9/25 Danomi Manchego <danomimanchego123@gmail.com>:
> An FFI implementation of the Linux and NetBSD kernel ABIs for LuaJIT.
>
> Signed-off-by: Danomi Manchego <danomimanchego123@gmail.com>
>
> ---
>
> Note: this package requires LuaJIT specifically, so there is a depends-on
> in the ljsyscall/Config.in, even though though it is included from a
> menu with a "if BR2_PACKAGE_LUA || BR2_PACKAGE_LUAJIT" test around it.
> ---
>  package/Config.in              |    1 +
>  package/ljsyscall/Config.in    |    8 ++++++++
>  package/ljsyscall/ljsyscall.mk |   36 ++++++++++++++++++++++++++++++++++++
>  3 files changed, 45 insertions(+)
>  create mode 100644 package/ljsyscall/Config.in
>  create mode 100644 package/ljsyscall/ljsyscall.mk
>
> diff --git a/package/Config.in b/package/Config.in
> index 1dd60d1..457e5ad 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -355,6 +355,7 @@ source "package/cgilua/Config.in"
>  source "package/copas/Config.in"
>  source "package/coxpcall/Config.in"
>  source "package/lbase64/Config.in"
> +source "package/ljsyscall/Config.in"
>  source "package/luabitop/Config.in"
>  source "package/luacjson/Config.in"
>  source "package/luacrypto/Config.in"
> diff --git a/package/ljsyscall/Config.in b/package/ljsyscall/Config.in
> new file mode 100644
> index 0000000..0bed738
> --- /dev/null
> +++ b/package/ljsyscall/Config.in
> @@ -0,0 +1,8 @@
> +config BR2_PACKAGE_LJSYSCALL
> +       bool "ljsyscall"
> +       # ljsyscall is specifically for LuaJIT, not Lua.
> +       depends on BR2_PACKAGE_LUAJIT
> +       help
> +         An FFI implementation of the Linux and NetBSD kernel ABIs for LuaJIT.
> +
> +         http://github.com/justincormack/ljsyscall
> diff --git a/package/ljsyscall/ljsyscall.mk b/package/ljsyscall/ljsyscall.mk
> new file mode 100644
> index 0000000..25a5ec9
> --- /dev/null
> +++ b/package/ljsyscall/ljsyscall.mk
> @@ -0,0 +1,36 @@
> +################################################################################
> +#
> +# ljsyscall
> +#
> +################################################################################
> +
> +LJSYSCALL_VERSION = v0.8
> +LJSYSCALL_SITE = http://github.com/justincormack/ljsyscall/tarball/$(LJSYSCALL_VERSION)
> +LJSYSCALL_DEPENDENCIES = luajit

this built time dependency is useless.

> +LJSYSCALL_LICENSE = MIT
> +LJSYSCALL_LICENSE_FILES = COPYRIGHT
> +
> +ifeq ($(BR2_i386),y)
> +LJSYSCALL_ARCH = x86
> +endif
> +ifeq ($(BR2_x86_64),y)
> +LJSYSCALL_ARCH = x64
> +endif
> +ifeq ($(BR2_powerpc),y)
> +LJSYSCALL_ARCH = ppc
> +endif
> +ifeq ($(LJSYSCALL_ARCH),)
> +LJSYSCALL_ARCH = $(BR2_ARCH)
> +endif
> +
> +define LJSYSCALL_INSTALL_TARGET_CMDS
> +       $(INSTALL) -d $(TARGET_DIR)/usr/share/luajit-$(LUAJIT_VERSION)/syscall
> +       $(INSTALL) -t $(TARGET_DIR)/usr/share/luajit-$(LUAJIT_VERSION)/ $(@D)/syscall.lua
> +       $(INSTALL) -t $(TARGET_DIR)/usr/share/luajit-$(LUAJIT_VERSION)/syscall $(@D)/syscall/*.lua
> +
> +       $(INSTALL) -d $(TARGET_DIR)/usr/share/luajit-$(LUAJIT_VERSION)/syscall/linux/$(LJSYSCALL_ARCH)
> +       $(INSTALL) -t $(TARGET_DIR)/usr/share/luajit-$(LUAJIT_VERSION)/syscall/linux/ $(@D)/syscall/linux/*.lua
> +       $(INSTALL) -t $(TARGET_DIR)/usr/share/luajit-$(LUAJIT_VERSION)/syscall/linux/$(LJSYSCALL_ARCH) $(@D)/syscall/linux/$(LJSYSCALL_ARCH)/*.lua

the 'x' bit is not needed for *.lua files, so use $(INSTALL) with -m 0644

François

> +endef
> +
> +$(eval $(generic-package))
> --
> 1.7.9.5
>
> _______________________________________________
> buildroot mailing list
> buildroot@busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
Danomi Manchego Sept. 25, 2013, 12:58 p.m. UTC | #4
Thomas,

On Wed, Sep 25, 2013 at 2:04 AM, Thomas De Schampheleire
<patrickdepinguin@gmail.com> wrote:
>>+define LJSYSCALL_INSTALL_TARGET_CMDS
>>+      $(INSTALL) -d $(TARGET_DIR)/usr/share/luajit-$(LUAJIT_VERSION)/syscall
>>+      $(INSTALL) -t $(TARGET_DIR)/usr/share/luajit-$(LUAJIT_VERSION)/ $(@D)/syscall.lua
>>+      $(INSTALL) -t $(TARGET_DIR)/usr/share/luajit-$(LUAJIT_VERSION)/syscall $(@D)/syscall/*.lua
>>+
>>+      $(INSTALL) -d $(TARGET_DIR)/usr/share/luajit-$(LUAJIT_VERSION)/syscall/linux/$(LJSYSCALL_ARCH)
>>+      $(INSTALL) -t $(TARGET_DIR)/usr/share/luajit-$(LUAJIT_VERSION)/syscall/linux/ $(@D)/syscall/linux/*.lua
>>+      $(INSTALL) -t $(TARGET_DIR)/usr/share/luajit-$(LUAJIT_VERSION)/syscall/linux/$(LJSYSCALL_ARCH) $(@D)/syscall/linux/$(LJSYSCALL_ARCH)/*.lua
>>+endef
>
> Any specific reason why the standard install rule doesn't work?

By "standard install rule", do you mean "$(INSTALL) -D srcfile
dstfile"?  I couldn't get the directory creation to work while using
wildcards, just single files.  So I just left it as-is.

Is it the -t that offends?
Thomas De Schampheleire Sept. 25, 2013, 1:01 p.m. UTC | #5
Danomi Manchego <danomimanchego123@gmail.com> wrote:
>Thomas,
>
>On Wed, Sep 25, 2013 at 2:04 AM, Thomas De Schampheleire
><patrickdepinguin@gmail.com> wrote:
>>>+define LJSYSCALL_INSTALL_TARGET_CMDS
>>>+      $(INSTALL) -d $(TARGET_DIR)/usr/share/luajit-$(LUAJIT_VERSION)/syscall
>>>+      $(INSTALL) -t $(TARGET_DIR)/usr/share/luajit-$(LUAJIT_VERSION)/ $(@D)/syscall.lua
>>>+      $(INSTALL) -t $(TARGET_DIR)/usr/share/luajit-$(LUAJIT_VERSION)/syscall $(@D)/syscall/*.lua
>>>+
>>>+      $(INSTALL) -d $(TARGET_DIR)/usr/share/luajit-$(LUAJIT_VERSION)/syscall/linux/$(LJSYSCALL_ARCH)
>>>+      $(INSTALL) -t $(TARGET_DIR)/usr/share/luajit-$(LUAJIT_VERSION)/syscall/linux/ $(@D)/syscall/linux/*.lua
>>>+      $(INSTALL) -t $(TARGET_DIR)/usr/share/luajit-$(LUAJIT_VERSION)/syscall/linux/$(LJSYSCALL_ARCH) $(@D)/syscall/linux/$(LJSYSCALL_ARCH)/*.lua
>>>+endef
>>
>> Any specific reason why the standard install rule doesn't work?
>
>By "standard install rule", do you mean "$(INSTALL) -D srcfile
>dstfile"?  I couldn't get the directory creation to work while using
>wildcards, just single files.  So I just left it as-is.
>
>Is it the -t that offends?

What I meant was 'make install' in the package directory (I'm assuming make is used)

Best regards,
Thomas
Danomi Manchego Sept. 25, 2013, 1:06 p.m. UTC | #6
Thomas,

On Wed, Sep 25, 2013 at 9:01 AM, Thomas De Schampheleire
<patrickdepinguin@gmail.com> wrote:
> Danomi Manchego <danomimanchego123@gmail.com> wrote:
>>Thomas,
>>
>>On Wed, Sep 25, 2013 at 2:04 AM, Thomas De Schampheleire
>><patrickdepinguin@gmail.com> wrote:
>>>>+define LJSYSCALL_INSTALL_TARGET_CMDS
>>>>+      $(INSTALL) -d $(TARGET_DIR)/usr/share/luajit-$(LUAJIT_VERSION)/syscall
>>>>+      $(INSTALL) -t $(TARGET_DIR)/usr/share/luajit-$(LUAJIT_VERSION)/ $(@D)/syscall.lua
>>>>+      $(INSTALL) -t $(TARGET_DIR)/usr/share/luajit-$(LUAJIT_VERSION)/syscall $(@D)/syscall/*.lua
>>>>+
>>>>+      $(INSTALL) -d $(TARGET_DIR)/usr/share/luajit-$(LUAJIT_VERSION)/syscall/linux/$(LJSYSCALL_ARCH)
>>>>+      $(INSTALL) -t $(TARGET_DIR)/usr/share/luajit-$(LUAJIT_VERSION)/syscall/linux/ $(@D)/syscall/linux/*.lua
>>>>+      $(INSTALL) -t $(TARGET_DIR)/usr/share/luajit-$(LUAJIT_VERSION)/syscall/linux/$(LJSYSCALL_ARCH) $(@D)/syscall/linux/$(LJSYSCALL_ARCH)/*.lua
>>>>+endef
>>>
>>> Any specific reason why the standard install rule doesn't work?
>>
>>By "standard install rule", do you mean "$(INSTALL) -D srcfile
>>dstfile"?  I couldn't get the directory creation to work while using
>>wildcards, just single files.  So I just left it as-is.
>>
>>Is it the -t that offends?
>
> What I meant was 'make install' in the package directory (I'm assuming make is used)

No, this is a pure lua package, no compilation, and no makefile.  You
just put all the *.lua files some place where LuaJIT will find them.

Danomi -
Danomi Manchego Sept. 25, 2013, 1:09 p.m. UTC | #7
François,

On Wed, Sep 25, 2013 at 7:31 AM, François Perrad >> diff --git
a/package/ljsyscall/Config.in b/package/ljsyscall/Config.in
>> new file mode 100644
>> index 0000000..0bed738
>> --- /dev/null
>> +++ b/package/ljsyscall/Config.in
>> @@ -0,0 +1,8 @@
>> +config BR2_PACKAGE_LJSYSCALL
>> +       bool "ljsyscall"
>> +       # ljsyscall is specifically for LuaJIT, not Lua.
>> +       depends on BR2_PACKAGE_LUAJIT
>
> not available on all architecture
>     depends on BR2_i386 || BR2_x86_64 || BR2_arm || BR2_powerpc || BR2_mips

True - but those conditions are already in LuaJIT, except even more
restrictive, so I didn't bother.  But I take the point, will add.

From your other email:  points taken, I'll remove the LuaJIT
dependency and the add -m0644.


Danomi -
Francois Perrad Sept. 25, 2013, 2:09 p.m. UTC | #8
2013/9/25 Danomi Manchego <danomimanchego123@gmail.com>:
> François,
>
> On Wed, Sep 25, 2013 at 7:31 AM, François Perrad >> diff --git
> a/package/ljsyscall/Config.in b/package/ljsyscall/Config.in
>>> new file mode 100644
>>> index 0000000..0bed738
>>> --- /dev/null
>>> +++ b/package/ljsyscall/Config.in
>>> @@ -0,0 +1,8 @@
>>> +config BR2_PACKAGE_LJSYSCALL
>>> +       bool "ljsyscall"
>>> +       # ljsyscall is specifically for LuaJIT, not Lua.
>>> +       depends on BR2_PACKAGE_LUAJIT
>>
>> not available on all architecture
>>     depends on BR2_i386 || BR2_x86_64 || BR2_arm || BR2_powerpc || BR2_mips
>
> True - but those conditions are already in LuaJIT, except even more
> restrictive, so I didn't bother.  But I take the point, will add.
>

You are right, conditions are already in LuaJIT.
Them don't need duplication.

François

> From your other email:  points taken, I'll remove the LuaJIT
> dependency and the add -m0644.
>
>
> Danomi -
Thomas De Schampheleire Sept. 25, 2013, 2:39 p.m. UTC | #9
Danomi Manchego <danomimanchego123@gmail.com> wrote:
>Thomas,
snip
>>>> Any specific reason why the standard install rule doesn't work?
>>>
>>>By "standard install rule", do you mean "$(INSTALL) -D srcfile
>>>dstfile"?  I couldn't get the directory creation to work while using
>>>wildcards, just single files.  So I just left it as-is.
>>>
>>>Is it the -t that offends?
>>
>> What I meant was 'make install' in the package directory (I'm assuming make is used)
>
>No, this is a pure lua package, no compilation, and no makefile.  You
>just put all the *.lua files some place where LuaJIT will find them.

Ok, thanks for the clarification.

Best regards,
Thomas
diff mbox

Patch

diff --git a/package/Config.in b/package/Config.in
index 1dd60d1..457e5ad 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -355,6 +355,7 @@  source "package/cgilua/Config.in"
 source "package/copas/Config.in"
 source "package/coxpcall/Config.in"
 source "package/lbase64/Config.in"
+source "package/ljsyscall/Config.in"
 source "package/luabitop/Config.in"
 source "package/luacjson/Config.in"
 source "package/luacrypto/Config.in"
diff --git a/package/ljsyscall/Config.in b/package/ljsyscall/Config.in
new file mode 100644
index 0000000..0bed738
--- /dev/null
+++ b/package/ljsyscall/Config.in
@@ -0,0 +1,8 @@ 
+config BR2_PACKAGE_LJSYSCALL
+	bool "ljsyscall"
+	# ljsyscall is specifically for LuaJIT, not Lua.
+	depends on BR2_PACKAGE_LUAJIT
+	help
+	  An FFI implementation of the Linux and NetBSD kernel ABIs for LuaJIT.
+
+	  http://github.com/justincormack/ljsyscall
diff --git a/package/ljsyscall/ljsyscall.mk b/package/ljsyscall/ljsyscall.mk
new file mode 100644
index 0000000..25a5ec9
--- /dev/null
+++ b/package/ljsyscall/ljsyscall.mk
@@ -0,0 +1,36 @@ 
+################################################################################
+#
+# ljsyscall
+#
+################################################################################
+
+LJSYSCALL_VERSION = v0.8
+LJSYSCALL_SITE = http://github.com/justincormack/ljsyscall/tarball/$(LJSYSCALL_VERSION)
+LJSYSCALL_DEPENDENCIES = luajit
+LJSYSCALL_LICENSE = MIT
+LJSYSCALL_LICENSE_FILES = COPYRIGHT
+
+ifeq ($(BR2_i386),y)
+LJSYSCALL_ARCH = x86
+endif
+ifeq ($(BR2_x86_64),y)
+LJSYSCALL_ARCH = x64
+endif
+ifeq ($(BR2_powerpc),y)
+LJSYSCALL_ARCH = ppc
+endif
+ifeq ($(LJSYSCALL_ARCH),)
+LJSYSCALL_ARCH = $(BR2_ARCH)
+endif
+
+define LJSYSCALL_INSTALL_TARGET_CMDS
+	$(INSTALL) -d $(TARGET_DIR)/usr/share/luajit-$(LUAJIT_VERSION)/syscall
+	$(INSTALL) -t $(TARGET_DIR)/usr/share/luajit-$(LUAJIT_VERSION)/ $(@D)/syscall.lua
+	$(INSTALL) -t $(TARGET_DIR)/usr/share/luajit-$(LUAJIT_VERSION)/syscall $(@D)/syscall/*.lua
+
+	$(INSTALL) -d $(TARGET_DIR)/usr/share/luajit-$(LUAJIT_VERSION)/syscall/linux/$(LJSYSCALL_ARCH)
+	$(INSTALL) -t $(TARGET_DIR)/usr/share/luajit-$(LUAJIT_VERSION)/syscall/linux/ $(@D)/syscall/linux/*.lua
+	$(INSTALL) -t $(TARGET_DIR)/usr/share/luajit-$(LUAJIT_VERSION)/syscall/linux/$(LJSYSCALL_ARCH) $(@D)/syscall/linux/$(LJSYSCALL_ARCH)/*.lua
+endef
+
+$(eval $(generic-package))