]> git.pld-linux.org Git - SPECS.git/blob - lua-luv.spec
SPECS updated Sun 1 Aug 20:13:02 CEST 2021
[SPECS.git] / lua-luv.spec
1 %global real_version 1.36.0
2 %global extra_version 0
3 Summary:        Bare libuv bindings for lua
4 Name:           lua-luv
5 Version:        %{real_version}.%{extra_version}
6 Release:        1
7 License:        Apache v2.0
8 BuildRequires:  cmake
9 BuildRequires:  libuv-devel
10 BuildRequires:  lua-devel >= 5.4
11 Source0:        https://github.com/luvit/luv/archive/%{real_version}-%{extra_version}/luv-%{version}.tar.gz
12 # Source0-md5:  5b9efde8652056faeb5ffc8f62f2b595
13 Patch0:         luv-1.36.0-lua-5.4.patch
14 URL:            https://github.com/luvit/luv
15 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
16
17 %description
18 This library makes libuv available to lua scripts. It was made for the
19 luvit project but should usable from nearly any lua project.
20
21 The library can be used by multiple threads at once. Each thread is
22 assumed to load the library from a different lua_State. Luv will
23 create a unique uv_loop_t for each state. You can't share uv handles
24 between states/loops.
25
26 The best docs currently are the libuv docs themselves. Hopefully soon
27 we'll have a copy locally tailored for lua.
28
29 %package devel
30 Summary:        Development files for lua-luv
31 Requires:       lua-luv = %{version}-%{release}
32
33 %description devel
34 Files required for lua-luv development
35
36 %prep
37 %autosetup -p1 -n luv-%{real_version}-%{extra_version}
38
39 # Remove bundled dependencies
40 rm -r deps
41 # Remove network sensitive tests gh#luvit/luv#340
42 rm -f tests/test-dns.lua
43
44 %build
45 install -d build
46 cd build
47 %cmake \
48         -DWITH_SHARED_LIBUV=ON \
49         -DBUILD_MODULE=ON \
50         -DBUILD_SHARED_LIBS=ON \
51         -DWITH_LUA_ENGINE=Lua \
52         -DLUA_BUILD_TYPE=System \
53         -DINSTALL_LIB_DIR=%{_libdir} \
54         -DLUA_INCLUDE_DIR=%{_includedir}/lua5.4 \
55         ..
56 cd ..
57
58 %{__make} -C build
59
60 %if %{with tests}
61 ln -sfn build/luv.so luv.so
62 lua tests/run.lua
63 rm luv.so
64 %endif
65
66 %install
67 rm -rf $RPM_BUILD_ROOT
68 install -d $RPM_BUILD_ROOT%{_libdir}/lua/5.4
69 install -p build/luv.so $RPM_BUILD_ROOT%{_libdir}/lua/5.4/luv.so
70
71 install -d $RPM_BUILD_ROOT%{_includedir}/lua5.4/luv
72 for f in lhandle.h lreq.h luv.h util.h; do
73         install -m 0644 -p src/$f $RPM_BUILD_ROOT%{_includedir}/lua5.4/luv/$f
74 done
75
76 %clean
77 rm -rf $RPM_BUILD_ROOT
78
79 %files
80 %defattr(644,root,root,755)
81 %doc README.md
82 %attr(755,root,root) %{_libdir}/lua/5.4/luv.so
83
84 %files devel
85 %defattr(644,root,root,755)
86 %dir %{_includedir}/lua5.4/luv
87 %{_includedir}/lua5.4/luv/lhandle.h
88 %{_includedir}/lua5.4/luv/lreq.h
89 %{_includedir}/lua5.4/luv/luv.h
90 %{_includedir}/lua5.4/luv/util.h
This page took 0.117772 seconds and 3 git commands to generate.