diff --git a/lua-link.patch b/lua-link.patch new file mode 100644 index 0000000..1450b32 --- /dev/null +++ b/lua-link.patch @@ -0,0 +1,11 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -260,7 +260,7 @@ + endif (USE_LUAJIT) + endif (LUA) + elseif("${CMAKE_SYSTEM_NAME}" MATCHES "Linux") +- target_link_libraries(${TARGET_NAME} ${LIBUV_LIBRARIES} rt) ++ target_link_libraries(${TARGET_NAME} ${LIBUV_LIBRARIES} rt lua) + else() + target_link_libraries(${TARGET_NAME} ${LIBUV_LIBRARIES}) + endif() diff --git a/lua-luv.changes b/lua-luv.changes index 9978502..55c58eb 100644 --- a/lua-luv.changes +++ b/lua-luv.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Tue Nov 16 22:20:25 UTC 2021 - Callum Farmer + +- Update to version 1.42.0-1: + * Use uv_handle_size/uv_req_size instead of sizeof + * LuaJIT: add missing LJ_ENDIAN and LJ_NO_UNWIND checks for DASM + [this fixes building on aarch64] +- Fix shared library build +- Clean spec file +- Add lua-link.patch: must link with -llua +- Add luv-module-install.patch: fix module install path + ------------------------------------------------------------------- Sat Apr 24 16:21:59 UTC 2021 - Matej Cepl diff --git a/lua-luv.spec b/lua-luv.spec index a065b56..c9b872f 100644 --- a/lua-luv.spec +++ b/lua-luv.spec @@ -16,57 +16,39 @@ # Please submit bugfixes or comments via https://bugs.opensuse.org/ # - +%ifluadefault +%define lua_default 1 +%endif %define mod_name luv %define upver 1.42.0-1 +%define fixver %(echo %{upver}|sed 's|-|~|g') %define libluv_sover 1 -%if 0%{?suse_version} -%define flavor @BUILD_FLAVOR@ -%else -%define flavor lua -%endif -%if 0%{?rhel} -%define __cmake cmake3 -BuildRequires: cmake3 -%else -BuildRequires: cmake -%endif -%if 0%{?fedora} || 0%{?rhel} -%define flavor lua -%endif -%bcond_with public_lib -%define lua_value %(echo "%{flavor}" |sed -e 's:lua::') +%define flavor @BUILD_FLAVOR@%{nil} %if "%{flavor}" == "" Name: lua-%{mod_name} ExclusiveArch: do_not_build %else Name: %{flavor}-%{mod_name} %endif -Version: 1.42.0 +Version: %{fixver} Release: 0 Summary: Bare libuv bindings for lua License: Apache-2.0 Group: Development/Languages/Other URL: https://github.com/luvit/%{mod_name} -Source: https://github.com/luvit/%{mod_name}/archive/%{upver}/%{mod_name}-%{upver}.tar.gz +Source0: https://github.com/luvit/%{mod_name}/releases/download/%{upver}/%{mod_name}-%{upver}.tar.gz +Patch0: lua-link.patch +Patch1: luv-module-install.patch +BuildRequires: cmake BuildRequires: libuv-devel BuildRequires: lua-macros -%lua_provides -%if 0%{?suse_version} && "%{flavor}" == "lua" -ExclusiveArch: do_not_build -%endif -%if 0%{?suse_version} BuildRequires: %{flavor}-devel BuildRequires: %{flavor}-luafilesystem -Requires: %{flavor} BuildRequires: %{flavor}-compat-5.3 -# not SUSE -%else -BuildRequires: lua-devel -BuildRequires: lua-filesystem -%endif -%if 0%{?rhel} -BuildRequires: lua-compat53 +Requires: %{flavor} +%lua_provides +%if "%{flavor}" == "lua" +ExclusiveArch: do_not_build %endif %description @@ -82,40 +64,39 @@ handles between states/loops. The best docs currently are the libuv docs themselves. Hopfully soon we'll have a copy locally tailored for lua. -%package devel +%ifluadefault +%package -n libluv-devel Summary: Header files for %{flavor}-%{mod_name} Group: Development/Languages/Other -Requires: %{flavor}-%{mod_name} = %{version} -%if %{with public_lib} -Requires: %{flavor}-libluv%{libluv_sover} -%endif +Requires: libluv%{libluv_sover} = %{version} -%description devel +%description -n libluv-devel This subpackage contains header files for developing applications that want to make use of %{flavor}-%{mod_name}. -%if %{with public_lib} -%package -n %{flavor}-libluv%{libluv_sover} +%package -n libluv%{libluv_sover} Summary: Lua bindings for libluv as a library Group: System/Libraries -%description -n %{flavor}-libluv%{libluv_sover} +%description -n libluv%{libluv_sover} This library makes libuv available to lua scripts. It was made for the luvit project but should usable from nearly any lua project. -%post -n %{flavor}-libluv%{libluv_sover} -p /sbin/ldconfig -%postun -n %{flavor}-libluv%{libluv_sover} -p /sbin/ldconfig +%post -n libluv%{libluv_sover} -p /sbin/ldconfig +%postun -n libluv%{libluv_sover} -p /sbin/ldconfig %endif %prep echo "Name is %{name}, Flavor is %{flavor}" -%autosetup -n %{mod_name}-%{upver} +%autosetup -p1 -n %{mod_name}-%{upver} %build %cmake \ -DWITH_SHARED_LIBUV=ON -DWITH_LUA_ENGINE=Lua \ --DLUA_BUILD_TYPE=System -DLUA=ON +-DLUA_BUILD_TYPE=System -DMODULE_INSTALL_LIB_DIR=%{lua_archdir} \ +-DSHAREDLIBS_INSTALL_LIB_DIR=%{_libdir} -DBUILD_SHARED_LIBS=OFF \ +%{?lua_default:-DBUILD_SHARED_LIBS=ON} %cmake_build %install @@ -126,15 +107,15 @@ echo "Name is %{name}, Flavor is %{flavor}" %doc *.md %{lua_archdir}/luv.so -%files devel +%ifluadefault +%files -n libluv-devel %license LICENSE.txt -%dir %{lua_incdir}/%{mod_name} -%{lua_incdir}/%{mod_name}/* -%if %{with public_lib} -%{lua_archdir}/libluv.so +%{_includedir}/%{mod_name} +%{_libdir}/libluv.so +%{_libdir}/pkgconfig/*.pc -%files -n %{flavor}-libluv%{libluv_sover} -%{lua_archdir}/libluv.so.* +%files -n libluv%{libluv_sover} +%{_libdir}/libluv.so.* %endif %changelog diff --git a/luv-module-install.patch b/luv-module-install.patch new file mode 100644 index 0000000..58f0301 --- /dev/null +++ b/luv-module-install.patch @@ -0,0 +1,12 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -271,7 +271,8 @@ + if (WIN32) + set(MODULE_INSTALL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib") + else (WIN32) +- set(MODULE_INSTALL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib/lua/${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}") ++ set(MODULE_INSTALL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib/lua/${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}" ++ CACHE PATH "Installation directory for module") + endif (WIN32) + endif (BUILD_MODULE) + if (BUILD_STATIC_LIBS)