From 822c7d7c9c228985b4879ee80d3aaf65104e1dbe Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Tue, 29 Apr 2025 17:37:37 +0200 Subject: [PATCH] util-linux: fix build on Darwin Fixes: 562035c6bdce ("util-linux: 2.40.4 -> 2.41") --- pkgs/by-name/ut/util-linux/package.nix | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/pkgs/by-name/ut/util-linux/package.nix b/pkgs/by-name/ut/util-linux/package.nix index 54f9a1dd93fc..eef5a90698c7 100644 --- a/pkgs/by-name/ut/util-linux/package.nix +++ b/pkgs/by-name/ut/util-linux/package.nix @@ -3,6 +3,8 @@ stdenv, fetchurl, pkg-config, + autoconf, + automake116x, zlib, shadow, capabilitiesSupport ? stdenv.hostPlatform.isLinux, @@ -41,11 +43,19 @@ stdenv.mkDerivation rec { hash = "sha256-ge6Ts8/f6318QJDO3rode7zpFB/QtQG2hrP+R13cpMY="; }; - patches = [ - ./rtcwake-search-PATH-for-shutdown.patch - # https://github.com/util-linux/util-linux/pull/3013 - ./fix-darwin-build.patch - ]; + patches = + [ + ./rtcwake-search-PATH-for-shutdown.patch + # https://github.com/util-linux/util-linux/pull/3013 + ./fix-darwin-build.patch + ] + ++ lib.optionals (!stdenv.hostPlatform.isLinux) [ + (fetchurl { + name = "bits-only-build-when-cpu_set_t-is-available.patch"; + url = "https://lore.kernel.org/util-linux/20250501075806.88759-1-hi@alyssa.is/raw"; + hash = "sha256-G7Cdv8636wJEjgt9am7PaDI8bpSF8sO9bFWEIiAL25A="; + }) + ]; # We separate some of the utilities into their own outputs. This # allows putting together smaller systems depending on only part of @@ -138,6 +148,10 @@ stdenv.mkDerivation rec { pkg-config installShellFiles ] + ++ lib.optionals (!stdenv.hostPlatform.isLinux) [ + autoconf + automake116x + ] ++ lib.optionals translateManpages [ po4a ] ++ lib.optionals (cryptsetupSupport == "dlopen") [ cryptsetup ];