Gentoo Archives: gentoo-commits

From: Justin Lecher <jlec@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/xonsh/, dev-python/xonsh/files/
Date: Sat, 28 Nov 2015 14:13:45
Message-Id: 1448719969.820cc250751bd8e14cd80db11599e3a3f6b1f5b8.jlec@gentoo
1 commit: 820cc250751bd8e14cd80db11599e3a3f6b1f5b8
2 Author: Justin Lecher <jlec <AT> gentoo <DOT> org>
3 AuthorDate: Sat Nov 28 12:53:52 2015 +0000
4 Commit: Justin Lecher <jlec <AT> gentoo <DOT> org>
5 CommitDate: Sat Nov 28 14:12:49 2015 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=820cc250
7
8 dev-python/xonsh: New package, ebuild written by me
9
10 Package-Manager: portage-2.2.25
11 Signed-off-by: Justin Lecher <jlec <AT> gentoo.org>
12
13 dev-python/xonsh/Manifest | 1 +
14 .../xonsh/files/xonsh-0.2.3-kernel-backport.patch | 47 +++++++++++++++++++
15 .../files/xonsh-0.2.3-xonsh.bat-backport.patch | 22 +++++++++
16 dev-python/xonsh/metadata.xml | 12 +++++
17 dev-python/xonsh/xonsh-0.2.3.ebuild | 52 ++++++++++++++++++++++
18 5 files changed, 134 insertions(+)
19
20 diff --git a/dev-python/xonsh/Manifest b/dev-python/xonsh/Manifest
21 new file mode 100644
22 index 0000000..ff0e8c8
23 --- /dev/null
24 +++ b/dev-python/xonsh/Manifest
25 @@ -0,0 +1 @@
26 +DIST xonsh-0.2.3.tar.gz 135218 SHA256 e54f045bbcb2c49f8bf67812bc1c1428628745d0b4dd9880c32b4703e51c4a4d SHA512 78cd577765e3116d0b0060a4db6e3e9aaa5bd870fce2e35241eaa00ca1600039d71b4f0ee011f20c959bf72f33ed09a69b4149c8daf377b9151ae0157259c700 WHIRLPOOL d1660a9f0571c8819560412033399cea4d80ee25707b87d84d852d26a7fcb392e0cf8d57f9084e2a3a36eb2ffffa38ae706b5da540cb2015c816efdd52148caf
27
28 diff --git a/dev-python/xonsh/files/xonsh-0.2.3-kernel-backport.patch b/dev-python/xonsh/files/xonsh-0.2.3-kernel-backport.patch
29 new file mode 100644
30 index 0000000..feed0d0
31 --- /dev/null
32 +++ b/dev-python/xonsh/files/xonsh-0.2.3-kernel-backport.patch
33 @@ -0,0 +1,47 @@
34 +From c650bc8a2b901a9e8d0c09f11f2482cfa6a1daee Mon Sep 17 00:00:00 2001
35 +From: Daniel Milde <daniel@×××××.cz>
36 +Date: Sun, 8 Nov 2015 21:15:08 +0100
37 +Subject: [PATCH] installation of jupyter hook to given destination
38 +
39 +---
40 + setup.py | 8 ++++----
41 + 1 file changed, 4 insertions(+), 4 deletions(-)
42 +
43 +diff --git a/setup.py b/setup.py
44 +index 2996546..83984ba 100755
45 +--- a/setup.py
46 ++++ b/setup.py
47 +@@ -19,7 +19,7 @@
48 + HAVE_SETUPTOOLS = False
49 +
50 + try:
51 +- from jupyter_client.kernelspec import install_kernel_spec
52 ++ from jupyter_client.kernelspec import KernelSpecManager
53 + HAVE_JUPYTER = True
54 + except ImportError:
55 + HAVE_JUPYTER = False
56 +@@ -49,7 +49,7 @@ def build_tables():
57 + sys.path.pop(0)
58 +
59 +
60 +-def install_jupyter_hook():
61 ++def install_jupyter_hook(root=None):
62 + if not HAVE_JUPYTER:
63 + print('Could not install Jupyter kernel spec, please install Jupyter/IPython.')
64 + return
65 +@@ -73,13 +73,13 @@ def install_jupyter_hook():
66 + with open(os.path.join(d, 'kernel.json'), 'w') as f:
67 + json.dump(spec, f, sort_keys=True)
68 + print('Installing Jupyter kernel spec...')
69 +- install_kernel_spec(d, 'xonsh', user=('--user' in sys.argv), replace=True)
70 ++ KernelSpecManager().install_kernel_spec(d, 'xonsh', user=('--user' in sys.argv), replace=True, prefix=root)
71 +
72 + class xinstall(install):
73 + def run(self):
74 + clean_tables()
75 + build_tables()
76 +- install_jupyter_hook()
77 ++ install_jupyter_hook(self.root if self.root else None)
78 + install.run(self)
79 +
80 +
81
82 diff --git a/dev-python/xonsh/files/xonsh-0.2.3-xonsh.bat-backport.patch b/dev-python/xonsh/files/xonsh-0.2.3-xonsh.bat-backport.patch
83 new file mode 100644
84 index 0000000..f938ad7
85 --- /dev/null
86 +++ b/dev-python/xonsh/files/xonsh-0.2.3-xonsh.bat-backport.patch
87 @@ -0,0 +1,22 @@
88 +From ed8b6ce37c76f62585a5cc86ac99194bf7115a84 Mon Sep 17 00:00:00 2001
89 +From: selepo <po.lenhoff@×××××.com>
90 +Date: Wed, 18 Nov 2015 18:50:17 +0100
91 +Subject: [PATCH] bugfix for issue 466 with xonsh.bat installed in non-windows
92 +
93 +---
94 + setup.py | 2 +-
95 + 1 file changed, 1 insertion(+), 1 deletion(-)
96 +
97 +diff --git a/setup.py b/setup.py
98 +index 0fb407b..7c10805 100755
99 +--- a/setup.py
100 ++++ b/setup.py
101 +@@ -77,7 +77,7 @@ def main():
102 + platforms='Cross Platform',
103 + classifiers=['Programming Language :: Python :: 3'],
104 + packages=['xonsh'],
105 +- scripts=['scripts/xonsh', 'scripts/xonsh.bat'],
106 ++ scripts=['scripts/xonsh'] if 'win' not in sys.platform else ['scripts/xonsh.bat'],
107 + cmdclass={'install': xinstall, 'sdist': xsdist},
108 + )
109 + if HAVE_SETUPTOOLS:
110
111 diff --git a/dev-python/xonsh/metadata.xml b/dev-python/xonsh/metadata.xml
112 new file mode 100644
113 index 0000000..b15221c
114 --- /dev/null
115 +++ b/dev-python/xonsh/metadata.xml
116 @@ -0,0 +1,12 @@
117 +<?xml version="1.0" encoding="UTF-8"?>
118 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
119 +<pkgmetadata>
120 + <herd>python</herd>
121 + <upstream>
122 + <remote-id type="pypi">xonsh</remote-id>
123 + <maintainer status="unknown">
124 + <email>scopatz@×××××.com</email>
125 + <name>Anthony Scopatz</name>
126 + </maintainer>
127 + </upstream>
128 +</pkgmetadata>
129
130 diff --git a/dev-python/xonsh/xonsh-0.2.3.ebuild b/dev-python/xonsh/xonsh-0.2.3.ebuild
131 new file mode 100644
132 index 0000000..648162d
133 --- /dev/null
134 +++ b/dev-python/xonsh/xonsh-0.2.3.ebuild
135 @@ -0,0 +1,52 @@
136 +# Copyright 1999-2015 Gentoo Foundation
137 +# Distributed under the terms of the GNU General Public License v2
138 +# $Id$
139 +
140 +EAPI=5
141 +
142 +PYTHON_COMPAT=( python3_{4,5} )
143 +
144 +inherit distutils-r1 eutils
145 +
146 +DESCRIPTION="An exotic, usable shell"
147 +HOMEPAGE="
148 + http://xonsh.readthedocs.org/
149 + https://github.com/scopatz/xonsh
150 + http://pypi.python.org/pypi/xonsh"
151 +SRC_URI="mirror://pypi/${P:0:1}/${PN}/${P}.tar.gz"
152 +
153 +LICENSE="BSD"
154 +SLOT="0"
155 +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
156 +IUSE="test"
157 +
158 +RDEPEND="
159 + dev-python/ply[${PYTHON_USEDEP}]
160 +"
161 +DEPEND="${REDEPEND}
162 + dev-python/setuptools[${PYTHON_USEDEP}]
163 + test? (
164 + dev-python/nose[${PYTHON_USEDEP}]
165 + )"
166 +
167 +PATCHES=(
168 + "${FILESDIR}"/${P}-kernel-backport.patch
169 + "${FILESDIR}"/${P}-${PN}.bat-backport.patch
170 +)
171 +
172 +python_prepare_all() {
173 + sed \
174 + -e "/install_kernel_spec/s:prefix=None:prefix=u\"${ED}/usr\":g" \
175 + -i setup.py || die
176 +
177 + distutils-r1_python_prepare_all
178 +}
179 +
180 +python_test() {
181 + nosetests --verbose || die
182 +}
183 +
184 +pkg_postinst() {
185 + optfeature "Jupyter kernel support" dev-python/jupyter
186 + optfeature "Alternative to readline backend" dev-python/prompt_toolkit
187 +}