1 |
commit: 1fb4db026c7bc38389f7d897498b1204d9edf98c |
2 |
Author: Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Sep 10 13:30:15 2021 +0000 |
4 |
Commit: Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Sep 10 13:35:44 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1fb4db02 |
7 |
|
8 |
dev-python/pydevd: properly recompile pre-built file |
9 |
|
10 |
Bug: https://bugs.gentoo.org/812041 |
11 |
Closes: https://bugs.gentoo.org/812386 |
12 |
Package-Manager: Portage-3.0.23, Repoman-3.0.3 |
13 |
Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org> |
14 |
|
15 |
dev-python/pydevd/pydevd-2.5.0-r1.ebuild | 80 ++++++++++++++++++++++++++++++++ |
16 |
dev-python/pydevd/pydevd-2.5.0.ebuild | 60 ------------------------ |
17 |
2 files changed, 80 insertions(+), 60 deletions(-) |
18 |
|
19 |
diff --git a/dev-python/pydevd/pydevd-2.5.0-r1.ebuild b/dev-python/pydevd/pydevd-2.5.0-r1.ebuild |
20 |
new file mode 100644 |
21 |
index 00000000000..69943259799 |
22 |
--- /dev/null |
23 |
+++ b/dev-python/pydevd/pydevd-2.5.0-r1.ebuild |
24 |
@@ -0,0 +1,80 @@ |
25 |
+# Copyright 1999-2021 Gentoo Authors |
26 |
+# Distributed under the terms of the GNU General Public License v2 |
27 |
+ |
28 |
+EAPI=8 |
29 |
+ |
30 |
+PYTHON_COMPAT=( python3_{8..9} ) |
31 |
+ |
32 |
+inherit distutils-r1 toolchain-funcs |
33 |
+ |
34 |
+DESCRIPTION="PyDev.Debugger (used in PyDev, PyCharm and VSCode Python)" |
35 |
+HOMEPAGE="https://github.com/fabioz/PyDev.Debugger/" |
36 |
+SRC_URI="https://github.com/fabioz/PyDev.Debugger/archive/refs/tags/pydev_debugger_${PV//./_}.tar.gz" |
37 |
+S="${WORKDIR}/PyDev.Debugger-pydev_debugger_${PV//./_}" |
38 |
+ |
39 |
+LICENSE="EPL-1.0" |
40 |
+SLOT="0" |
41 |
+KEYWORDS="~amd64" |
42 |
+ |
43 |
+# After removing and recompiling the prebuilt lib the tests fail? |
44 |
+# For some reason the test suite is executing a slightly different gdb command |
45 |
+# then before, which is lacking the file name of the lib that was pre built: |
46 |
+# gdb: No symbol table is loaded. Use the "file" command |
47 |
+# This also happens outside of portage so it is not related to any *FLAGS |
48 |
+RESTRICT="test" |
49 |
+ |
50 |
+BDEPEND=" |
51 |
+ test? ( |
52 |
+ dev-python/untangle[${PYTHON_USEDEP}] |
53 |
+ dev-python/numpy[${PYTHON_USEDEP}] |
54 |
+ dev-python/psutil[${PYTHON_USEDEP}] |
55 |
+ ) |
56 |
+" |
57 |
+ |
58 |
+# Block against the version of debugpy that still bundles pydevd |
59 |
+RDEPEND=" |
60 |
+ !<dev-python/debugpy-1.4.2 |
61 |
+ sys-devel/gdb |
62 |
+" |
63 |
+ |
64 |
+distutils_enable_tests pytest |
65 |
+ |
66 |
+python_prepare_all() { |
67 |
+ distutils-r1_python_prepare_all |
68 |
+ |
69 |
+ # Clean up some prebuilt files |
70 |
+ rm -r third_party || die |
71 |
+ cd pydevd_attach_to_process || die |
72 |
+ |
73 |
+ # Remove these Windows files |
74 |
+ rm attach_{amd64,x86}.dll || die |
75 |
+ rm inject_dll_{amd64,x86}.exe || die |
76 |
+ rm run_code_on_dllmain_{amd64,x86}.dll || die |
77 |
+ rm -r windows winappdbg || die |
78 |
+ |
79 |
+ # Remove these MacOS files |
80 |
+ rm attach_x86_64.dylib || die |
81 |
+ |
82 |
+ # Remove these prebuilt linux files |
83 |
+ rm attach_linux_{amd64,x86}.so || die |
84 |
+ |
85 |
+ cd linux_and_mac || die |
86 |
+ rm compile_mac.sh || die |
87 |
+} |
88 |
+ |
89 |
+src_compile() { |
90 |
+ pushd pydevd_attach_to_process/linux_and_mac || die |
91 |
+ # recompile removed file (extracted from compile_linux.sh) |
92 |
+ $(tc-getBUILD_CXX) ${CXXFLAGS} ${CFLAGS} -o "attach_linux_${ARCH}.so" \ |
93 |
+ -ldl ${LDFLAGS} -nostartfiles attach.cpp || die |
94 |
+ mv "attach_linux_${ARCH}.so" ../ || die |
95 |
+ popd || die |
96 |
+ python_foreach_impl distutils-r1_python_compile |
97 |
+} |
98 |
+ |
99 |
+python_install_all() { |
100 |
+ distutils-r1_python_install_all |
101 |
+ # Remove this duplicate that is installed directly to /usr/ |
102 |
+ # These files are also correctly installed to the python site-packages dir |
103 |
+ rm -r "${ED}/usr/pydevd_attach_to_process" || die |
104 |
+} |
105 |
|
106 |
diff --git a/dev-python/pydevd/pydevd-2.5.0.ebuild b/dev-python/pydevd/pydevd-2.5.0.ebuild |
107 |
deleted file mode 100644 |
108 |
index d473a061606..00000000000 |
109 |
--- a/dev-python/pydevd/pydevd-2.5.0.ebuild |
110 |
+++ /dev/null |
111 |
@@ -1,60 +0,0 @@ |
112 |
-# Copyright 1999-2021 Gentoo Authors |
113 |
-# Distributed under the terms of the GNU General Public License v2 |
114 |
- |
115 |
-EAPI=8 |
116 |
- |
117 |
-PYTHON_COMPAT=( python3_{8..9} ) |
118 |
- |
119 |
-inherit distutils-r1 |
120 |
- |
121 |
-DESCRIPTION="PyDev.Debugger (used in PyDev, PyCharm and VSCode Python)" |
122 |
-HOMEPAGE="https://github.com/fabioz/PyDev.Debugger/" |
123 |
-SRC_URI="https://github.com/fabioz/PyDev.Debugger/archive/refs/tags/pydev_debugger_${PV//./_}.tar.gz" |
124 |
-S="${WORKDIR}/PyDev.Debugger-pydev_debugger_${PV//./_}" |
125 |
- |
126 |
-LICENSE="EPL-1.0" |
127 |
-SLOT="0" |
128 |
-KEYWORDS="~amd64" |
129 |
- |
130 |
-BDEPEND=" |
131 |
- test? ( |
132 |
- dev-python/untangle[${PYTHON_USEDEP}] |
133 |
- dev-python/numpy[${PYTHON_USEDEP}] |
134 |
- dev-python/psutil[${PYTHON_USEDEP}] |
135 |
- sys-devel/gdb |
136 |
- ) |
137 |
-" |
138 |
- |
139 |
-distutils_enable_tests pytest |
140 |
- |
141 |
-# These files are included pre-built in the sources |
142 |
-# TODO: Investigate what this is and if/how we can compile this properly |
143 |
-QA_PREBUILT=" |
144 |
- /usr/lib/python*/site-packages/pydevd_attach_to_process/attach_linux_*.so |
145 |
-" |
146 |
- |
147 |
-python_prepare_all() { |
148 |
- # AssertionError: TimeoutError (note: error trying to dump threads on timeout). |
149 |
- # TODO: investigate and fix this |
150 |
- sed -i \ |
151 |
- -e 's:test_case_qthread4:_&:' \ |
152 |
- -e 's:test_path_translation:_&:' \ |
153 |
- -e 's:test_asyncio_step_over_basic:_&:' \ |
154 |
- -e 's:test_asyncio_step_over_end_of_function:_&:' \ |
155 |
- -e 's:test_asyncio_step_in:_&:' \ |
156 |
- -e 's:test_asyncio_step_return:_&:' \ |
157 |
- tests_python/test_debugger.py || die |
158 |
- sed -i \ |
159 |
- -e 's:test_evaluate_exception_trace:_&:' \ |
160 |
- -e 's:test_path_translation_and_source_reference:_&:' \ |
161 |
- tests_python/test_debugger_json.py || die |
162 |
- |
163 |
- distutils-r1_python_prepare_all |
164 |
-} |
165 |
- |
166 |
-python_install_all() { |
167 |
- distutils-r1_python_install_all |
168 |
- # Remove this duplicate that is installed directly to /usr/ |
169 |
- # These files are also correctly installed to the python site-packages dir |
170 |
- rm -r "${ED}/usr/pydevd_attach_to_process" |
171 |
-} |