diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2018-07-14 21:03:06 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2018-07-14 21:03:06 +0100 |
commit | 8376ef56580626e9c0f796d5b85b53a0a1c7d5f5 (patch) | |
tree | 7681bbd4e8b05407772df40a4bf04cbbc8afc3fa /app-vim/editorconfig-vim | |
parent | 30a9caf154332f12ca60756e1b75d2f0e3e1822d (diff) |
gentoo resync : 14.07.2018
Diffstat (limited to 'app-vim/editorconfig-vim')
6 files changed, 385 insertions, 0 deletions
diff --git a/app-vim/editorconfig-vim/Manifest b/app-vim/editorconfig-vim/Manifest new file mode 100644 index 000000000000..a0e12834ca5c --- /dev/null +++ b/app-vim/editorconfig-vim/Manifest @@ -0,0 +1,6 @@ +AUX editorconfig-vim-0.3.3-fixes.patch 3434 BLAKE2B 0a8050698e5138282b838ecad598dcda7676ef3210985fb4d1330fd63651b34eb0df5bd20715acceb807f5f5db7a60a0161b03419b880090f0a727e1a9557daa SHA512 3133dc753c46dbb66d833cb58bf464d37cbd05f77fc9a4a29b9fb9b3eea39b990df2020c7604e881031aaa1cc6cf11b0d42b7ac186c56736721341750d15a81b +AUX editorconfig-vim-0.3.3-max-line-length-off.patch 735 BLAKE2B 3be429d92fefa14a5c483dfdb9e4b10ba18fec0a4b925088995ccf03dcee1534a50aa394c8c37a03ec5e3115a7c0804fdaa2e07f8e39a71f545e485814296087 SHA512 7657b145d71890f0ec12b142c8edc21558171d7cc8f8392912c0fb2e774799d5e57bf06999d48dfce7bb6402bf05ba7a7bd2d613efb5341bebf223a50135ab1d +AUX editorconfig-vim-0.3.3-python3.patch 5601 BLAKE2B 4a9bee66b7b3b2b016d13a557a71d49e28c098c0be26224f55945ea9950d1f4a1484dba2f3c560d8d0ddb93abd6936b72b2195fec81d0b951a238d2344a2f052 SHA512 10a08c795a667c92e0667f292472c5704c43915868fc8c1f164898feb4c4e7af71ede553f5aa874b19e2b4c48f89313bfb90494e0d5d2dc4b7cbaa049d5df2a3 +DIST editorconfig-vim-0.3.3.tar.gz 35395 BLAKE2B a7b65c1472024017dd408e5c4ac5048004d0bd55f44c7cfba49b5973cb445125ed89cc3d4363fb902a4c5fbb507f3ee5ed0ca48aece3fb6915e643bae0dbf70c SHA512 2dd968cf6bb162db8e6242ffb60cc61fb05a8042804b6b46b9f9cd35be968f83b473f04797e47c5cff11d7c052ff523bf8ba1d568992d44b72b97b54a81425a1 +EBUILD editorconfig-vim-0.3.3-r2.ebuild 967 BLAKE2B da2cebacac674bc411193b0366c6611de3e7a107d4881b37126d23da0b3e27c287b1be08a60a60f81a6e57484a69390dce8f2f40c412f23b0b8d0df8e07c1faf SHA512 2ab31f3785633643ba3ad5c96f194495aba9a793775226d5b38702c13d07e482e34225442b7d75f1f1d97cd081a97cc3c47c8be50bd0e97e4b3a570a27e417d6 +MISC metadata.xml 419 BLAKE2B b73a8d7814d585826406516eff8e391fbeec6b1da25bb5b583ad65709260819753bba45f88cafd3c7337854843ce7aa02a8f00f9ab49973c0bfa422e4ef801d6 SHA512 57167b4b86b6bb89094b28341476c03f8415c1dff97fd90f91c882991afe5e33fbd14edd38a18e07d06f3498f070ced5ca9e598b66e7e615c37146b598b6282d diff --git a/app-vim/editorconfig-vim/editorconfig-vim-0.3.3-r2.ebuild b/app-vim/editorconfig-vim/editorconfig-vim-0.3.3-r2.ebuild new file mode 100644 index 000000000000..81a35dbb4e31 --- /dev/null +++ b/app-vim/editorconfig-vim/editorconfig-vim-0.3.3-r2.ebuild @@ -0,0 +1,40 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +PYTHON_COMPAT=(python2_7 python3_4 python3_5 python3_6) +inherit python-single-r1 vim-plugin + +DESCRIPTION="vim plugin: Support EditorConfig files " +HOMEPAGE="https://editorconfig.org/" +SRC_URI="https://github.com/${PN%-vim}/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="BSD-2" +KEYWORDS="~amd64 ~x86" +IUSE="" +REQUIRED_USE="${PYTHON_REQUIRED_USE}" + +DEPEND=" + ${PYTHON_DEPS} + dev-python/editorconfig-core-py[${PYTHON_USEDEP}] + || ( + app-editors/vim[python,${PYTHON_USEDEP}] + app-editors/gvim[python,${PYTHON_USEDEP}] + )" +RDEPEND="${DEPEND}" + +PATCHES=( + "${FILESDIR}/${P}-python3.patch" + "${FILESDIR}/${P}-max-line-length-off.patch" + "${FILESDIR}/${P}-fixes.patch" +) + +VIM_PLUGIN_HELPFILES="${PN%-vim}.txt" + +src_prepare() { + default + + rm LICENSE mkzip.sh .editorconfig .gitignore .travis.yml || die + rm -r tests plugin/${PN%-vim}-core-py || die +} diff --git a/app-vim/editorconfig-vim/files/editorconfig-vim-0.3.3-fixes.patch b/app-vim/editorconfig-vim/files/editorconfig-vim-0.3.3-fixes.patch new file mode 100644 index 000000000000..955560088735 --- /dev/null +++ b/app-vim/editorconfig-vim/files/editorconfig-vim-0.3.3-fixes.patch @@ -0,0 +1,92 @@ +diff --git a/doc/editorconfig.txt b/doc/editorconfig.txt +index bd6173b..3b32012 100644 +--- a/doc/editorconfig.txt ++++ b/doc/editorconfig.txt +@@ -79,7 +79,8 @@ empty. There are 3 modes currently: "external_command", "python_builtin", + "python_external". + + python_builtin: Use the vim built-in python to run the python version +- EditorConfig Core. ++ EditorConfig Core. In this mode, Python 2.5 or higher ++ is required. + python_external: Use an external python interpreter to run the python + version EditorConfig Core. + external_command: Run external EditorConfig Core. +diff --git a/plugin/editorconfig.vim b/plugin/editorconfig.vim +index af4f630..9abd008 100644 +--- a/plugin/editorconfig.vim ++++ b/plugin/editorconfig.vim +@@ -121,15 +121,15 @@ function! s:FindPythonFiles() " {{{1 + + let l:python_core_files_dir = fnamemodify( + \ findfile(g:EditorConfig_python_files_dir . '/main.py', +- \ ','.&runtimepath), ':p:h') ++ \ fnameescape(','.&runtimepath)), ':p:h') + + if empty(l:python_core_files_dir) + let l:python_core_files_dir = '' + else + +- " expand python core file path to full path, and remove the appending '/' +- let l:python_core_files_dir = substitute( +- \ fnamemodify(l:python_core_files_dir, ':p'), '/$', '', '') ++ " expand python core file path to full path, and remove the appending '/' ++ let l:python_core_files_dir = substitute( ++ \ fnamemodify(l:python_core_files_dir, ':p'), '/$', '', '') + endif + + let &shellslash = l:old_shellslash +@@ -247,7 +247,7 @@ function! s:InitializePythonBuiltin(editorconfig_core_py_dir) " {{{2 + " The following line modifies l:ret. This is a bit confusing but + " unfortunately to be compatible with Vim 7.3, we cannot use pyeval. This + " should be changed in the future. +- execute s:pyfile_cmd s:pyscript_path ++ execute s:pyfile_cmd fnameescape(s:pyscript_path) + + return l:ret + endfunction +@@ -327,14 +327,19 @@ endif + + function! s:UseConfigFiles() + ++ let l:buffer_name = expand('%:p') + " ignore buffers without a name +- if empty(expand('%:p')) ++ if empty(l:buffer_name) + return + endif + ++ if g:EditorConfig_verbose ++ echo 'Applying EditorConfig on file "' . l:buffer_name . '"' ++ endif ++ + " Ignore specific patterns + for pattern in g:EditorConfig_exclude_patterns +- if expand('%:p') =~ pattern ++ if l:buffer_name =~ pattern + return + endif + endfor +@@ -386,8 +391,8 @@ endfunction + function! s:UseConfigFiles_Python_External() " {{{2 + " Use external python interp to run the python EditorConfig Core + +- let l:cmd = s:editorconfig_python_interp . ' ' . +- \ s:editorconfig_core_py_dir . '/main.py' ++ let l:cmd = shellescape(s:editorconfig_python_interp) . ' ' . ++ \ shellescape(s:editorconfig_core_py_dir . '/main.py') + + call s:SpawnExternalParser(l:cmd) + +@@ -445,6 +450,11 @@ function! s:SpawnExternalParser(cmd) " {{{2 + return + endif + ++ if g:EditorConfig_verbose ++ echo 'Output from EditorConfig core executable:' ++ echo l:parsing_result ++ endif ++ + for one_line in l:parsing_result + let l:eq_pos = stridx(one_line, '=') + diff --git a/app-vim/editorconfig-vim/files/editorconfig-vim-0.3.3-max-line-length-off.patch b/app-vim/editorconfig-vim/files/editorconfig-vim-0.3.3-max-line-length-off.patch new file mode 100644 index 000000000000..be5d736a385c --- /dev/null +++ b/app-vim/editorconfig-vim/files/editorconfig-vim-0.3.3-max-line-length-off.patch @@ -0,0 +1,20 @@ +commit 6e7011712398e53671e5a44edefeb68914562a3a +Author: Hong Xu <hong@topbug.net> +Date: Wed Apr 6 00:34:26 2016 -0700 + + Support max_line_length=off to leave the decision to the editor settings. + +diff --git a/plugin/editorconfig.vim b/plugin/editorconfig.vim +index 9abd008..0e9d647 100644 +--- a/plugin/editorconfig.vim ++++ b/plugin/editorconfig.vim +@@ -563,7 +563,8 @@ function! s:ApplyConfig(config) " {{{1 + endif + + " highlight the columns following max_line_length +- if has_key(a:config, 'max_line_length') ++ if has_key(a:config, 'max_line_length') && ++ \ a:config['max_line_length'] != 'off' + let l:max_line_length = str2nr(a:config['max_line_length']) + + if l:max_line_length >= 0 diff --git a/app-vim/editorconfig-vim/files/editorconfig-vim-0.3.3-python3.patch b/app-vim/editorconfig-vim/files/editorconfig-vim-0.3.3-python3.patch new file mode 100644 index 000000000000..848582ab02e2 --- /dev/null +++ b/app-vim/editorconfig-vim/files/editorconfig-vim-0.3.3-python3.patch @@ -0,0 +1,213 @@ +commit c2b7a104b826b7ff9283d32cb95a039ddccde79b +Author: Shunsuke Shimizu <grafi@grafi.jp> +Date: Sun Jan 10 00:12:10 2016 -0800 + + Make the plugin to be compatible with Python 3. + + Squashed commit of the following: + + commit 0973c5179e504ffbd74a38d6557bb49fe3bf8b5d + Author: Hong Xu <hong@topbug.net> + Date: Sun Jan 10 00:11:11 2016 -0800 + + Some minor corrections + + commit ca17e97e86bd6379bcf3782adfa200c1589cab69 + Author: Shunsuke Shimizu <grafi@grafi.jp> + Date: Sun Jan 10 15:24:13 2016 +0900 + + vim 7.3 support by using `py[3]` command instead of `py[3]eval()` function + + commit c51ae80ce0ca8fe24c014a7c2d54a85d604d3c88 + Author: grafi <grafi@grafi.jp> + Date: Sun Jan 10 14:42:38 2016 +0900 + + use print_function on python2 + + commit 401a9486bba7528aa4d54b06b8ef3ace582829c9 + Author: grafi <grafi@grafi.jp> + Date: Sun Jan 10 14:33:25 2016 +0900 + + assure that sys.path is cleaned + + commit f3bf442429d9579a336a1bb8f98fee82710fbd1e + Author: grafi <grafi@grafi.jp> + Date: Sun Jan 10 14:22:45 2016 +0900 + + python3 style print + + commit 8e059379328b23e4253f76cbd72d3ef484501d42 + Author: Shunsuke Shimizu <grafi@grafi.jp> + Date: Sat Dec 26 07:54:49 2015 +0900 + + Support python3 + +diff --git a/plugin/editorconfig.py b/plugin/editorconfig.py +new file mode 100644 +index 0000000..21ea9c7 +--- /dev/null ++++ b/plugin/editorconfig.py +@@ -0,0 +1,42 @@ ++from __future__ import print_function ++ ++try: ++ try: ++ import vim ++ import sys ++ except: ++ vim.command('let l:ret = 2') ++ raise ++ ++ try: ++ sys.path.insert(0, vim.eval('a:editorconfig_core_py_dir')) ++ ++ import editorconfig ++ import editorconfig.exceptions as editorconfig_except ++ except: ++ vim.command('let l:ret = 3') ++ raise ++ finally: ++ del sys.path[0] ++ ++ # `ec_` prefix is used in order to keep clean Python namespace ++ ec_data = {} ++ ++ def ec_UseConfigFiles(): ++ ec_data['filename'] = vim.eval("expand('%:p')") ++ ec_data['conf_file'] = ".editorconfig" ++ ++ try: ++ ec_data['options'] = editorconfig.get_properties(ec_data['filename']) ++ except editorconfig_except.EditorConfigError as e: ++ if int(vim.eval('g:EditorConfig_verbose')) != 0: ++ print(str(e), file=sys.stderr) ++ vim.command('let l:ret = 1') ++ return ++ ++ for key, value in ec_data['options'].items(): ++ vim.command("let l:config['" + key.replace("'", "''") + "'] = " + ++ "'" + value.replace("'", "''") + "'") ++ ++except: ++ pass +diff --git a/plugin/editorconfig.vim b/plugin/editorconfig.vim +index a21b103..af4f630 100644 +--- a/plugin/editorconfig.vim ++++ b/plugin/editorconfig.vim +@@ -36,6 +36,8 @@ let g:loaded_EditorConfig = 1 + let s:saved_cpo = &cpo + set cpo&vim + ++let s:pyscript_path = expand('<sfile>:p:r') . '.py' ++ + " variables {{{1 + if !exists('g:EditorConfig_exec_path') + let g:EditorConfig_exec_path = '' +@@ -231,48 +233,23 @@ function! s:InitializePythonBuiltin(editorconfig_core_py_dir) " {{{2 + + let s:builtin_python_initialized = 1 + +- let l:ret = 0 +- +- if !has('python') ++ if has('python') ++ let s:pyfile_cmd = 'pyfile' ++ let s:py_cmd = 'py' ++ elseif has('python3') ++ let s:pyfile_cmd = 'py3file' ++ let s:py_cmd = 'py3' ++ else + return 1 + endif + +- python << EEOOFF +- +-try: +- import vim +- import sys +-except: +- vim.command('let l:ret = 2') +- +-EEOOFF +- +- if l:ret != 0 +- return l:ret +- endif +- +- python << EEOOFF +- +-try: +- sys.path.insert(0, vim.eval('a:editorconfig_core_py_dir')) +- +- import editorconfig +- import editorconfig.exceptions as editorconfig_except +- +-except: +- vim.command('let l:ret = 3') +- +-del sys.path[0] +- +-ec_data = {} # used in order to keep clean Python namespace +- +-EEOOFF +- +- if l:ret != 0 +- return l:ret +- endif ++ let l:ret = 0 ++ " The following line modifies l:ret. This is a bit confusing but ++ " unfortunately to be compatible with Vim 7.3, we cannot use pyeval. This ++ " should be changed in the future. ++ execute s:pyfile_cmd s:pyscript_path + +- return 0 ++ return l:ret + endfunction + + " Do some initalization for the case that the user has specified core mode {{{1 +@@ -388,41 +365,22 @@ augroup END + function! s:UseConfigFiles_Python_Builtin() " {{{2 + " Use built-in python to run the python EditorConfig core + +- let l:config = {} +- let l:ret = 0 +- + " ignore buffers that do not have a file path associated + if empty(expand('%:p')) + return 0 + endif + +- python << EEOOFF +- +-ec_data['filename'] = vim.eval("expand('%:p')") +-ec_data['conf_file'] = ".editorconfig" +- +-try: +- ec_data['options'] = editorconfig.get_properties(ec_data['filename']) +-except editorconfig_except.EditorConfigError as e: +- if int(vim.eval('g:EditorConfig_verbose')) != 0: +- print >> sys.stderr, str(e) +- vim.command('let l:ret = 1') ++ let l:config = {} + +-EEOOFF ++ let l:ret = 0 ++ execute s:py_cmd 'ec_UseConfigFiles()' + if l:ret != 0 + return l:ret + endif + +- python << EEOOFF +-for key, value in ec_data['options'].items(): +- vim.command("let l:config['" + key.replace("'", "''") + "'] = " + +- "'" + value.replace("'", "''") + "'") +- +-EEOOFF +- + call s:ApplyConfig(l:config) + +- return 0 ++ return l:ret + endfunction + + function! s:UseConfigFiles_Python_External() " {{{2 diff --git a/app-vim/editorconfig-vim/metadata.xml b/app-vim/editorconfig-vim/metadata.xml new file mode 100644 index 000000000000..ea346f7a9329 --- /dev/null +++ b/app-vim/editorconfig-vim/metadata.xml @@ -0,0 +1,14 @@ +<?xml version='1.0' encoding='UTF-8'?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="project"> + <email>vim@gentoo.org</email> + </maintainer> + <maintainer type="person"> + <email>chutzpah@gentoo.org</email> + <name>Patrick McLean</name> + </maintainer> + <upstream> + <remote-id type="github">editorconfig/editorconfig-vim</remote-id> + </upstream> +</pkgmetadata> |