]> git.pld-linux.org Git - packages/neovim.git/blob - neovim.spec
47fec34a8a941639e4bad670328a4a6014cfd1ac
[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} mips ppc
8 %define         with_prefer_lua 1
9 %endif
10
11 Summary:        Vim-fork focused on extensibility and agility
12 Name:           neovim
13 Version:        0.4.4
14 Release:        1
15 License:        Apache v2.0
16 Group:          Applications/Editors/Vim
17 # Source0Download: https://github.com/neovim/neovim/releases
18 Source0:        https://github.com/neovim/neovim/archive/v%{version}/%{name}-%{version}.tar.gz
19 # Source0-md5:  526e6a9194d6d65fd5e7faa4b506e7c8
20 URL:            https://neovim.io/
21 Source2:        %{name}.svg
22 Patch0:         desktop.patch
23 BuildRequires:  cmake >= 2.8.12
24 BuildRequires:  gcc >= 6:4.4
25 BuildRequires:  gettext-devel
26 BuildRequires:  gperf
27 BuildRequires:  jemalloc-devel
28 BuildRequires:  libstdc++-devel
29 BuildRequires:  libtermkey-devel >= 0.18
30 BuildRequires:  libuv-devel >= 1.28.0
31 BuildRequires:  libvterm-devel >= 0.1.0
32 BuildRequires:  lua-bitop >= 1.0.2
33 BuildRequires:  lua-lpeg
34 BuildRequires:  lua-mpack >= 1.0.2
35 BuildRequires:  msgpack-devel >= 1.1.0
36 BuildRequires:  pkgconfig
37 BuildRequires:  rpmbuild(macros) >= 1.605
38 BuildRequires:  unibilium-devel >= 2.0.0
39 %if %{with prefer_lua}
40 BuildRequires:  lua51
41 BuildRequires:  lua51-devel
42 %else
43 BuildRequires:  luajit-devel
44 %endif
45 Requires:       desktop-file-utils
46 Requires:       gtk-update-icon-cache
47 Requires:       hicolor-icon-theme
48 Requires:       libtermkey >= 0.18
49 Requires:       libuv >= 1.28.0
50 Suggests:       python-neovim
51 Suggests:       python3-neovim
52 Suggests:       ruby-neovim
53 Suggests:       xsel
54 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
55
56 # gcc 4.0 and better turn on _FORTIFY_SOURCE=2 automatically. This currently
57 # does not work with Neovim due to some uses of dynamically-sized structures.
58 # See https://github.com/neovim/neovim/issues/223 for details.
59 %define         filterout_c     -Wp,-D_FORTIFY_SOURCE=2
60
61 %description
62 Neovim is a refactor - and sometimes redactor - in the tradition of
63 Vim, which itself derives from Stevie. It is not a rewrite, but a
64 continuation and extension of Vim. Many rewrites, clones, emulators
65 and imitators exist; some are very clever, but none are Vim. Neovim
66 strives to be a superset of Vim, notwithstanding some intentionally
67 removed misfeatures; excepting those few and carefully-considered
68 excisions, Neovim is Vim. It is built for users who want the good
69 parts of Vim, without compromise, and more.
70
71 %prep
72 %setup -q
73 %patch0 -p1
74
75 %build
76 install -d .deps build
77 cd .deps
78 %cmake \
79         -DUSE_BUNDLED=OFF \
80         -DUSE_BUNDLED_JEMALLOC=OFF \
81         -DUSE_BUNDLED_UNIBILIUM=OFF \
82         -DUSE_BUNDLED_LIBTERMKEY=OFF \
83         -DUSE_BUNDLED_LIBVTERM=OFF \
84         -DUSE_BUNDLED_LIBUV=OFF \
85         -DUSE_BUNDLED_MSGPACK=OFF \
86         -DUSE_BUNDLED_LUAJIT=OFF \
87         -DUSE_BUNDLED_LUAROCKS=OFF \
88         -DUSE_BUNDLED_LUV=ON \
89         ../third-party
90 %{__make}
91
92 cd ../build
93 %cmake \
94         -DPREFER_LUA=%{!?with_prefer_lua:OFF}%{?with_prefer_lua:ON} \
95         -DLUA_PRG=/usr/bin/lua5.1 \
96         -DENABLE_JEMALLOC=ON \
97         -DLUAJIT_USE_BUNDLED=OFF \
98         -DLIBUV_USE_BUNDLED=OFF \
99         -DMSGPACK_USE_BUNDLED=OFF \
100         -DUNIBILIUM_USE_BUNDLED=OFF \
101         -DLIBTERMKEY_USE_BUNDLED=OFF \
102         -DLIBVTERM_USE_BUNDLED=OFF \
103         -DJEMALLOC_USE_BUNDLED=OFF \
104         ..
105
106 %{__make}
107
108 %install
109 rm -rf $RPM_BUILD_ROOT
110 %{__make} -C build install \
111         DESTDIR=$RPM_BUILD_ROOT
112
113 install -d $RPM_BUILD_ROOT{/etc/xdg/nvim,%{_iconsdir}/hicolor/scalable/apps}
114 touch $RPM_BUILD_ROOT/etc/xdg/nvim/init.vim
115 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_iconsdir}/hicolor/scalable/apps/nvim.svg
116
117 %{__rm} -r $RPM_BUILD_ROOT%{_localedir}/cs.cp1250
118 %{__rm} -r $RPM_BUILD_ROOT%{_localedir}/ja.euc-jp
119 %{__rm} -r $RPM_BUILD_ROOT%{_localedir}/ko.UTF-8
120 %{__rm} -r $RPM_BUILD_ROOT%{_localedir}/no
121 %{__rm} -r $RPM_BUILD_ROOT%{_localedir}/pl.UTF-8
122 %{__rm} -r $RPM_BUILD_ROOT%{_localedir}/sk.cp1250
123 %{__rm} -r $RPM_BUILD_ROOT%{_localedir}/zh_CN.UTF-8
124 %{__rm} -r $RPM_BUILD_ROOT%{_localedir}/zh_TW.UTF-8
125
126 %find_lang nvim
127
128 %clean
129 rm -rf $RPM_BUILD_ROOT
130
131 %post
132 %update_desktop_database
133 %update_icon_cache hicolor
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 %postun
153 %update_desktop_database
154 %update_icon_cache hicolor
155
156 %files -f nvim.lang
157 %defattr(644,root,root,755)
158 %doc BACKERS.md CONTRIBUTING.md LICENSE README.md
159 %dir /etc/xdg/nvim
160 %config(noreplace) %verify(not md5 mtime size) /etc/xdg/nvim/init.vim
161 %attr(755,root,root) %{_bindir}/nvim
162 %{_mandir}/man1/nvim.1*
163 %{_datadir}/nvim
164 %{_desktopdir}/nvim.desktop
165 %{_pixmapsdir}/nvim.png
166 %{_iconsdir}/hicolor/*/apps/nvim.svg
This page took 0.094549 seconds and 2 git commands to generate.