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