summaryrefslogtreecommitdiff
path: root/dev-python/symengine/files/symengine-0.9.2-cmake-setuptools.patch
blob: 3b930c998d99b09df44defaade0d871c25e3eb72 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
https://github.com/symengine/symengine.py/pull/402
https://bugs.gentoo.org/836599

From bc84086d60de038eb381c9e37c8b552a6c246ab5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
Date: Mon, 2 May 2022 09:24:45 +0200
Subject: [PATCH] Fix build to avoid duplicate files in wheel

Fix the build system to package pure Python files
via distutils/setuptools, and limit CMake to installing the compiled
extension.

The prior logic has installed some of the .py files both via setuptools
and via CMake, to different build directories.  As a result,
the resulting wheel contained duplicate files, e.g.:

         2170  05-02-2022 07:08   symengine/__init__.py
         2170  05-02-2022 07:08   symengine-0.9.2.data/purelib/symengine/__init__.py

Duplicate files cause the wheel to be rejected by the installer package.

After the change, a correct wheel is generated.  Installation works
both via PEP517/wheel and via legacy `setup.py install`.
--- a/setup.py
+++ b/setup.py
@@ -226,7 +226,7 @@ def finalize_options(self):
       url="https://github.com/symengine/symengine.py",
       python_requires='>=3.7,<4',
       zip_safe=False,
-      packages=['symengine'],
+      packages=['symengine', 'symengine.lib', 'symengine.tests'],
       cmdclass = cmdclass,
       classifiers=[
         'License :: OSI Approved :: MIT License',
--- a/symengine/CMakeLists.txt
+++ b/symengine/CMakeLists.txt
@@ -1,7 +1 @@
 add_subdirectory(lib)
-add_subdirectory(tests)
-
-set(PY_PATH ${PYTHON_INSTALL_PATH}/symengine)
-install(FILES __init__.py utilities.py sympy_compat.py functions.py printing.py
-    DESTINATION ${PY_PATH}
-    )
--- a/symengine/lib/CMakeLists.txt
+++ b/symengine/lib/CMakeLists.txt
@@ -28,7 +28,7 @@ install(TARGETS symengine_wrapper
             ARCHIVE DESTINATION ${PY_PATH}
             LIBRARY DESTINATION ${PY_PATH}
         )
-install(FILES __init__.py
+install(FILES
     ${CMAKE_CURRENT_BINARY_DIR}/config.pxi
     symengine.pxd
     symengine_wrapper.pxd
--- a/symengine/tests/CMakeLists.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-set(PY_PATH ${PYTHON_INSTALL_PATH}/symengine/tests)
-install(FILES __init__.py
-    test_arit.py
-    test_dict_basic.py
-    test_eval.py
-    test_expr.py
-    test_functions.py
-    test_number.py
-    test_matrices.py
-    test_ntheory.py
-    test_printing.py
-    test_sage.py
-    test_series_expansion.py
-    test_sets.py
-    test_solve.py
-    test_subs.py
-    test_symbol.py
-    test_sympify.py
-    test_sympy_conv.py
-    test_var.py
-    test_lambdify.py
-    test_sympy_compat.py
-    test_logic.py
-    DESTINATION ${PY_PATH}
-    )