summaryrefslogtreecommitdiff
path: root/Ports
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2021-09-10 19:56:17 +0100
committerAndreas Kling <kling@serenityos.org>2021-09-11 00:28:39 +0200
commit6b15faed30d345b1acd427db158d4b5a5afae7e7 (patch)
tree53b9bdc313436714094877ea9ae6b3441371d008 /Ports
parent8b3e1c00164fbd28ffe8dcf982b096b4d8cae408 (diff)
downloadserenity-6b15faed30d345b1acd427db158d4b5a5afae7e7.zip
Ports: Build Python with libuuid
This makes the _uuid module work :^)
Diffstat (limited to 'Ports')
-rwxr-xr-xPorts/python3/package.sh2
-rw-r--r--Ports/python3/patches/ReadMe.md1
-rw-r--r--Ports/python3/patches/tweak-setup-py.patch18
3 files changed, 18 insertions, 3 deletions
diff --git a/Ports/python3/package.sh b/Ports/python3/package.sh
index 8ebea43ead..57cb05c831 100755
--- a/Ports/python3/package.sh
+++ b/Ports/python3/package.sh
@@ -16,7 +16,7 @@ launcher_run_in_terminal="true"
icon_file="../launcher.ico" # This is an older icon that's downloaded separately, so we need to go outside of $workdir
# We could also add `openssl` here, but the _ssl modules doesn't build at the moment
-depends="bzip2 libffi ncurses readline sqlite termcap zlib"
+depends="bzip2 libffi libuuid ncurses readline sqlite termcap zlib"
# FIXME: --enable-optimizations results in lots of __gcov_* linker errors
configopts="--disable-ipv6 --without-ensurepip ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no"
diff --git a/Ports/python3/patches/ReadMe.md b/Ports/python3/patches/ReadMe.md
index b21e3b8ebe..c068b1e753 100644
--- a/Ports/python3/patches/ReadMe.md
+++ b/Ports/python3/patches/ReadMe.md
@@ -22,3 +22,4 @@ Make some tweaks to Python's `setup.py` files:
- Add `/usr/local/lib` / `/usr/local/include` to the system lib / include dirs, 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`.
+- Add `/usr/local/includes/uuid` to the uuid include paths so it can build the `_uuid` module. This is by default included for a bunch of extensions, but not `_uuid`.
diff --git a/Ports/python3/patches/tweak-setup-py.patch b/Ports/python3/patches/tweak-setup-py.patch
index e44b3634d1..047bb7dff7 100644
--- a/Ports/python3/patches/tweak-setup-py.patch
+++ b/Ports/python3/patches/tweak-setup-py.patch
@@ -1,5 +1,5 @@
---- Python-3.10.0rc1/setup.py 2021-08-03 18:59:05.650000000 +0100
-+++ Python-3.10.0rc1/setup.py 2021-08-03 19:00:23.210495643 +0100
+--- Python-3.10.0rc1/setup.py.orig 2021-08-02 20:53:59.000000000 +0100
++++ Python-3.10.0rc1/setup.py 2021-09-10 20:13:51.191781791 +0100
@@ -832,8 +832,8 @@
add_dir_to_list(self.compiler.include_dirs,
sysconfig.get_config_var("INCLUDEDIR"))
@@ -25,3 +25,17 @@
panel_library = 'panel'
if curses_library == 'ncursesw':
curses_defines.append(('HAVE_NCURSESW', '1'))
+@@ -1847,7 +1852,12 @@
+
+ def detect_uuid(self):
+ # Build the _uuid module if possible
+- uuid_incs = find_file("uuid.h", self.inc_dirs, ["/usr/include/uuid"])
++ if not CROSS_COMPILING:
++ uuid_incs = find_file("uuid.h", self.inc_dirs, ["/usr/include/uuid", "/usr/local/include/uuid"])
++ else:
++ uuid_incs = find_file("uuid.h", self.inc_dirs, sysroot_paths(
++ ('CPPFLAGS', 'CFLAGS', 'CC'), ["/usr/include/uuid", "/usr/local/include/uuid"]
++ ))
+ if uuid_incs is not None:
+ if self.compiler.find_library_file(self.lib_dirs, 'uuid'):
+ uuid_libs = ['uuid']