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