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