Files
MINGW-packages/mingw-w64-python/0133-distutils-add-build-root-to-libdirs-when-building-un.patch
2023-02-10 12:56:41 +01:00

38 lines
1.7 KiB
Diff

From 3e80e22df4cfb839b05c7d6cef11475f88eec8d0 Mon Sep 17 00:00:00 2001
From: Christoph Reiter <reiter.christoph@gmail.com>
Date: Mon, 6 Jun 2022 16:24:55 +0200
Subject: [PATCH 133/N] distutils: add build root to libdirs when building
uninstalled
The distutils test suite builds extensions which need to link
to libpython despite it being uninstalled. The code currently assumes
that the working directory is the build root, but that is not the case
in the tests (it's in some temp dir). Explicitely pass the build root
instead where the uninstalled libpython can be found.
---
Lib/distutils/command/build_ext.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Lib/distutils/command/build_ext.py b/Lib/distutils/command/build_ext.py
index 82a21d2..ab1a3e7 100644
--- a/Lib/distutils/command/build_ext.py
+++ b/Lib/distutils/command/build_ext.py
@@ -227,7 +227,7 @@ class build_ext(Command):
config_dir_name))
else:
# building python standard extensions
- self.library_dirs.append('.')
+ self.library_dirs.append(sysconfig.project_base)
# For building extensions with a shared Python library,
# Python's library directory must be appended to library_dirs
@@ -238,7 +238,7 @@ class build_ext(Command):
self.library_dirs.append(sysconfig.get_config_var('LIBDIR'))
else:
# building python standard extensions
- self.library_dirs.append('.')
+ self.library_dirs.append(sysconfig.project_base)
# The argument parsing will result in self.define being a string, but
# it has to be a list of 2-tuples. All the preprocessor symbols