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/'
