[packages/lua-luv] Add lua-luv 1.36.0.0 package

glen glen at pld-linux.org
Fri Nov 6 15:33:16 CET 2020


commit 754ed7688dea6ca1fd1dda2fb38a794ac3ae7278
Author: Elan Ruusamäe <glen at pld-linux.org>
Date:   Fri Nov 6 14:45:50 2020 +0200

    Add lua-luv 1.36.0.0 package
    
    Based on fedora package, 94ef75e

 README.md                |  3 ++
 lua-luv.spec             | 90 ++++++++++++++++++++++++++++++++++++++++++++++++
 luv-1.36.0-lua-5.4.patch | 36 +++++++++++++++++++
 3 files changed, 129 insertions(+)
---
diff --git a/lua-luv.spec b/lua-luv.spec
new file mode 100644
index 0000000..bf748dd
--- /dev/null
+++ b/lua-luv.spec
@@ -0,0 +1,90 @@
+%global real_version 1.36.0
+%global extra_version 0
+Summary:	Bare libuv bindings for lua
+Name:		lua-luv
+Version:	%{real_version}.%{extra_version}
+Release:	1
+License:	Apache v2.0
+BuildRequires:	cmake
+BuildRequires:	libuv-devel
+BuildRequires:	lua-devel >= 5.4
+Source0:	https://github.com/luvit/luv/archive/%{real_version}-%{extra_version}/luv-%{version}.tar.gz
+# Source0-md5:	5b9efde8652056faeb5ffc8f62f2b595
+Patch0:		luv-1.36.0-lua-5.4.patch
+URL:		https://github.com/luvit/luv
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+This library makes libuv available to lua scripts. It was made for the
+luvit project but should usable from nearly any lua project.
+
+The library can be used by multiple threads at once. Each thread is
+assumed to load the library from a different lua_State. Luv will
+create a unique uv_loop_t for each state. You can't share uv handles
+between states/loops.
+
+The best docs currently are the libuv docs themselves. Hopefully soon
+we'll have a copy locally tailored for lua.
+
+%package devel
+Summary:	Development files for lua-luv
+Requires:	lua-luv = %{version}-%{release}
+
+%description devel
+Files required for lua-luv development
+
+%prep
+%autosetup -p1 -n luv-%{real_version}-%{extra_version}
+
+# Remove bundled dependencies
+rm -r deps
+# Remove network sensitive tests gh#luvit/luv#340
+rm -f tests/test-dns.lua
+
+%build
+install -d build
+cd build
+%cmake \
+	-DWITH_SHARED_LIBUV=ON \
+	-DBUILD_MODULE=ON \
+	-DBUILD_SHARED_LIBS=ON \
+	-DWITH_LUA_ENGINE=Lua \
+	-DLUA_BUILD_TYPE=System \
+	-DINSTALL_LIB_DIR=%{_libdir} \
+	-DLUA_INCLUDE_DIR=%{_includedir}/lua5.4 \
+	..
+cd ..
+
+%{__make} -C build
+
+%if %{with tests}
+ln -sfn build/luv.so luv.so
+lua tests/run.lua
+rm luv.so
+%endif
+
+%install
+rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT%{_libdir}/lua/5.4
+install -p build/luv.so $RPM_BUILD_ROOT%{_libdir}/lua/5.4/luv.so
+
+install -d $RPM_BUILD_ROOT%{_includedir}/lua5.4/luv
+for f in lhandle.h lreq.h luv.h util.h; do
+	install -m 0644 -p src/$f $RPM_BUILD_ROOT%{_includedir}/lua5.4/luv/$f
+done
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(644,root,root,755)
+%doc README.md
+%attr(755,root,root) %{_libdir}/lua/5.4/luv.so
+
+%files devel
+%defattr(644,root,root,755)
+%dir %{_includedir}/lua5.4/luv
+%{_includedir}/lua5.4/luv/lhandle.h
+%{_includedir}/lua5.4/luv/lreq.h
+%{_includedir}/lua5.4/luv/luv.h
+%{_includedir}/lua5.4/luv/util.h
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..18a54fe
--- /dev/null
+++ b/README.md
@@ -0,0 +1,3 @@
+# lua-luv
+
+The lua-luv package
\ No newline at end of file
diff --git a/luv-1.36.0-lua-5.4.patch b/luv-1.36.0-lua-5.4.patch
new file mode 100644
index 0000000..c33641c
--- /dev/null
+++ b/luv-1.36.0-lua-5.4.patch
@@ -0,0 +1,36 @@
+diff -up luv-1.36.0-0/src/luv.c.lua54 luv-1.36.0-0/src/luv.c
+--- luv-1.36.0-0/src/luv.c.lua54	2020-06-30 13:51:22.099551123 -0400
++++ luv-1.36.0-0/src/luv.c	2020-06-30 13:51:32.299385613 -0400
+@@ -16,7 +16,7 @@
+  */
+ 
+ #include <lua.h>
+-#if (LUA_VERSION_NUM != 503)
++#if LUA_VERSION_NUM < 503
+ #include "compat-5.3.h"
+ #endif
+ #include "luv.h"
+diff -up luv-1.36.0-0/src/private.h.lua54 luv-1.36.0-0/src/private.h
+--- luv-1.36.0-0/src/private.h.lua54	2020-06-30 13:51:04.843831128 -0400
++++ luv-1.36.0-0/src/private.h	2020-06-30 13:51:13.179695862 -0400
+@@ -2,7 +2,7 @@
+ #define LUV_PRIVATE_H
+ 
+ #include <lua.h>
+-#if (LUA_VERSION_NUM != 503)
++#if LUA_VERSION_NUM < 503
+ #include "compat-5.3.h"
+ #endif
+ 
+diff -up luv-1.36.0-0/CMakeLists.txt.lua54 luv-1.36.0-0/CMakeLists.txt
+--- luv-1.36.0-0/CMakeLists.txt.lua54	2020-06-30 14:04:54.323356407 -0400
++++ luv-1.36.0-0/CMakeLists.txt	2020-06-30 14:05:16.083002829 -0400
+@@ -94,7 +94,7 @@ if (LUA)
+     NO_DEFAULT_PATH)
+   ELSEIF(LUA_EXEC_NAME MATCHES "lua.*")
+     FIND_LIBRARY(LUA_LIBRARIES
+-      NAMES lua lua53 lua52 lua51 liblua liblua53 liblua52 liblua51
++      NAMES lua lua54 lua53 lua52 lua51 liblua liblua54 liblua53 liblua52 liblua51
+       PATHS ${LUA_LIBDIR}
+       NO_DEFAULT_PATH)
+   ENDIF()
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/lua-luv.git/commitdiff/754ed7688dea6ca1fd1dda2fb38a794ac3ae7278



More information about the pld-cvs-commit mailing list