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