summaryrefslogtreecommitdiff
path: root/neovim.spec
blob: ecfb2d2aa3a53305cd01fa0a8b2e802d4e5bace4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
# TODO
# - -rt subpackage? -lang subpackage?
#
# Conditional build:
%bcond_with	prefer_lua		# Prefer Lua over LuaJit

%ifnarch %{ix86} %{x8664} %{arm} aarch64 mips mips64 mipsel ppc
%define		with_prefer_lua	1
%endif

%if %{with prefer_lua}
%define		luv_includedir	/usr/include/lua5.1
%define		luv_library	/usr/%{_lib}/lua/5.1/luv.so
%else
%define		luv_includedir	/usr/include/luajit-2.1
%define		luv_library	/usr/%{_lib}/luajit/2.1/luv.so
%endif

Summary:	Vim-fork focused on extensibility and agility
Name:		neovim
Version:	0.9.5
Release:	1
License:	Apache v2.0
Group:		Applications/Editors/Vim
# Source0Download: https://github.com/neovim/neovim/releases
Source0:	https://github.com/neovim/neovim/archive/v%{version}/%{name}-%{version}.tar.gz
# Source0-md5:	106932337799a21cf8d28d488c7fc702
URL:		https://neovim.io/
Source2:	%{name}.svg
Patch0:		desktop.patch
Patch1:		build-type.patch
Patch2:		luv.patch
BuildRequires:	cmake >= 3.10
BuildRequires:	gcc >= 6:4.4
BuildRequires:	gettext-tools
BuildRequires:	libstdc++-devel
BuildRequires:	libtermkey-devel >= 0.22
BuildRequires:	libuv-devel >= 1.28.0
BuildRequires:	libvterm-devel >= 0.3
BuildRequires:	lua-bitop >= 1.0.2
BuildRequires:	lua-lpeg
BuildRequires:	lua-mpack >= 1.0.2
BuildRequires:	msgpack-devel >= 1.1.0
BuildRequires:	pkgconfig
BuildRequires:	rpm-build >= 4.6
BuildRequires:	rpmbuild(macros) >= 1.605
BuildRequires:	tree-sitter-devel >= 0.20.8
BuildRequires:	unibilium-devel >= 2.0.0
%if %{with prefer_lua}
BuildRequires:	lua51
BuildRequires:	lua51-devel
BuildRequires:	lua51-luv-devel >= 1.43.0
%else
BuildRequires:	luajit
BuildRequires:	luajit-devel
BuildRequires:	luajit-luv-devel >= 1.43.0
%endif
Requires:	libtermkey >= 0.22
Requires:	libuv >= 1.28.0
Requires:	libvterm >= 0.3
Requires:	%{?with_prefer_lua:lua51}%{!?with_prefer_lua:luajit}-luv
Requires:	tree-sitter >= 0.20.8
Suggests:	%{name}-desktop = %{version}-%{release}
Suggests:	python-neovim
Suggests:	python3-neovim
Suggests:	ruby-neovim
Suggests:	xsel
BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)

# gcc 4.0 and better turn on _FORTIFY_SOURCE=2 automatically. This currently
# does not work with Neovim due to some uses of dynamically-sized structures.
# See https://github.com/neovim/neovim/issues/223 for details.
%define		filterout_c	-Wp,-D_FORTIFY_SOURCE=2

%description
Neovim is a refactor - and sometimes redactor - in the tradition of
Vim, which itself derives from Stevie. It is not a rewrite, but a
continuation and extension of Vim. Many rewrites, clones, emulators
and imitators exist; some are very clever, but none are Vim. Neovim
strives to be a superset of Vim, notwithstanding some intentionally
removed misfeatures; excepting those few and carefully-considered
excisions, Neovim is Vim. It is built for users who want the good
parts of Vim, without compromise, and more.

%package desktop
Summary:	Desktop files for Neovim
Group:		Applications/Editors/Vim
Requires(post,postun):	desktop-file-utils
Requires(post,postun):	gtk-update-icon-cache
Requires(post,postun):	hicolor-icon-theme
Requires:	%{name} = %{version}-%{release}
BuildArch:	noarch

%description desktop
Desktop files for Neovim.

%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1 -R

%build
%cmake -B build \
	-DPREFER_LUA=%{!?with_prefer_lua:OFF}%{?with_prefer_lua:ON} \
	-DLUA_PRG=%{!?with_prefer_lua:/usr/bin/luajit}%{?with_prefer_lua:/usr/bin/lua5.1} \
	-DLUA_INCLUDE_DIR=/usr/include/lua5.1 \
	-DUSE_BUNDLED=OFF \
	-DENABLE_JEMALLOC=ON \
	-DLIBLUV_INCLUDE_DIR=%{luv_includedir} \
	-DLIBLUV_LIBRARY=%{luv_library}

%{__make} -C build

%install
rm -rf $RPM_BUILD_ROOT
%{__make} -C build install \
	DESTDIR=$RPM_BUILD_ROOT

install -d $RPM_BUILD_ROOT{/etc/xdg/nvim,%{_iconsdir}/hicolor/scalable/apps}
touch $RPM_BUILD_ROOT/etc/xdg/nvim/init.vim
cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_iconsdir}/hicolor/scalable/apps/nvim.svg

%{__rm} -r $RPM_BUILD_ROOT%{_localedir}/cs.cp1250
%{__rm} -r $RPM_BUILD_ROOT%{_localedir}/ja.euc-jp
%{__rm} -r $RPM_BUILD_ROOT%{_localedir}/ko.UTF-8
%{__rm} -r $RPM_BUILD_ROOT%{_localedir}/no
%{__rm} -r $RPM_BUILD_ROOT%{_localedir}/pl.UTF-8
%{__rm} -r $RPM_BUILD_ROOT%{_localedir}/sk.cp1250
%{__rm} -r $RPM_BUILD_ROOT%{_localedir}/zh_CN.UTF-8
%{__rm} -r $RPM_BUILD_ROOT%{_localedir}/zh_TW.UTF-8

%find_lang nvim

%clean
rm -rf $RPM_BUILD_ROOT

%post
%banner -e -o %{name} << 'EOF'

The Neovim executable is called 'nvim'. To use your existing Vim
configuration:
    ln -s ~/.vim ~/.config/nvim
    ln -s ~/.vimrc ~/.config/nvim/init.vim
See ':help nvim' for more information on Neovim.

If you want support for Python plugins such as YouCompleteMe, you need
to install a Python module in addition to Neovim itself.

See ':help provider-python' or this page for more information:
    http://neovim.io/doc/user/provider.html

If you have any questions, have a look at:
    https://github.com/neovim/neovim/wiki/FAQ.
EOF

%post desktop
%update_desktop_database
%update_icon_cache hicolor

%postun desktop
%update_desktop_database
%update_icon_cache hicolor

%files -f nvim.lang
%defattr(644,root,root,755)
%doc BACKERS.md CONTRIBUTING.md LICENSE.txt README.md
%dir /etc/xdg/nvim
%config(noreplace) %verify(not md5 mtime size) /etc/xdg/nvim/init.vim
%attr(755,root,root) %{_bindir}/nvim
%{_mandir}/man1/nvim.1*
%{_datadir}/nvim

%files desktop
%defattr(644,root,root,755)
%{_desktopdir}/nvim.desktop
%{_iconsdir}/hicolor/*/apps/nvim.png
%{_iconsdir}/hicolor/*/apps/nvim.svg