1 |
commit: fafd44f0df153e1b1fc7513b26e89f1c5218ae04 |
2 |
Author: Patrice Clement <monsieurp <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Jan 18 19:04:59 2019 +0000 |
4 |
Commit: Patrice Clement <monsieurp <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Jan 19 12:10:03 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fafd44f0 |
7 |
|
8 |
app-editors/vim: enable python and python3 interpreters at compile time. |
9 |
|
10 |
Closes: https://bugs.gentoo.org/669306 |
11 |
Package-Manager: Portage-2.3.56, Repoman-2.3.12 |
12 |
Signed-off-by: Patrice Clement <monsieurp <AT> gentoo.org> |
13 |
|
14 |
app-editors/vim/vim-8.1.0648-r1.ebuild | 321 +++++++++++++++++++++++++++++++++ |
15 |
1 file changed, 321 insertions(+) |
16 |
|
17 |
diff --git a/app-editors/vim/vim-8.1.0648-r1.ebuild b/app-editors/vim/vim-8.1.0648-r1.ebuild |
18 |
new file mode 100644 |
19 |
index 00000000000..7f5fd67a23e |
20 |
--- /dev/null |
21 |
+++ b/app-editors/vim/vim-8.1.0648-r1.ebuild |
22 |
@@ -0,0 +1,321 @@ |
23 |
+# Copyright 1999-2019 Gentoo Authors |
24 |
+# Distributed under the terms of the GNU General Public License v2 |
25 |
+ |
26 |
+EAPI=6 |
27 |
+VIM_VERSION="8.1" |
28 |
+PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6,3_7} ) |
29 |
+PYTHON_REQ_USE="threads(+)" |
30 |
+USE_RUBY="ruby23 ruby24 ruby25" |
31 |
+ |
32 |
+inherit vim-doc flag-o-matic bash-completion-r1 python-single-r1 ruby-single desktop xdg-utils |
33 |
+ |
34 |
+if [[ ${PV} == 9999* ]] ; then |
35 |
+ inherit git-r3 |
36 |
+ EGIT_REPO_URI="https://github.com/vim/vim.git" |
37 |
+else |
38 |
+ SRC_URI="https://github.com/vim/vim/archive/v${PV}.tar.gz -> ${P}.tar.gz |
39 |
+ https://dev.gentoo.org/~radhermit/vim/vim-8.0.0938-gentoo-patches.tar.bz2" |
40 |
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" |
41 |
+fi |
42 |
+ |
43 |
+DESCRIPTION="Vim, an improved vi-style text editor" |
44 |
+HOMEPAGE="https://vim.sourceforge.io/ https://github.com/vim/vim" |
45 |
+ |
46 |
+SLOT="0" |
47 |
+LICENSE="vim" |
48 |
+IUSE="X acl cscope debug gpm lua luajit minimal nls perl python racket ruby selinux tcl terminal vim-pager" |
49 |
+REQUIRED_USE=" |
50 |
+ luajit? ( lua ) |
51 |
+ python? ( ${PYTHON_REQUIRED_USE} ) |
52 |
+" |
53 |
+ |
54 |
+RDEPEND=" |
55 |
+ >=app-eselect/eselect-vi-1.1 |
56 |
+ >=sys-libs/ncurses-5.2-r2:0= |
57 |
+ nls? ( virtual/libintl ) |
58 |
+ acl? ( kernel_linux? ( sys-apps/acl ) ) |
59 |
+ cscope? ( dev-util/cscope ) |
60 |
+ gpm? ( >=sys-libs/gpm-1.19.3 ) |
61 |
+ lua? ( |
62 |
+ luajit? ( dev-lang/luajit:2= ) |
63 |
+ !luajit? ( dev-lang/lua:0[deprecated] ) |
64 |
+ ) |
65 |
+ !minimal? ( |
66 |
+ ~app-editors/vim-core-${PV} |
67 |
+ dev-util/ctags |
68 |
+ ) |
69 |
+ perl? ( dev-lang/perl:= ) |
70 |
+ python? ( ${PYTHON_DEPS} ) |
71 |
+ racket? ( dev-scheme/racket ) |
72 |
+ ruby? ( ${RUBY_DEPS} ) |
73 |
+ selinux? ( sys-libs/libselinux ) |
74 |
+ tcl? ( dev-lang/tcl:0= ) |
75 |
+ X? ( x11-libs/libXt ) |
76 |
+" |
77 |
+ |
78 |
+DEPEND=" |
79 |
+ ${RDEPEND} |
80 |
+ sys-devel/autoconf |
81 |
+ nls? ( sys-devel/gettext ) |
82 |
+" |
83 |
+ |
84 |
+pkg_setup() { |
85 |
+ # people with broken alphabets run into trouble. bug 82186. |
86 |
+ unset LANG LC_ALL |
87 |
+ export LC_COLLATE="C" |
88 |
+ |
89 |
+ # Gnome sandbox silliness. bug #114475. |
90 |
+ mkdir -p "${T}"/home || die "mkdir failed" |
91 |
+ export HOME="${T}"/home |
92 |
+ |
93 |
+ use python && python-single-r1_pkg_setup |
94 |
+} |
95 |
+ |
96 |
+src_prepare() { |
97 |
+ if [[ ${PV} != 9999* ]] ; then |
98 |
+ # Gentoo patches to fix runtime issues, cross-compile errors, etc |
99 |
+ eapply "${WORKDIR}"/patches/ |
100 |
+ fi |
101 |
+ |
102 |
+ # Fixup a script to use awk instead of nawk |
103 |
+ sed -i -e \ |
104 |
+ '1s|.*|#!'"${EPREFIX}"'/usr/bin/awk -f|' \ |
105 |
+ "${S}"/runtime/tools/mve.awk || die "mve.awk sed failed" |
106 |
+ |
107 |
+ # Read vimrc and gvimrc from /etc/vim |
108 |
+ echo '#define SYS_VIMRC_FILE "'${EPREFIX}'/etc/vim/vimrc"' \ |
109 |
+ >> "${S}"/src/feature.h || die "echo failed" |
110 |
+ echo '#define SYS_GVIMRC_FILE "'${EPREFIX}'/etc/vim/gvimrc"' \ |
111 |
+ >> "${S}"/src/feature.h || die "echo failed" |
112 |
+ |
113 |
+ # Use exuberant ctags which installs as /usr/bin/exuberant-ctags. |
114 |
+ # Hopefully this pattern won't break for a while at least. |
115 |
+ # This fixes bug 29398 (27 Sep 2003 agriffis) |
116 |
+ sed -i -e \ |
117 |
+ 's/\<ctags\("\| [-*.]\)/exuberant-&/g' \ |
118 |
+ "${S}"/runtime/doc/syntax.txt \ |
119 |
+ "${S}"/runtime/doc/tagsrch.txt \ |
120 |
+ "${S}"/runtime/doc/usr_29.txt \ |
121 |
+ "${S}"/runtime/menu.vim \ |
122 |
+ "${S}"/src/configure.ac || die 'sed failed' |
123 |
+ |
124 |
+ # Don't be fooled by /usr/include/libc.h. When found, vim thinks |
125 |
+ # this is NeXT, but it's actually just a file in dev-libs/9libs |
126 |
+ # This fixes bug 43885 (20 Mar 2004 agriffis) |
127 |
+ sed -i -e \ |
128 |
+ 's/ libc\.h / /' \ |
129 |
+ "${S}"/src/configure.ac || die 'sed failed' |
130 |
+ |
131 |
+ # gcc on sparc32 has this, uhm, interesting problem with detecting EOF |
132 |
+ # correctly. To avoid some really entertaining error messages about stuff |
133 |
+ # which isn't even in the source file being invalid, we'll do some trickery |
134 |
+ # to make the error never occur. bug 66162 (02 October 2004 ciaranm) |
135 |
+ find "${S}" -name '*.c' | while read c; do |
136 |
+ echo >> "$c" || die "echo failed" |
137 |
+ done |
138 |
+ |
139 |
+ # conditionally make the manpager.sh script |
140 |
+ if use vim-pager; then |
141 |
+ cat > "${S}"/runtime/macros/manpager.sh <<-_EOF_ || die "cat EOF failed" |
142 |
+ #!/bin/sh |
143 |
+ sed -e 's/\x1B\[[[:digit:]]\+m//g' | col -b | \\ |
144 |
+ vim \\ |
145 |
+ -c 'let no_plugin_maps = 1' \\ |
146 |
+ -c 'set nolist nomod ft=man ts=8' \\ |
147 |
+ -c 'let g:showmarks_enable=0' \\ |
148 |
+ -c 'runtime! macros/less.vim' - |
149 |
+ _EOF_ |
150 |
+ fi |
151 |
+ |
152 |
+ # Try to avoid sandbox problems. Bug #114475. |
153 |
+ if [[ -d "${S}"/src/po ]]; then |
154 |
+ sed -i -e \ |
155 |
+ '/-S check.vim/s,..VIM.,ln -s $(VIM) testvim \; ./testvim -X,' \ |
156 |
+ "${S}"/src/po/Makefile || die "sed failed" |
157 |
+ fi |
158 |
+ |
159 |
+ cp -v "${S}"/src/config.mk.dist "${S}"/src/auto/config.mk || die "cp failed" |
160 |
+ |
161 |
+ sed -i -e \ |
162 |
+ "s:\\\$(PERLLIB)/ExtUtils/xsubpp:${EPREFIX}/usr/bin/xsubpp:" \ |
163 |
+ "${S}"/src/Makefile || die 'sed for ExtUtils-ParseXS failed' |
164 |
+ |
165 |
+ eapply_user |
166 |
+} |
167 |
+ |
168 |
+src_configure() { |
169 |
+ local myconf=() |
170 |
+ |
171 |
+ # Fix bug 37354: Disallow -funroll-all-loops on amd64 |
172 |
+ # Bug 57859 suggests that we want to do this for all archs |
173 |
+ filter-flags -funroll-all-loops |
174 |
+ |
175 |
+ # Fix bug 76331: -O3 causes problems, use -O2 instead. We'll do this for |
176 |
+ # everyone since previous flag filtering bugs have turned out to affect |
177 |
+ # multiple archs... |
178 |
+ replace-flags -O3 -O2 |
179 |
+ |
180 |
+ # Fix bug 18245: Prevent "make" from the following chain: |
181 |
+ # (1) Notice configure.ac is newer than auto/configure |
182 |
+ # (2) Rebuild auto/configure |
183 |
+ # (3) Notice auto/configure is newer than auto/config.mk |
184 |
+ # (4) Run ./configure (with wrong args) to remake auto/config.mk |
185 |
+ sed -i 's# auto/config\.mk:#:#' src/Makefile || die "Makefile sed failed" |
186 |
+ rm src/auto/configure || die "rm failed" |
187 |
+ emake -j1 -C src autoconf |
188 |
+ |
189 |
+ # This should fix a sandbox violation (see bug 24447). The hvc |
190 |
+ # things are for ppc64, see bug 86433. |
191 |
+ for file in /dev/pty/s* /dev/console /dev/hvc/* /dev/hvc*; do |
192 |
+ if [[ -e "${file}" ]]; then |
193 |
+ addwrite $file |
194 |
+ fi |
195 |
+ done |
196 |
+ |
197 |
+ if use minimal; then |
198 |
+ myconf=( |
199 |
+ --with-features=tiny |
200 |
+ --disable-nls |
201 |
+ --disable-multibyte |
202 |
+ --disable-acl |
203 |
+ --enable-gui=no |
204 |
+ --without-x |
205 |
+ --disable-darwin |
206 |
+ --disable-luainterp |
207 |
+ --disable-perlinterp |
208 |
+ --disable-pythoninterp |
209 |
+ --disable-mzschemeinterp |
210 |
+ --disable-rubyinterp |
211 |
+ --disable-selinux |
212 |
+ --disable-tclinterp |
213 |
+ --disable-gpm |
214 |
+ ) |
215 |
+ else |
216 |
+ use debug && append-flags "-DDEBUG" |
217 |
+ |
218 |
+ myconf=( |
219 |
+ --with-features=huge |
220 |
+ --enable-multibyte |
221 |
+ $(use_enable acl) |
222 |
+ $(use_enable cscope) |
223 |
+ $(use_enable gpm) |
224 |
+ $(use_enable lua luainterp) |
225 |
+ $(usex lua "--with-lua-prefix=${EPREFIX}/usr" "") |
226 |
+ $(use_with luajit) |
227 |
+ $(use_enable nls) |
228 |
+ $(use_enable perl perlinterp) |
229 |
+ $(use_enable python pythoninterp) |
230 |
+ $(use_enable python python3interp) |
231 |
+ $(use_with python python-command $(type -P $(eselect python show --python2))) |
232 |
+ $(use_with python python3-command $(type -P $(eselect python show --python3))) |
233 |
+ $(use_enable racket mzschemeinterp) |
234 |
+ $(use_enable ruby rubyinterp) |
235 |
+ $(use_enable selinux) |
236 |
+ $(use_enable tcl tclinterp) |
237 |
+ $(use_enable terminal) |
238 |
+ ) |
239 |
+ |
240 |
+ # --with-features=huge forces on cscope even if we --disable it. We need |
241 |
+ # to sed this out to avoid screwiness. (1 Sep 2004 ciaranm) |
242 |
+ if ! use cscope; then |
243 |
+ sed -i -e \ |
244 |
+ '/# define FEAT_CSCOPE/d' src/feature.h || die "sed failed" |
245 |
+ fi |
246 |
+ |
247 |
+ # don't test USE=X here ... see bug #19115 |
248 |
+ # but need to provide a way to link against X ... see bug #20093 |
249 |
+ myconf+=( |
250 |
+ --enable-gui=no |
251 |
+ --disable-darwin |
252 |
+ $(use_with X x) |
253 |
+ ) |
254 |
+ fi |
255 |
+ |
256 |
+ # let package manager strip binaries |
257 |
+ export ac_cv_prog_STRIP="$(type -P true ) faking strip" |
258 |
+ |
259 |
+ # keep prefix env contained within the EPREFIX |
260 |
+ use prefix && myconf+=( --without-local-dir ) |
261 |
+ |
262 |
+ econf \ |
263 |
+ --with-modified-by=Gentoo-${PVR} \ |
264 |
+ "${myconf[@]}" |
265 |
+} |
266 |
+ |
267 |
+src_compile() { |
268 |
+ # The following allows emake to be used |
269 |
+ emake -j1 -C src auto/osdef.h objects |
270 |
+ |
271 |
+ emake |
272 |
+} |
273 |
+ |
274 |
+src_test() { |
275 |
+ einfo |
276 |
+ einfo "Starting vim tests. Several error messages will be shown" |
277 |
+ einfo "while the tests run. This is normal behaviour and does not" |
278 |
+ einfo "indicate a fault." |
279 |
+ einfo |
280 |
+ ewarn "If the tests fail, your terminal may be left in a strange" |
281 |
+ ewarn "state. Usually, running 'reset' will fix this." |
282 |
+ einfo |
283 |
+ |
284 |
+ # Don't let vim talk to X |
285 |
+ unset DISPLAY |
286 |
+ |
287 |
+ emake -j1 -C src/testdir nongui |
288 |
+} |
289 |
+ |
290 |
+# Call eselect vi update with --if-unset |
291 |
+# to respect user's choice (bug 187449) |
292 |
+eselect_vi_update() { |
293 |
+ einfo "Calling eselect vi update..." |
294 |
+ eselect vi update --if-unset |
295 |
+ eend $? |
296 |
+} |
297 |
+ |
298 |
+src_install() { |
299 |
+ local vimfiles=/usr/share/vim/vim${VIM_VERSION/.} |
300 |
+ |
301 |
+ # Note: Do not install symlinks for 'vi', 'ex', or 'view', as these are |
302 |
+ # managed by eselect-vi |
303 |
+ dobin src/vim |
304 |
+ dosym vim /usr/bin/vimdiff |
305 |
+ dosym vim /usr/bin/rvim |
306 |
+ dosym vim /usr/bin/rview |
307 |
+ if use vim-pager ; then |
308 |
+ dosym ${vimfiles}/macros/less.sh /usr/bin/vimpager |
309 |
+ dosym ${vimfiles}/macros/manpager.sh /usr/bin/vimmanpager |
310 |
+ insinto ${vimfiles}/macros |
311 |
+ doins runtime/macros/manpager.sh |
312 |
+ fperms a+x ${vimfiles}/macros/manpager.sh |
313 |
+ fi |
314 |
+ |
315 |
+ domenu runtime/vim.desktop |
316 |
+ |
317 |
+ newbashcomp "${FILESDIR}"/${PN}-completion ${PN} |
318 |
+ |
319 |
+ # keep in sync with 'complete ... -F' list |
320 |
+ bashcomp_alias vim ex vi view rvim rview vimdiff |
321 |
+} |
322 |
+ |
323 |
+pkg_postinst() { |
324 |
+ # Update documentation tags (from vim-doc.eclass) |
325 |
+ update_vim_helptags |
326 |
+ |
327 |
+ # Call eselect vi update |
328 |
+ eselect_vi_update |
329 |
+ |
330 |
+ # update desktop file mime cache |
331 |
+ xdg_desktop_database_update |
332 |
+} |
333 |
+ |
334 |
+pkg_postrm() { |
335 |
+ # Update documentation tags (from vim-doc.eclass) |
336 |
+ update_vim_helptags |
337 |
+ |
338 |
+ # Call eselect vi update |
339 |
+ eselect_vi_update |
340 |
+ |
341 |
+ # update desktop file mime cache |
342 |
+ xdg_desktop_database_update |
343 |
+} |