mirror of
https://github.com/RGBCube/serenity
synced 2025-05-25 15:25:08 +00:00
50 lines
2 KiB
Diff
50 lines
2 KiB
Diff
From bd79f48415f3e3982d8d5b96cb22b2b87de4abc4 Mon Sep 17 00:00:00 2001
|
|
From: Linus Groh <mail@linusgroh.de>
|
|
Date: Fri, 14 Jan 2022 23:36:52 +0330
|
|
Subject: [PATCH 4/4] Tweak `setup.py`
|
|
|
|
Make some tweaks to Python's `setup.py`:
|
|
|
|
- Add `/usr/local/lib` and `/usr/local/include` to the system lib and
|
|
include dirs respectively, relative to the sysroot when
|
|
crosscompiling. These are by default only included when not
|
|
crosscompiling for some reason.
|
|
- Add `/usr/local/include/ncurses` to the curses include paths so it can
|
|
build the `_curses` module. This is by default included for a bunch of
|
|
extensions, but not `_curses`.
|
|
---
|
|
setup.py | 11 ++++++++---
|
|
1 file changed, 8 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/setup.py b/setup.py
|
|
index 43e807f..454be9e 100644
|
|
--- a/setup.py
|
|
+++ b/setup.py
|
|
@@ -846,8 +846,8 @@ class PyBuildExt(build_ext):
|
|
add_dir_to_list(self.compiler.include_dirs,
|
|
sysconfig.get_config_var("INCLUDEDIR"))
|
|
|
|
- system_lib_dirs = ['/lib64', '/usr/lib64', '/lib', '/usr/lib']
|
|
- system_include_dirs = ['/usr/include']
|
|
+ system_lib_dirs = ['/lib64', '/usr/lib64', '/lib', '/usr/lib', '/usr/local/lib']
|
|
+ system_include_dirs = ['/usr/include', '/usr/local/include']
|
|
# lib_dirs and inc_dirs are used to search for files;
|
|
# if a file is found in one of those directories, it can
|
|
# be assumed that no additional -I,-L directives are needed.
|
|
@@ -1158,7 +1158,12 @@ class PyBuildExt(build_ext):
|
|
# Curses support, requiring the System V version of curses, often
|
|
# provided by the ncurses library.
|
|
curses_defines = []
|
|
- curses_includes = []
|
|
+ if not CROSS_COMPILING:
|
|
+ curses_includes = ['/usr/local/include/ncurses']
|
|
+ else:
|
|
+ curses_includes = sysroot_paths(
|
|
+ ('CPPFLAGS', 'CFLAGS', 'CC'), ['/usr/local/include/ncurses']
|
|
+ )
|
|
panel_library = 'panel'
|
|
if curses_library == 'ncursesw':
|
|
curses_defines.append(('HAVE_NCURSESW', '1'))
|
|
--
|
|
2.34.1
|
|
|