]> git.pld-linux.org Git - packages/neovim.git/blob - neovim.spec
runtime require lua*-lpeg
[packages/neovim.git] / neovim.spec
1 # TODO
2 # - -rt subpackage? -lang subpackage?
3 #
4 # Conditional build:
5 %bcond_with     prefer_lua              # Prefer Lua over LuaJit
6
7 %ifnarch %{ix86} %{x8664} %{arm} aarch64 mips mips64 mipsel ppc
8 %define         with_prefer_lua 1
9 %endif
10
11 %if %{with prefer_lua}
12 %define         lpeg_library    /usr/%{_lib}/lua/5.1/lpeg.so
13 %define         luv_includedir  /usr/include/lua5.1
14 %define         luv_library     /usr/%{_lib}/lua/5.1/luv.so
15 %else
16 %define         lpeg_library    /usr/%{_lib}/luajit/2.1/lpeg.so
17 %define         luv_includedir  /usr/include/luajit-2.1
18 %define         luv_library     /usr/%{_lib}/luajit/2.1/luv.so
19 %endif
20
21 Summary:        Vim-fork focused on extensibility and agility
22 Name:           neovim
23 Version:        0.10.0
24 Release:        1
25 License:        Apache v2.0
26 Group:          Applications/Editors/Vim
27 # Source0Download: https://github.com/neovim/neovim/releases
28 Source0:        https://github.com/neovim/neovim/archive/v%{version}/%{name}-%{version}.tar.gz
29 # Source0-md5:  b5ad54391b6a1a30930c1ab392d506ec
30 URL:            https://neovim.io/
31 Source2:        %{name}.svg
32 Patch0:         desktop.patch
33 Patch1:         build-type.patch
34 Patch2:         luv.patch
35 BuildRequires:  cmake >= 3.13
36 BuildRequires:  gcc >= 6:4.4
37 BuildRequires:  gettext-tools
38 BuildRequires:  libstdc++-devel
39 BuildRequires:  libuv-devel >= 1.28.0
40 BuildRequires:  libvterm-devel >= 0.3.3
41 BuildRequires:  lua-bitop >= 1.0.2
42 BuildRequires:  lua-mpack >= 1.0.2
43 BuildRequires:  msgpack-devel >= 1.1.0
44 BuildRequires:  pkgconfig
45 BuildRequires:  rpm-build >= 4.6
46 BuildRequires:  rpmbuild(macros) >= 1.605
47 BuildRequires:  tree-sitter-devel >= 0.20.9
48 BuildRequires:  unibilium-devel >= 2.0.0
49 %if %{with prefer_lua}
50 BuildRequires:  lua-lpeg
51 BuildRequires:  lua51
52 BuildRequires:  lua51-devel
53 BuildRequires:  lua51-luv-devel >= 1.43.0
54 %else
55 BuildRequires:  luajit
56 BuildRequires:  luajit-devel
57 BuildRequires:  luajit-lpeg
58 BuildRequires:  luajit-luv-devel >= 1.43.0
59 %endif
60 Requires:       libuv >= 1.28.0
61 Requires:       libvterm >= 0.3.3
62 Requires:       lua%{!?with_prefer_lua:jit}-lpeg
63 Requires:       %{?with_prefer_lua:lua51}%{!?with_prefer_lua:luajit}-luv
64 Requires:       tree-sitter >= 0.20.9
65 Suggests:       %{name}-desktop = %{version}-%{release}
66 Suggests:       python-neovim
67 Suggests:       python3-neovim
68 Suggests:       ruby-neovim
69 Suggests:       xsel
70 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
71
72 # gcc 4.0 and better turn on _FORTIFY_SOURCE=2 automatically. This currently
73 # does not work with Neovim due to some uses of dynamically-sized structures.
74 # See https://github.com/neovim/neovim/issues/223 for details.
75 %define         filterout_c     -Wp,-D_FORTIFY_SOURCE=2
76
77 %description
78 Neovim is a refactor - and sometimes redactor - in the tradition of
79 Vim, which itself derives from Stevie. It is not a rewrite, but a
80 continuation and extension of Vim. Many rewrites, clones, emulators
81 and imitators exist; some are very clever, but none are Vim. Neovim
82 strives to be a superset of Vim, notwithstanding some intentionally
83 removed misfeatures; excepting those few and carefully-considered
84 excisions, Neovim is Vim. It is built for users who want the good
85 parts of Vim, without compromise, and more.
86
87 %package desktop
88 Summary:        Desktop files for Neovim
89 Group:          Applications/Editors/Vim
90 Requires(post,postun):  desktop-file-utils
91 Requires(post,postun):  gtk-update-icon-cache
92 Requires(post,postun):  hicolor-icon-theme
93 Requires:       %{name} = %{version}-%{release}
94 BuildArch:      noarch
95
96 %description desktop
97 Desktop files for Neovim.
98
99 %prep
100 %setup -q
101 %patch0 -p1
102 %patch1 -p1
103 %patch2 -p1 -R
104
105 %build
106 %cmake -B build \
107         -DPREFER_LUA=%{!?with_prefer_lua:OFF}%{?with_prefer_lua:ON} \
108         -DLUA_PRG=%{!?with_prefer_lua:/usr/bin/luajit}%{?with_prefer_lua:/usr/bin/lua5.1} \
109         -DLUA_INCLUDE_DIR=/usr/include/lua5.1 \
110         -DUSE_BUNDLED=OFF \
111         -DENABLE_JEMALLOC=ON \
112         -DLPEG_LIBRARY=%{lpeg_library} \
113         -DLUV_INCLUDE_DIR=%{luv_includedir} \
114         -DLUV_LIBRARY=%{luv_library}
115
116 %{__make} -C build
117
118 %install
119 rm -rf $RPM_BUILD_ROOT
120 %{__make} -C build install \
121         DESTDIR=$RPM_BUILD_ROOT
122
123 install -d $RPM_BUILD_ROOT{/etc/xdg/nvim,%{_iconsdir}/hicolor/scalable/apps}
124 touch $RPM_BUILD_ROOT/etc/xdg/nvim/init.vim
125 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_iconsdir}/hicolor/scalable/apps/nvim.svg
126
127 %{__rm} -r $RPM_BUILD_ROOT%{_localedir}/cs.cp1250
128 %{__rm} -r $RPM_BUILD_ROOT%{_localedir}/ja.euc-jp
129 %{__rm} -r $RPM_BUILD_ROOT%{_localedir}/ko.UTF-8
130 %{__rm} -r $RPM_BUILD_ROOT%{_localedir}/no
131 %{__rm} -r $RPM_BUILD_ROOT%{_localedir}/pl.UTF-8
132 %{__rm} -r $RPM_BUILD_ROOT%{_localedir}/sk.cp1250
133 %{__rm} -r $RPM_BUILD_ROOT%{_localedir}/zh_CN.UTF-8
134 %{__rm} -r $RPM_BUILD_ROOT%{_localedir}/zh_TW.UTF-8
135
136 %find_lang nvim
137
138 %clean
139 rm -rf $RPM_BUILD_ROOT
140
141 %post
142 %banner -e -o %{name} << 'EOF'
143
144 The Neovim executable is called 'nvim'. To use your existing Vim
145 configuration:
146     ln -s ~/.vim ~/.config/nvim
147     ln -s ~/.vimrc ~/.config/nvim/init.vim
148 See ':help nvim' for more information on Neovim.
149
150 If you want support for Python plugins such as YouCompleteMe, you need
151 to install a Python module in addition to Neovim itself.
152
153 See ':help provider-python' or this page for more information:
154     http://neovim.io/doc/user/provider.html
155
156 If you have any questions, have a look at:
157     https://github.com/neovim/neovim/wiki/FAQ.
158 EOF
159
160 %post desktop
161 %update_desktop_database
162 %update_icon_cache hicolor
163
164 %postun desktop
165 %update_desktop_database
166 %update_icon_cache hicolor
167
168 %files -f nvim.lang
169 %defattr(644,root,root,755)
170 %doc CONTRIBUTING.md LICENSE.txt README.md
171 %dir /etc/xdg/nvim
172 %config(noreplace) %verify(not md5 mtime size) /etc/xdg/nvim/init.vim
173 %attr(755,root,root) %{_bindir}/nvim
174 %{_mandir}/man1/nvim.1*
175 %{_datadir}/nvim
176
177 %files desktop
178 %defattr(644,root,root,755)
179 %{_desktopdir}/nvim.desktop
180 %{_iconsdir}/hicolor/*/apps/nvim.png
181 %{_iconsdir}/hicolor/*/apps/nvim.svg
This page took 0.148584 seconds and 4 git commands to generate.