kmod: enable on darwin

This is needed to build linux kernels on darwin. While we can’t
actually use it to load kernel modules, we can use it to create
indexes of modules on macOS.

(cherry picked from commit ebb31480e8a45efbaff4c4a212bdfc0b053adde0)
This commit is contained in:
Matthew Bauer
2018-12-02 14:12:42 -06:00
parent 9ddc2ec27d
commit 7a2c07d29b
2 changed files with 129 additions and 4 deletions
+6 -4
View File
@@ -1,4 +1,5 @@
{ stdenv, buildPackages, lib, fetchurl, autoreconfHook, pkgconfig, libxslt, xz }:
{ stdenv, buildPackages, lib, fetchurl, autoreconfHook, pkgconfig
, libxslt, xz, elf-header }:
let
systems = [ "/run/current-system/kernel-modules" "/run/booted-system/kernel-modules" "" ];
@@ -14,7 +15,7 @@ in stdenv.mkDerivation rec {
};
nativeBuildInputs = [ autoreconfHook pkgconfig libxslt ];
buildInputs = [ xz ];
buildInputs = [ xz elf-header ];
configureFlags = [
"--sysconfdir=/etc"
@@ -22,7 +23,8 @@ in stdenv.mkDerivation rec {
"--with-modulesdirs=${modulesDirs}"
];
patches = [ ./module-dir.patch ];
patches = [ ./module-dir.patch ]
++ lib.optional stdenv.isDarwin ./darwin.patch;
postInstall = ''
for prog in rmmod insmod lsmod modinfo modprobe depmod; do
@@ -37,6 +39,6 @@ in stdenv.mkDerivation rec {
homepage = https://www.kernel.org/pub/linux/utils/kernel/kmod/;
description = "Tools for loading and managing Linux kernel modules";
license = licenses.lgpl21;
platforms = platforms.linux;
platforms = platforms.unix;
};
}