# comment out if not nightly build #define nightly 20180604 #define gitcommit cf92a76 %bcond_without translations # build will override this anyway, so let's skip it %define _fortify_cflags %nil %define vendor_version 0.12.5 %if 0%{!?mkrel:1} %define mkrel(c) %{1}%{?dist} %endif # luajit doesn't support ppc64le and s390x unless a distro builds it with the # relevant patches (see https://github.com/LuaJIT/LuaJIT/issues/42 and # https://github.com/LuaJIT/LuaJIT/issues/43), so use the slower lua instead # when luajit isn't available. %ifarch ppc64le %bcond luajit %[0%{?suse_version}] %elifarch s390x %bcond luajit %[0%{?epel} > 10 || 0%{?fedora} >= 43] %else %bcond luajit 1 %endif %bcond system_libuv 1 %bcond system_lua %[0%{!?centos:0} || 0%{!?suse_version:1}] %bcond system_lpeg5_1 %[0%{?fedora} >= 43 || 0%{?mageia}] %bcond system_luv %["%{_vendor}" != "openEuler" && 0%{!?centos:1} && (0%{!?fedora:1} || 0%{?fedora} >= 43)] %bcond system_treesitter %[0%{?mageia} >= 9 || 0%{?suse_version} >= 1600 || %{?centos} >= 10 || 0%{?epel} >= 10 || 0%{?fedora} >= 43] %bcond system_unibilium %[0%{?mageia} >= 10 || 0%{?epel} >= 10 || 0%{?fedora} >= 43] %bcond system_utf8proc %[0%{?centos} >=10 || 0%{?epel} >= 10 || 0%{?fedora} >= 43 || 0%{?mageia} >= 10] Name: neovim Version: 0.12.6 Release: %mkrel 1 Summary: Vim-fork focused on extensibility and usability Group: Editors License: ASL 2.0 URL: https://neovim.io/ %if 0%{?nightly:1} Source0: https://github.com/neovim/neovim/archive/nightly/%{name}-%{version}-nightly%{nightly}.tar.gz %else Source0: https://github.com/neovim/neovim/archive/v%{version}/%{name}-%{version}.tar.gz %endif Source1: %{name}-%{vendor_version}-vendor.tar.xz BuildRequires: cmake >= 3.16 BuildRequires: (clang or gcc >= 4.9) BuildRequires: (ninja or ninja-build) %if %{with translations} BuildRequires: gettext %endif BuildRequires: gperf BuildRequires: make %if 0%{?epel} == 9 || 0%{?fedora} >= 41 || 0%{?mageia} >= 9 BuildRequires: pkgconfig(termkey) BuildRequires: pkgconfig(jemalloc) BuildRequires: pkgconfig(libbsd) %endif %if %{with system_libuv} BuildRequires: pkgconfig(libuv) %endif %if %{with system_lua} %if %{with luajit} BuildRequires: pkgconfig(luajit) BuildRequires: luajit %else BuildRequires: (pkgconfig(lua-5.1) or pkgconfig(lua5.1)) BuildRequires: lua5.1 %endif %endif %if %{with system_lpeg5_1} BuildRequires: lua5.1-lpeg %endif %if %{with system_luv} BuildRequires: pkgconfig(libluv) %endif %if %{with system_treesitter} BuildRequires: pkgconfig(tree-sitter) %endif %if %{with system_unibilum} BuildRequires: pkgconfig(unibilium) %endif %if %{with system_utf8proc} BuildRequires: pkgconfig(libutf8proc) >= 2.10.0 %endif %if %{with system_lua} %if %{with luajit} Requires: luajit %else Requires: lua5.1 %endif %endif Provides: nvim = %{version}-%{release} Obsoletes: %{name}-data < %{version}-%{release} Recommends: xclip Recommends: wl-clipboard Recommends: ripgrep Recommends: python3dist(pynvim) Recommends: npm(neovim) %description Neovim is a project that seeks to aggressively refactor Vim in order to: - Simplify maintenance and encourage contributions - Split the work between multiple developers - Enable advanced UIs without modifications to the core - Maximize extensibility %prep %setup -q -b1 %autosetup -p1 -n %{name}-%{?nightly:nightly}%{?!nightly:%{version}} sed -i "s|sys/end|bsd/sys/end|g" cmake.config/CMakeLists.txt %build # Make sure we have the dependencies. mkdir -p .deps/build/ mv -f ../%{name}-%{vendor_version}-vendor .deps/build/downloads cmake -S cmake.deps -B .deps -G "${CMAKE_GENERATOR:-Ninja}" -D CMAKE_BUILD_TYPE=RelWithDebInfo \ -DUSE_BUNDLED=OFF \ %if ! %{with system_libuv} -DUSE_BUNDLED_LIBUV=ON \ %endif %if ! %{with system_lua} %if %{with luajit} -DUSE_BUNDLED_LUAJIT=ON \ %else -DUSE_BUNDLED_LUA=ON \ %endif %endif %if ! %{with system_lpeg5_1} -DUSE_BUNDLED_LPEG \ %endif %if ! %{with system_luv} -D USE_BUNDLED_LUV=ON \ %endif %if ! %{with system_treesitter} -DUSE_BUNDLED_TS=ON \ %endif %if ! %{with system_unibilium} -DUSE_BUNDLED_UNIBILIUM=ON \ %endif %if ! %{with system_utf8proc} -DUSE_BUNDLED_UTF8PROC=ON \ %endif -DUSE_BUNDLED_TS_PARSERS=ON cmake --build .deps # Now the build itself %cmake -G "${CMAKE_GENERATOR:-Ninja}" \ %if %{with translations} -DENABLE_TRANSLATIONS=ON \ %endif -DPREFER_LUA=%{?with_luajit:OFF}%{!?with_luajit:ON} \ -DLUA_PRG=%{?with_luajit:%{_bindir}/luajit}%{!?with_luajit:%{_bindir}/lua-5.1} %cmake_build %install %cmake_install %if %{with translations} %find_lang nvim %files -f nvim.lang %else %files %endif %license LICENSE.txt %doc CONTRIBUTING.md README.md %{_bindir}/nvim %{_mandir}/man1/nvim.1* %{_datadir}/icons/hicolor/*/apps/nvim.png %{_datadir}/applications/nvim.desktop %{_libdir}/nvim/parser/ %{_datadir}/nvim/