File: setup-use-absolute-paths.patch

package info (click to toggle)
python-greenlet 3.3.2-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 1,100 kB
  • sloc: cpp: 5,195; python: 3,333; ansic: 1,138; makefile: 145; asm: 120; sh: 73
file content (33 lines) | stat: -rw-r--r-- 1,155 bytes parent folder | download
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
From: Robin Jarry <robin@jarry.cc>
Date: Wed, 3 Nov 2021 14:21:00 +0100
Subject: setup: use absolute paths

This allows running the setup.py script from another directory. It is
required because pybuild runs tests into a temp dir which is a sub
folder of the sources.

Signed-off-by: Robin Jarry <robin@jarry.cc>
---
 setup.py | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

Index: python-greenlet/setup.py
===================================================================
--- python-greenlet.orig/setup.py
+++ python-greenlet/setup.py
@@ -114,10 +114,13 @@ elif is_win and "MSC" in plat_compiler:
     # this:
     cpp_compile_args.append('/std:c++20')
 
-GREENLET_SRC_DIR = 'src/greenlet/'
+def abspath(rel):
+    return os.path.join(os.path.dirname(__file__), rel)
+
+GREENLET_SRC_DIR = abspath('src/greenlet/')
 GREENLET_HEADER_DIR = GREENLET_SRC_DIR
 GREENLET_HEADER = GREENLET_HEADER_DIR + 'greenlet.h'
-GREENLET_TEST_DIR = 'src/greenlet/tests/'
+GREENLET_TEST_DIR = abspath('src/greenlet/tests/')
 # The location of the platform specific assembly files
 # for switching.
 GREENLET_PLATFORM_DIR = GREENLET_SRC_DIR + 'platform/'