apple-sdk: propagate the libutil library (#353873)

This commit is contained in:
Emily
2024-11-07 01:05:45 +00:00
committed by GitHub
20 changed files with 19 additions and 86 deletions
@@ -140,10 +140,6 @@ let
] ++ lib.optionals (x11Support && stdenv.hostPlatform.isDarwin) [
./use-correct-tcl-tk-on-darwin.patch
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
# Fix darwin build https://bugs.python.org/issue34027
../3.7/darwin-libutil.patch
] ++ lib.optionals stdenv.hostPlatform.isLinux [
# Disable the use of ldconfig in ctypes.util.find_library (since
@@ -1,13 +0,0 @@
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 40229bce0f..3cc604930e 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -7258,7 +7258,7 @@ os_sched_getaffinity_impl(PyObject *module, pid_t pid)
#ifdef HAVE_UTMP_H
#include <utmp.h>
#endif /* HAVE_UTMP_H */
-#elif defined(HAVE_LIBUTIL_H)
+#elif defined(HAVE_LIBUTIL_H) && !defined(__APPLE__)
#include <libutil.h>
#elif defined(HAVE_UTIL_H)
#include <util.h>
@@ -1,23 +0,0 @@
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index c3682b4..16826c6 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -5880,15 +5880,13 @@ error:
#if defined(HAVE_OPENPTY) || defined(HAVE_FORKPTY) || defined(HAVE_DEV_PTMX)
#ifdef HAVE_PTY_H
#include <pty.h>
-#else
+#endif
#ifdef HAVE_LIBUTIL_H
#include <libutil.h>
-#else
+#endif
#ifdef HAVE_UTIL_H
#include <util.h>
-#endif /* HAVE_UTIL_H */
-#endif /* HAVE_LIBUTIL_H */
-#endif /* HAVE_PTY_H */
+#endif
#ifdef HAVE_STROPTS_H
#include <stropts.h>
#endif
@@ -271,11 +271,6 @@ in with passthru; stdenv.mkDerivation (finalAttrs: {
] ++ optionals mimetypesSupport [
# Make the mimetypes module refer to the right file
./mimetypes.patch
] ++ optionals (pythonAtLeast "3.7" && pythonOlder "3.11") [
# Fix darwin build https://bugs.python.org/issue34027
./3.7/darwin-libutil.patch
] ++ optionals (pythonAtLeast "3.11") [
./3.11/darwin-libutil.patch
] ++ optionals (pythonAtLeast "3.9" && pythonOlder "3.11" && stdenv.hostPlatform.isDarwin) [
# Stop checking for TCL/TK in global macOS locations
./3.9/darwin-tcl-tk.patch
@@ -1,6 +1,6 @@
{ lib, stdenv, substituteAll, fetchurl
, zlibSupport ? true, zlib
, bzip2, pkg-config, libffi, darwin
, bzip2, pkg-config, libffi
, sqlite, openssl, ncurses, python, expat, tcl, tk, tclPackages, libX11
, gdbm, db, xz, python-setup-hook
, optimizationLevel ? "jit", boehmgc
@@ -63,8 +63,6 @@ in with passthru; stdenv.mkDerivation rec {
zlib
] ++ lib.optionals (lib.any (l: l == optimizationLevel) [ "0" "1" "2" "3"]) [
boehmgc
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
darwin.libutil
];
# Remove bootstrap python from closure