From c2112944d74871a1f3fa66e5c469592bef5b71e0 Mon Sep 17 00:00:00 2001 From: Alexander Bantyev Date: Thu, 11 Dec 2025 18:33:21 +0100 Subject: [PATCH] kmod: add comments for all patches Adds comments to all patches to make the derivation more readable and conform with the style guide --- pkgs/os-specific/linux/kmod/default.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pkgs/os-specific/linux/kmod/default.nix b/pkgs/os-specific/linux/kmod/default.nix index f539ceca14e3..642b2b74d1ed 100644 --- a/pkgs/os-specific/linux/kmod/default.nix +++ b/pkgs/os-specific/linux/kmod/default.nix @@ -86,13 +86,26 @@ stdenv.mkDerivation rec { ++ lib.optional withStatic "--enable-static"; patches = [ + # Accept multiple default kernel module dirs at build-time, instead + # of hardcoding a single /lib/modules, and adjust module search logic + # accordingly (to account for multiple default directories) ./module-dir.patch + + # Use portable implementation for basename API + # + # musl has removed the non-prototype declaration of basename from string.h + # which now results in build errors with clang-17+ compiler + # + # Implement GNU basename behavior using strchr which is portable across libcs + # + # Fixes "call to undeclared function 'basename'" error on clang+musl (fetchpatch { name = "musl.patch"; url = "https://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git/patch/?id=11eb9bc67c319900ab00523997323a97d2d08ad2"; hash = "sha256-CYG615elMWces6QGQRg2H/NL7W4XsG9Zvz5H+xsdFFo="; }) ] + # Force configure.ac to accept --enable-static (no other changes necessary) ++ lib.optional withStatic ./enable-static.patch; postInstall = ''