summaryrefslogtreecommitdiff
path: root/dev-python/zstandard/files/zstandard-0.22.0-build.patch
blob: 1a5ff9affeda8594ad696269ae74e2630e674808 (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
From d7cb41b4ec0239c82d77a6cd7f55b4c7e3fe0c8a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
Date: Wed, 1 Nov 2023 16:17:13 +0100
Subject: [PATCH] build: fix building with modern setuptools backend

Set correct `sys.path` prior to importing `setup_zstd`, in order to fix
building with the modern setuptools backend, i.e.:

```
* Getting build dependencies for wheel...
<string>:37: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
<string>:38: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
    main()
  File "/usr/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 335, in main
    json_out['return_val'] = hook(**hook_input['kwargs'])
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
    return hook(config_settings)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/build-env-mgz__6r4/lib/python3.12/site-packages/setuptools/build_meta.py", line 355, in get_requires_for_build_wheel
    return self._get_build_requires(config_settings, requirements=['wheel'])
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/build-env-mgz__6r4/lib/python3.12/site-packages/setuptools/build_meta.py", line 325, in _get_build_requires
    self.run_setup()
  File "/tmp/build-env-mgz__6r4/lib/python3.12/site-packages/setuptools/build_meta.py", line 341, in run_setup
    exec(code, locals())
  File "<string>", line 49, in <module>
ModuleNotFoundError: No module named 'setup_zstd'

ERROR Backend subprocess exited when trying to invoke get_requires_for_build_wheel
```
---
 setup.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/setup.py b/setup.py
index 7cc1f4f..2b2895b 100755
--- a/setup.py
+++ b/setup.py
@@ -46,6 +46,8 @@ try:
 except ImportError:
     cffi = None
 
+sys.path.insert(0, ".")
+
 import setup_zstd
 
 SUPPORT_LEGACY = False
-- 
2.42.0