From b9736ff78839e823035849cf7bf879871f90851de764ee34cde2380d48b380a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Li=C5=A1ka?= Date: Thu, 14 Jan 2021 16:15:44 +0000 Subject: [PATCH] Accepting request 863057 from home:Guillaume_G:branches:openSUSE:Factory:ARM - Fix build on aarch64 (luajit not supported yet) OBS-URL: https://build.opensuse.org/request/show/863057 OBS-URL: https://build.opensuse.org/package/show/editors/neovim?expand=0&rev=78 --- neovim-0.4.4-findlua54.patch | 32 +++++++++++++++++++++++ neovim.changes | 5 ++++ neovim.spec | 50 +++++++++++++++++++++++++++++++----- 3 files changed, 80 insertions(+), 7 deletions(-) create mode 100644 neovim-0.4.4-findlua54.patch diff --git a/neovim-0.4.4-findlua54.patch b/neovim-0.4.4-findlua54.patch new file mode 100644 index 0000000..1a3e0e0 --- /dev/null +++ b/neovim-0.4.4-findlua54.patch @@ -0,0 +1,32 @@ +From 26a47f998c4884df7ba96a0f3ad6b268a832ae10 Mon Sep 17 00:00:00 2001 +From: Michel Alexandre Salim +Date: Mon, 31 Aug 2020 18:11:02 -0700 +Subject: [PATCH] Patch FindLua to support locating Lua 5.4 + +Lua 5.4 is out, and will be shipped with Fedora 33. + +Since there are architectures where LuaJIT is not available, being able +to compile against Lua 5.4 is needed to get Neovim to build for this +release. + +Signed-off-by: Michel Alexandre Salim +--- + cmake/FindLua.cmake | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/cmake/FindLua.cmake b/cmake/FindLua.cmake +index b669a49f2..7ba13e1f5 100644 +--- a/cmake/FindLua.cmake ++++ b/cmake/FindLua.cmake +@@ -42,7 +42,7 @@ unset(_lua_append_versions) + + # this is a function only to have all the variables inside go away automatically + function(_lua_set_version_vars) +- set(LUA_VERSIONS5 5.3 5.2 5.1 5.0) ++ set(LUA_VERSIONS5 5.4 5.3 5.2 5.1 5.0) + + if (Lua_FIND_VERSION_EXACT) + if (Lua_FIND_VERSION_COUNT GREATER 1) +-- +2.26.2 + diff --git a/neovim.changes b/neovim.changes index 45ed71c..bf32f17 100644 --- a/neovim.changes +++ b/neovim.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Jan 12 09:36:47 UTC 2021 - Guillaume GARDET + +- Fix build on aarch64 (luajit not supported yet) + ------------------------------------------------------------------- Wed Aug 5 13:31:44 UTC 2020 - Matej Cepl diff --git a/neovim.spec b/neovim.spec index e89933b..7e48780 100644 --- a/neovim.spec +++ b/neovim.spec @@ -1,7 +1,7 @@ # # spec file for package neovim # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,6 +16,22 @@ # +# Luajit not available on all platforms +%ifarch %{arm} %{ix86} x86_64 +%bcond_without luajit +%else +%bcond_with luajit +%endif +%if %{with luajit} +%define luaver 5.1 +%define luaver_nopoint 51 +%else +%define luaver 5.4 +%define luaver_nopoint 54 +%endif + +%define luv_min_ver 1.30.0 + Name: neovim Version: 0.4.4 Release: 0 @@ -35,6 +51,8 @@ Patch1: neovim-0.1.7-bitop.patch # PATCH-FIX-SLE libuv-compat.patch sr#793088 gh#neovim/neovim#12108 mcepl@suse.com # works around too old version of libuv on Leap 15.* Patch2: libuv-compat.patch +# PATCH-FIx-UPSTREAM https://github.com/neovim/neovim/pull/12820 +Patch3: neovim-0.4.4-findlua54.patch BuildRequires: cmake BuildRequires: desktop-file-utils BuildRequires: fdupes @@ -50,12 +68,29 @@ BuildRequires: libtool BuildRequires: libuv-devel BuildRequires: libvterm-devel >= 0.1 BuildRequires: lua-macros + +%if %{with luajit} +# luajit implements version 5.1 of the lua language spec, so it needs the +# compat versions of libs. BuildRequires: lua51-LPeg BuildRequires: lua51-bit32 BuildRequires: lua51-luarocks -BuildRequires: lua51-luv-devel +BuildRequires: lua51-luv-devel >= %{luv_min_ver} BuildRequires: lua51-mpack BuildRequires: luajit-devel +Requires: lua51-bit32 +Requires: lua51-luv >= %{luv_min_ver} +%else +BuildRequires: lua%{luaver_nopoint}-devel +BuildRequires: lua%{luaver_nopoint}-lpeg +BuildRequires: lua%{luaver_nopoint}-luarocks +BuildRequires: lua%{luaver_nopoint}-luv-devel >= %{luv_min_ver} +BuildRequires: lua%{luaver_nopoint}-mpack +Requires: lua%{luaver_nopoint}-luv >= %{luv_min_ver} +# built-in bit32 removed in Lua 5.4 +BuildRequires: lua%{luaver_nopoint}-compat-5.3 +Requires: lua%{luaver_nopoint}-compat-5.3 +%endif BuildRequires: make BuildRequires: msgpack-devel BuildRequires: pkgconfig @@ -65,11 +100,10 @@ BuildRequires: unzip BuildRequires: update-desktop-files Requires: gperf Requires: libvterm0 >= 0.1 -Requires: lua51-bit32 -Requires: lua51-luv Requires: python3-neovim Requires(post): desktop-file-utils Requires(postun): desktop-file-utils +# XSel provides access to the system clipboard Recommends: xsel %if 0%{?suse_version} < 1330 BuildRequires: hicolor-icon-theme @@ -98,6 +132,7 @@ parts of Vim, without compromise, and more. %if 0%{?suse_version} == 1500 %patch2 -p1 %endif +%patch3 -p1 # Remove __DATE__ and __TIME__. BUILD_TIME=$(LC_ALL=C date -ur %{_sourcedir}/%{name}.changes +'%{H}:%{M}') @@ -114,9 +149,10 @@ pushd build export CFLAGS="%{optflags} -fcommon" export CXXFLAGS="%{optflags} -fcommon" %{__cmake} .. -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -%ifarch aarch64 ppc64 - -DPREFER_LUA=ON \ -%endif + -DPREFER_LUA=%{?with_luajit:OFF}%{!?with_luajit:ON} \ + -DLUA_PRG=%{_bindir}/%{?with_luajit:luajit}%{!?with_luajit:lua} \ + -DLIBLUV_INCLUDE_DIR=%{_includedir}/lua-%{luaver} \ + -DLIBLUV_LIBRARY=%{_libdir}/lua/%{luaver}/luv.so \ -DCMAKE_SKIP_RPATH=ON -DCMAKE_VERBOSE_MAKEFILE=ON \ -DUSE_BUNDLED=OFF -DLUAJIT_USE_BUNDLED=OFF \ -DCMAKE_COLOR_MAKEFILE=OFF \