Add YouCompleteMe.

This commit is contained in:
Adrien Destugues
2018-08-10 20:52:54 +02:00
parent 9955dd4b4b
commit 75f172c6d1
2 changed files with 137 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
From 6ac7ef62406490f085971b0ff49db89672af1bdd Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Fri, 10 Aug 2018 20:39:55 +0200
Subject: Force use of Python 3 for the server on Haiku.
It is not possible to use Python 2 which is built with gcc2, as the
server embeds a clang based .so file.
diff --git a/python/ycm/paths.py b/python/ycm/paths.py
index a135e3a..28c740b 100644
--- a/python/ycm/paths.py
+++ b/python/ycm/paths.py
@@ -57,23 +57,14 @@ def PathToPythonInterpreter():
if python_interpreter and utils.GetExecutable( python_interpreter ):
return python_interpreter
- # On UNIX platforms, we use sys.executable as the Python interpreter path.
- # We cannot use sys.executable on Windows because for unknown reasons, it
- # returns the Vim executable. Instead, we use sys.exec_prefix to deduce the
- # interpreter path.
- python_interpreter = ( WIN_PYTHON_PATH if utils.OnWindows() else
- sys.executable )
- if _EndsWithPython( python_interpreter ):
- return python_interpreter
-
# As a last resort, we search python in the PATH. We prefer Python 2 over 3
# for the sake of backwards compatibility with ycm_extra_conf.py files out
# there; few people wrote theirs to work on py3.
# So we check 'python2' before 'python' because on some distributions (Arch
# Linux for example), python refers to python3.
- python_interpreter = utils.PathToFirstExistingExecutable( [ 'python2',
+ python_interpreter = utils.PathToFirstExistingExecutable( [ 'python3',
'python',
- 'python3' ] )
+ 'python2' ] )
if python_interpreter:
return python_interpreter
--
2.16.4

View File

@@ -0,0 +1,96 @@
SUMMARY="Code-completion engine for Vim"
DESCRIPTION="YouCompleteMe is a fast, as-you-type, fuzzy-search code \
completion engine for Vim. It has several completion engines:
* an identifier-based engine that works with every programming language,
* a Clang-based engine that provides native semantic code completion for \
C/C++/Objective-C/Objective-C++ (from now on referred to as \"the C-family \
languages\"),
* a Jedi-based completion engine for Python 2 and 3 (using the JediHTTP wrapper),
* an OmniSharp-based completion engine for C#,
* a combination of Gocode and Godef semantic engines for Go,
* a TSServer-based completion engine for TypeScript,
* a Tern-based completion engine for JavaScript,
* a racer-based completion engine for Rust,
* a jdt.ls-based experimental completion engine for Java.
* and an omnifunc-based completer that uses data from Vim's omnicomplete \
system to provide semantic completions for many other languages (Ruby, PHP \
etc.)."
HOMEPAGE="http://valloric.github.io/YouCompleteMe/"
COPYRIGHT="2015-2018 YouCompleteMe contributors"
LICENSE="GNU GPL v3"
REVISION="1"
SOURCE_URI="https://github.com/Valloric/YouCompleteMe/archive/15362d9cb8ec054c929e9a202252825eabe47e58.zip"
CHECKSUM_SHA256="b500810c7d562dbdab1c2bdf9ca10f18aea76fc8f39ec993df244e767cdfd46f"
SOURCE_DIR="YouCompleteMe-15362d9cb8ec054c929e9a202252825eabe47e58"
PATCHES="youcompleteme-$portVersion.patchset"
SOURCE_URI_2="https://github.com/Valloric/ycmd/archive/ea58cfcf502dad92258102a5dd1911d43e39bcda.zip"
SOURCE_DIR_2="ycmd-ea58cfcf502dad92258102a5dd1911d43e39bcda"
CHECKSUM_SHA256_2="d41330237f5777f2b770c944a9df1f57f9a2f5c030faa2815a12b8f019333391"
ARCHITECTURES="!x86_gcc2 ?x86 ?x86_64"
SECONDARY_ARCHITECTURES="x86"
PROVIDES="
youcompleteme$secondaryArchSuffix = $portVersion
"
# Yes, this needs both python (for vim embedded parts) and python3 (for the
# ycmd server) packages.
REQUIRES="
haiku$secondaryArchSuffix
cmd:vim
bottle_python3
certifi_python
certifi_python3
frozendict_python
frozendict_python3
future_python
future_python3
futures_python
requests_futures_python
requests_python
requests_python3
waitress_python3
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libboost_filesystem$secondaryArchSuffix
devel:libboost_regex$secondaryArchSuffix
devel:libboost_system$secondaryArchSuffix
devel:libclang$secondaryArchSuffix
devel:libpython3.6m$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:cmake
cmd:gcc$secondaryArchSuffix
cmd:ninja
cmd:pkg_config$secondaryArchSuffix
"
BUILD()
{
mkdir -p ycm_build
mkdir -p $developLibDir
cd ycm_build
rm -rf ../third_party/ycmd
ln -s ../../../sources-2/ycmd-* ../third_party/ycmd
cmake -GNinja $cmakeDirArgs ../third_party/ycmd/cpp -DUSE_SYSTEM_BOOST=ON \
-DUSE_SYSTEM_LIBCLANG=ON \
-DPYTHON_INCLUDE_DIR=/system/develop/headers/python3.6m \
-DUSE_PYTHON2=OFF
ninja $jobArgs ycm_core
}
INSTALL()
{
mkdir -p $dataDir/vim/vim80
cp -r autoload doc python plugin ycm_build $dataDir/vim/vim80
mkdir -p $dataDir/vim/vim80/third_party/ycmd
cp -r third_party/ycmd/ycm_core.so $dataDir/vim/vim80/third_party/ycmd
cp -r third_party/ycmd/ycmd $dataDir/vim/vim80/third_party/ycmd/ycmd
cp third_party/ycmd/CORE_VERSION $dataDir/vim/vim80/third_party/ycmd/
}