Gentoo Archives: gentoo-commits

From: Patrice Clement <monsieurp@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/spyder/, dev-python/spyder/files/
Date: Tue, 23 Feb 2016 09:28:50
Message-Id: 1456218878.fd1b8160cae4b9a5aa99dad3c3a34c01cc33ea90.monsieurp@gentoo
1 commit: fd1b8160cae4b9a5aa99dad3c3a34c01cc33ea90
2 Author: Patrice Clement <monsieurp <AT> gentoo <DOT> org>
3 AuthorDate: Tue Feb 23 09:07:24 2016 +0000
4 Commit: Patrice Clement <monsieurp <AT> gentoo <DOT> org>
5 CommitDate: Tue Feb 23 09:14:38 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fd1b8160
7
8 dev-python/spyder: Following EAPI 6 bump, convert patch to p1 format.
9
10 With the EAPI 6, patches must be p1 compliant. So let's make Portage happy and
11 comply with the new rule.
12
13 Package-Manager: portage-2.2.26
14
15 dev-python/spyder/files/spyder-2.3.8-build.patch | 154 +++++++++++++++++++++++
16 dev-python/spyder/spyder-2.3.8.ebuild | 2 +-
17 2 files changed, 155 insertions(+), 1 deletion(-)
18
19 diff --git a/dev-python/spyder/files/spyder-2.3.8-build.patch b/dev-python/spyder/files/spyder-2.3.8-build.patch
20 new file mode 100644
21 index 0000000..2a4646a
22 --- /dev/null
23 +++ b/dev-python/spyder/files/spyder-2.3.8-build.patch
24 @@ -0,0 +1,154 @@
25 +--- a/setup.py
26 ++++ b/setup.py
27 +@@ -21,8 +21,6 @@
28 + import shutil
29 +
30 + from distutils.core import setup
31 +-from distutils.command.build import build
32 +-from distutils.command.install_data import install_data
33 +
34 + # Check for Python 3
35 + PY3 = sys.version_info[0] == 3
36 +@@ -66,12 +64,7 @@
37 + def get_data_files():
38 + """Return data_files in a platform dependent manner"""
39 + if sys.platform.startswith('linux'):
40 +- if PY3:
41 +- data_files = [('share/applications', ['scripts/spyder3.desktop']),
42 +- ('share/pixmaps', ['img_src/spyder3.png'])]
43 +- else:
44 +- data_files = [('share/applications', ['scripts/spyder.desktop']),
45 +- ('share/pixmaps', ['img_src/spyder.png'])]
46 ++ data_files = [('share/pixmaps', ['img_src/spyder.png'])]
47 + elif os.name == 'nt':
48 + data_files = [('scripts', ['img_src/spyder.ico',
49 + 'img_src/spyder_light.ico'])]
50 +@@ -80,97 +73,6 @@
51 + return data_files
52 +
53 +
54 +-class MyInstallData(install_data):
55 +- def run(self):
56 +- install_data.run(self)
57 +- if sys.platform.startswith('linux'):
58 +- try:
59 +- subprocess.call(['update-desktop-database'])
60 +- except:
61 +- print("ERROR: unable to update desktop database",
62 +- file=sys.stderr)
63 +-CMDCLASS = {'install_data': MyInstallData}
64 +-
65 +-
66 +-# Sphinx build (documentation)
67 +-def get_html_help_exe():
68 +- """Return HTML Help Workshop executable path (Windows only)"""
69 +- if os.name == 'nt':
70 +- hhc_base = r'C:\Program Files%s\HTML Help Workshop\hhc.exe'
71 +- for hhc_exe in (hhc_base % '', hhc_base % ' (x86)'):
72 +- if osp.isfile(hhc_exe):
73 +- return hhc_exe
74 +- else:
75 +- return
76 +-
77 +-try:
78 +- from sphinx import setup_command
79 +-
80 +- class MyBuild(build):
81 +- user_options = [('no-doc', None, "Don't build Spyder documentation")] \
82 +- + build.user_options
83 +- def __init__(self, *args, **kwargs):
84 +- build.__init__(self, *args, **kwargs)
85 +- self.no_doc = False
86 +- def with_doc(self):
87 +- setup_dir = os.path.dirname(os.path.abspath(__file__))
88 +- is_doc_dir = os.path.isdir(os.path.join(setup_dir, 'doc'))
89 +- install_obj = self.distribution.get_command_obj('install')
90 +- return (is_doc_dir and not self.no_doc and not install_obj.no_doc)
91 +- sub_commands = build.sub_commands + [('build_doc', with_doc)]
92 +- CMDCLASS['build'] = MyBuild
93 +-
94 +-
95 +- class MyInstall(install):
96 +- user_options = [('no-doc', None, "Don't build Spyder documentation")] \
97 +- + install.user_options
98 +- def __init__(self, *args, **kwargs):
99 +- install.__init__(self, *args, **kwargs)
100 +- self.no_doc = False
101 +- CMDCLASS['install'] = MyInstall
102 +-
103 +-
104 +- class MyBuildDoc(setup_command.BuildDoc):
105 +- def run(self):
106 +- build = self.get_finalized_command('build')
107 +- sys.path.insert(0, os.path.abspath(build.build_lib))
108 +- dirname = self.distribution.get_command_obj('build').build_purelib
109 +- self.builder_target_dir = osp.join(dirname, 'spyderlib', 'doc')
110 +-
111 +- if not osp.exists(self.builder_target_dir):
112 +- os.mkdir(self.builder_target_dir)
113 +-
114 +- hhc_exe = get_html_help_exe()
115 +- self.builder = "html" if hhc_exe is None else "htmlhelp"
116 +-
117 +- try:
118 +- setup_command.BuildDoc.run(self)
119 +- except UnicodeDecodeError:
120 +- print("ERROR: unable to build documentation because Sphinx "\
121 +- "do not handle source path with non-ASCII characters. "\
122 +- "Please try to move the source package to another "\
123 +- "location (path with *only* ASCII characters).",
124 +- file=sys.stderr)
125 +- sys.path.pop(0)
126 +-
127 +- # Building chm doc, if HTML Help Workshop is installed
128 +- if hhc_exe is not None:
129 +- fname = osp.join(self.builder_target_dir, 'Spyderdoc.chm')
130 +- subprocess.call('"%s" %s' % (hhc_exe, fname), shell=True)
131 +- if osp.isfile(fname):
132 +- dest = osp.join(dirname, 'spyderlib')
133 +- try:
134 +- shutil.move(fname, dest)
135 +- except shutil.Error:
136 +- print("Unable to replace %s" % dest)
137 +- shutil.rmtree(self.builder_target_dir)
138 +-
139 +- CMDCLASS['build_doc'] = MyBuildDoc
140 +-except ImportError:
141 +- print('WARNING: unable to build documentation because Sphinx '\
142 +- 'is not installed', file=sys.stderr)
143 +-
144 +-
145 + NAME = 'spyder'
146 + LIBNAME = 'spyderlib'
147 + from spyderlib import __version__, __project_url__
148 +@@ -204,13 +106,7 @@
149 + packages = get_subpackages(LIBNAME)+get_subpackages('spyderplugins')
150 + return packages
151 +
152 +-# NOTE: the '[...]_win_post_install.py' script is installed even on non-Windows
153 +-# platforms due to a bug in pip installation process (see Issue 1158)
154 +-SCRIPTS = ['%s_win_post_install.py' % NAME]
155 +-if PY3 and sys.platform.startswith('linux'):
156 +- SCRIPTS.append('spyder3')
157 +-else:
158 +- SCRIPTS.append('spyder')
159 ++SCRIPTS = ['spyder']
160 + EXTLIST = ['.mo', '.svg', '.png', '.css', '.html', '.js', '.chm', '.ini',
161 + '.txt', '.rst']
162 + if os.name == 'nt':
163 +@@ -246,7 +142,7 @@
164 + package_data={LIBNAME: get_package_data(LIBNAME, EXTLIST),
165 + 'spyderplugins':
166 + get_package_data('spyderplugins', EXTLIST)},
167 +- requires=["rope (>=0.9.2)", "sphinx (>=0.6.0)", "PyQt4 (>=4.4)"],
168 ++ requires=["rope (>=0.9.2)", "PyQt4 (>=4.4)"],
169 + scripts=[osp.join('scripts', fname) for fname in SCRIPTS],
170 + data_files=get_data_files(),
171 + options={"bdist_wininst":
172 +@@ -267,5 +163,4 @@
173 + 'Programming Language :: Python :: 3',
174 + 'Development Status :: 5 - Production/Stable',
175 + 'Topic :: Scientific/Engineering',
176 +- 'Topic :: Software Development :: Widget Sets'],
177 +- cmdclass=CMDCLASS)
178 ++ 'Topic :: Software Development :: Widget Sets'])
179
180 diff --git a/dev-python/spyder/spyder-2.3.8.ebuild b/dev-python/spyder/spyder-2.3.8.ebuild
181 index 50b8220..ef9c7d8 100644
182 --- a/dev-python/spyder/spyder-2.3.8.ebuild
183 +++ b/dev-python/spyder/spyder-2.3.8.ebuild
184 @@ -36,7 +36,7 @@ DEPEND="${RDEPEND}
185 doc? ( >=dev-python/sphinx-0.6.0[${PYTHON_USEDEP}] )"
186
187 # Courtesy of Arfrever
188 -PATCHES=( "${FILESDIR}"/${PN}-2.3.1-build.patch )
189 +PATCHES=( "${FILESDIR}"/${P}-build.patch )
190
191 python_compile_all() {
192 if use doc; then