diff options
Diffstat (limited to 'app-emacs/elpy')
-rw-r--r-- | app-emacs/elpy/Manifest | 1 | ||||
-rw-r--r-- | app-emacs/elpy/elpy-1.35.0_p20220627-r1.ebuild | 101 | ||||
-rw-r--r-- | app-emacs/elpy/files/50elpy-gentoo.el | 5 | ||||
-rw-r--r-- | app-emacs/elpy/files/elpy-elpy-rpc.el-elpy-rpc-pythonpath.patch | 12 | ||||
-rw-r--r-- | app-emacs/elpy/files/elpy-elpy.el-yas-snippet-dirs.patch | 14 | ||||
-rw-r--r-- | app-emacs/elpy/metadata.xml | 13 |
6 files changed, 146 insertions, 0 deletions
diff --git a/app-emacs/elpy/Manifest b/app-emacs/elpy/Manifest new file mode 100644 index 000000000000..027c1316e60b --- /dev/null +++ b/app-emacs/elpy/Manifest @@ -0,0 +1 @@ +DIST elpy-1.35.0_p20220627.tar.gz 177246 BLAKE2B ded88f89949683000c9be606f3b5d2fc65a943c97e0369505713ecbd4f595a43a7ce560b699ebbdfd4a756703c5fa8fb21af5b4e8a1aa6dbb8a55fe4b7dcc468 SHA512 b9a4588eb83edef69661568b936e278621abad316ae160a00737c546b5eb26abd8ac089b369be212abbe16b66b590d9df73986995d36201c1010da7dc9706f79 diff --git a/app-emacs/elpy/elpy-1.35.0_p20220627-r1.ebuild b/app-emacs/elpy/elpy-1.35.0_p20220627-r1.ebuild new file mode 100644 index 000000000000..dbb7bd8ac1ba --- /dev/null +++ b/app-emacs/elpy/elpy-1.35.0_p20220627-r1.ebuild @@ -0,0 +1,101 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_SINGLE_IMPL=ON +DISTUTILS_USE_PEP517=setuptools +PYTHON_COMPAT=( python3_{10..12} ) + +inherit distutils-r1 elisp + +DESCRIPTION="Emacs Python Development Environment" +HOMEPAGE="https://github.com/jorgenschaefer/elpy/" + +if [[ "${PV}" == *9999* ]] ; then + inherit git-r3 + + EGIT_REPO_URI="https://github.com/jorgenschaefer/${PN}.git" +else + [[ "${PV}" == *_p20220627 ]] && COMMIT=de31d30003c515c25ff7bfd3a361c70c298f78bb + + SRC_URI="https://github.com/jorgenschaefer/${PN}/archive/${COMMIT}.tar.gz + -> ${P}.tar.gz" + S="${WORKDIR}/${PN}-${COMMIT}" + + KEYWORDS="~amd64 ~x86" +fi + +LICENSE="GPL-3+" +SLOT="0" +IUSE="test" +RESTRICT="!test? ( test )" + +RDEPEND=" + app-emacs/company-mode + app-emacs/highlight-indentation + app-emacs/pyvenv + app-emacs/s + app-emacs/yasnippet + $(python_gen_cond_dep ' + dev-python/flake8[${PYTHON_USEDEP}] + ') +" +BDEPEND=" + ${RDEPEND} + test? ( + $(python_gen_cond_dep ' + dev-python/autopep8[${PYTHON_USEDEP}] + dev-python/jedi[${PYTHON_USEDEP}] + dev-python/yapf[${PYTHON_USEDEP}] + ') + ) +" + +ELISP_REMOVE=" + elpy/tests/test_black.py + elpy/tests/test_yapf.py +" +PATCHES=( + "${FILESDIR}/${PN}-elpy.el-yas-snippet-dirs.patch" + "${FILESDIR}/${PN}-elpy-rpc.el-elpy-rpc-pythonpath.patch" +) + +DOCS=( CONTRIBUTING.rst README.rst ) +SITEFILE="50${PN}-gentoo.el" + +distutils_enable_sphinx docs --no-autodoc +distutils_enable_tests unittest + +pkg_setup() { + elisp_pkg_setup + python-single-r1_pkg_setup +} + +src_prepare() { + distutils-r1_src_prepare + + sed -i "${PN}.el" -e "s|@SITEETC@|${EPREFIX}${SITEETC}/${PN}|" || die + sed -i "${PN}-rpc.el" -e "s|@PYTHONLIB@|${EPREFIX}/usr/lib/${EPYTHON}|" || die + + rm ${ELISP_REMOVE} || die + sed -i elpy/tests/support.py \ + -e "s|test_should_get_oneline_docstring_for_modules|disabled_&|" || die +} + +src_compile() { + distutils-r1_src_compile + elisp_src_compile +} + +src_test() { + distutils-r1_src_test +} + +src_install() { + distutils-r1_src_install + + elisp_src_install + insinto "${SITEETC}/${PN}" + doins -r snippets +} diff --git a/app-emacs/elpy/files/50elpy-gentoo.el b/app-emacs/elpy/files/50elpy-gentoo.el new file mode 100644 index 000000000000..2e45a60a76a8 --- /dev/null +++ b/app-emacs/elpy/files/50elpy-gentoo.el @@ -0,0 +1,5 @@ +(add-to-list 'load-path "@SITELISP@") +(autoload 'elpy-enable "elpy" + "Enable Elpy in all future Python buffers." t) +(autoload 'elpy-mode "elpy" + "Minor mode in Python buffers for the Emacs Lisp Python Environment." t) diff --git a/app-emacs/elpy/files/elpy-elpy-rpc.el-elpy-rpc-pythonpath.patch b/app-emacs/elpy/files/elpy-elpy-rpc.el-elpy-rpc-pythonpath.patch new file mode 100644 index 000000000000..f64dfd3f563e --- /dev/null +++ b/app-emacs/elpy/files/elpy-elpy-rpc.el-elpy-rpc-pythonpath.patch @@ -0,0 +1,12 @@ +index b228597..aa5fd12 100644 +--- a/elpy-rpc.el ++++ b/elpy-rpc.el +@@ -100,7 +100,7 @@ for example), set this to the full interpreter path." + (elpy-rpc-restart))) + :group 'elpy) + +-(defcustom elpy-rpc-pythonpath (file-name-directory load-file-name) ++(defcustom elpy-rpc-pythonpath "@PYTHONLIB@/site-packages/" + "A directory to add to the PYTHONPATH for the RPC process. + + This should be a directory where the elpy module can be found. If diff --git a/app-emacs/elpy/files/elpy-elpy.el-yas-snippet-dirs.patch b/app-emacs/elpy/files/elpy-elpy.el-yas-snippet-dirs.patch new file mode 100644 index 000000000000..d38b320488cd --- /dev/null +++ b/app-emacs/elpy/files/elpy-elpy.el-yas-snippet-dirs.patch @@ -0,0 +1,14 @@ +diff --git a/elpy.el b/elpy.el +index f2a24a1..7a9b464 100644 +--- a/elpy.el ++++ b/elpy.el +@@ -2022,8 +3777,7 @@ If a region is selected, fold that region." + (unless (listp yas-snippet-dirs) + (setq yas-snippet-dirs (list yas-snippet-dirs))) + (add-to-list 'yas-snippet-dirs +- (concat (file-name-directory (locate-library "elpy")) +- "snippets/") ++ "@SITEETC@/snippets" + t) + + ;; Now load yasnippets. diff --git a/app-emacs/elpy/metadata.xml b/app-emacs/elpy/metadata.xml new file mode 100644 index 000000000000..231ce3b419da --- /dev/null +++ b/app-emacs/elpy/metadata.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> + +<pkgmetadata> + <maintainer type="project"> + <email>gnu-emacs@gentoo.org</email> + <name>Gentoo GNU Emacs project</name> + </maintainer> + <upstream> + <bugs-to>https://github.com/jorgenschaefer/elpy/issues/</bugs-to> + <remote-id type="github">jorgenschaefer/elpy</remote-id> + </upstream> +</pkgmetadata> |