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

This commit is contained in:
Emily 2024-11-07 01:05:45 +00:00 committed by GitHub
commit 8072991b1d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
20 changed files with 19 additions and 86 deletions

View File

@ -1,4 +1,4 @@
{ lib, stdenv, fetchFromGitHub, pkg-config, ncurses, buildPackages, darwin }:
{ lib, stdenv, fetchFromGitHub, pkg-config, ncurses, buildPackages }:
stdenv.mkDerivation {
pname = "mg";
@ -25,7 +25,7 @@ stdenv.mkDerivation {
'';
nativeBuildInputs = [ pkg-config ];
buildInputs = [ ncurses ] ++ lib.optional stdenv.isDarwin [ darwin.libutil ];
buildInputs = [ ncurses ];
meta = with lib; {
description = "Micro GNU/emacs, a portable version of the mg maintained by the OpenBSD team";

View File

@ -139,7 +139,6 @@ stdenv.mkDerivation (finalAttrs: {
# Xcode project or pass it as a flag to xcodebuild as well.
postConfigure = ''
substituteInPlace src/auto/config.mk \
--replace "PERL_CFLAGS${"\t"}=" "PERL_CFLAGS${"\t"}= -I${darwin.libutil}/include" \
--replace " -L${stdenv.cc.libc}/lib" "" \
--replace " -L${darwin.libobjc}/lib" "" \
--replace " -L${darwin.libunwind}/lib" "" \

View File

@ -7,8 +7,6 @@
, suitesparse
, python3
, libintl
, libiconv
, darwin
}:
let
# this is a fork version of fetk (http://www.fetk.org/)
@ -87,8 +85,6 @@ stdenv.mkDerivation (finalAttrs: {
python3
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
libintl
libiconv
darwin.libutil
];
cmakeFlags = [

View File

@ -12,7 +12,6 @@
, antlr4
, capnproto
, nlohmann_json
, darwin
}:
stdenv.mkDerivation (finalAttrs: {
@ -46,7 +45,7 @@ stdenv.mkDerivation (finalAttrs: {
capnproto
antlr4.runtime.cpp
nlohmann_json
] ++ lib.optional stdenv.isDarwin [ darwin.libutil ];
];
cmakeFlags = [
"-DSURELOG_USE_HOST_CAPNP=On"

View File

@ -5,7 +5,6 @@
, python3
, capnproto
, gtest
, darwin
}:
stdenv.mkDerivation (finalAttrs: {
@ -29,8 +28,6 @@ stdenv.mkDerivation (finalAttrs: {
buildInputs = [
capnproto
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
darwin.libutil
];
cmakeFlags = [

View File

@ -1,4 +1,4 @@
{ lib, fetchurl, stdenv, zlib, ncurses, libiconv, darwin }:
{ lib, fetchurl, stdenv, zlib, ncurses, libiconv, apple-sdk_11, darwinMinVersionHook }:
stdenv.mkDerivation (finalAttrs: {
pname = "fnc";
@ -9,18 +9,13 @@ stdenv.mkDerivation (finalAttrs: {
hash = "sha256-npS+sOxF0S/9TuFjtEFlev0HpIOsaP6zmcfopPNUehk=";
};
buildInputs = [ libiconv ncurses zlib ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
darwin.libutil
];
buildInputs = [ libiconv ncurses zlib apple-sdk_11 (darwinMinVersionHook "11.0") ];
makeFlags = [ "PREFIX=$(out)" ];
env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.cc.isGNU [
# Needed with GCC 12
"-Wno-error=maybe-uninitialized"
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
# error: 'strtonum' is only available on macOS 11.0 or newer
"-Wno-error=unguarded-availability-new"
]);
preInstall = ''

View File

@ -54,6 +54,8 @@ self: super: {
libiconv
darwin.libresolv
darwin.libsbuf
# Shipped with the SDK only as a library with no headers
(lib.getLib darwin.libutil)
# Required by some SDK headers
cupsHeaders
]

View File

@ -6,7 +6,6 @@
cmake,
gettext,
msgpack-c,
darwin,
libuv,
lua,
pkg-config,
@ -145,7 +144,6 @@ stdenv.mkDerivation (
tree-sitter
unibilium
]
++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.libutil ]
++ lib.optionals finalAttrs.finalPackage.doCheck [
glibcLocales
procps

View File

@ -1,4 +1,4 @@
{ lib, stdenv, fetchFromGitHub, makeWrapper, darwin }:
{ lib, stdenv, fetchFromGitHub, makeWrapper }:
stdenv.mkDerivation rec {
version = "0.11";
@ -13,8 +13,6 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ makeWrapper ];
buildInputs = lib.optional stdenv.hostPlatform.isDarwin darwin.libutil;
installPhase = ''
make install PREFIX="$out"
'';

View File

@ -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

View File

@ -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>

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -87,7 +87,11 @@ stdenv.mkDerivation (finalAttrs: {
nativeBuildInputs = [ automake autoconf libtool pkg-config ];
buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ darwin.libutil ];
# This is part of the Darwin bootstrap, so we dont always get
# `libutil.dylib` automatically propagated through the SDK.
buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [
(lib.getLib darwin.libutil)
];
preConfigure = ''
LIBTOOLIZE=libtoolize ./autogen.sh

View File

@ -11,7 +11,6 @@
groff,
compatIfNeeded,
fts,
darwin,
stdenv,
}:
@ -44,8 +43,7 @@ mkDerivation {
# fts header is needed. glibc already has this header, but musl doesn't,
# so make sure pkgsMusl.netbsd.install still builds in case you want to
# remove it!
++ [ fts ]
++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.libutil ];
++ [ fts ];
installPhase = ''
runHook preInstall

View File

@ -21,7 +21,7 @@ mkAppleDerivation {
];
buildInputs = [
apple-sdk_14
(apple-sdk_14.override { enableBootstrap = true; })
copyfile
];

View File

@ -1,4 +1,4 @@
{ lib, stdenv, fetchpatch, fetchzip, writeText, darwin, conf ? null }:
{ lib, stdenv, fetchpatch, fetchzip, writeText, conf ? null }:
let
rev = "8c32909a159aaa9484c82b71f05b7a73321eb491";
@ -21,10 +21,6 @@ stdenv.mkDerivation {
installFlags = [ "install-completion" ];
CFLAGS = lib.optionalString stdenv.hostPlatform.isDarwin "-D_DARWIN_C_SOURCE";
buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [
darwin.libutil
];
patches = [
# https://github.com/martanne/abduco/pull/22
(fetchpatch {

View File

@ -1,4 +1,4 @@
{ lib, stdenv, fetchFromGitHub, ncurses, darwin }:
{ lib, stdenv, fetchFromGitHub, ncurses }:
stdenv.mkDerivation rec {
pname = "mtm";
@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
sha256 = "0gibrvah059z37jvn1qs4b6kvd4ivk2mfihmcpgx1vz6yg70zghv";
};
buildInputs = [ ncurses ] ++ lib.optionals stdenv.isDarwin [ darwin.libutil ];
buildInputs = [ ncurses ];
makeFlags = [ "DESTDIR=${placeholder "out"}" "MANDIR=${placeholder "out"}/share/man/man1" ];

View File

@ -32,8 +32,6 @@ stdenv.mkDerivation rec {
openssl
protobuf
zlib
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
darwin.libutil
];
preBuild = ''