diff --git a/pkgs/os-specific/linux/kmod/default.nix b/pkgs/os-specific/linux/kmod/default.nix index 0411bae2060c..a0b390b756da 100644 --- a/pkgs/os-specific/linux/kmod/default.nix +++ b/pkgs/os-specific/linux/kmod/default.nix @@ -1,5 +1,7 @@ -{ stdenv, lib, fetchurl, autoreconfHook, pkg-config +{ stdenv, lib, fetchzip, autoconf, automake, docbook_xml_dtd_42 +, docbook_xml_dtd_43, docbook_xsl, gtk-doc, libtool, pkg-config , libxslt, xz, zstd, elf-header +, withDevdoc ? stdenv.hostPlatform == stdenv.buildPlatform , withStatic ? stdenv.hostPlatform.isStatic }: @@ -11,21 +13,35 @@ in stdenv.mkDerivation rec { pname = "kmod"; version = "29"; - src = fetchurl { - url = "mirror://kernel/linux/utils/kernel/${pname}/${pname}-${version}.tar.xz"; - sha256 = "0am54mi5rk72g5q7k6l6f36gw3r9vwgjmyna43ywcjhqmakyx00b"; + # autogen.sh is missing from the release tarball, + # and we need to run it to regenerate gtk_doc.make, + # because the version in the release tarball is broken. + # Possibly this will be fixed in kmod 30? + # https://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git/commit/.gitignore?id=61a93a043aa52ad62a11ba940d4ba93cb3254e78 + src = fetchzip { + url = "https://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git/snapshot/kmod-${version}.tar.gz"; + sha256 = "sha256-7O5VdBd8rBZdIERPE+2zkjj5POvSurwlV2EpWmkFUD0="; }; - outputs = [ "out" "dev" "lib" ]; + outputs = [ "out" "dev" "lib" ] ++ lib.optional withDevdoc "devdoc"; - nativeBuildInputs = [ autoreconfHook pkg-config libxslt ]; + nativeBuildInputs = [ + autoconf automake docbook_xsl libtool libxslt pkg-config + + docbook_xml_dtd_42 # for the man pages + ] ++ lib.optionals withDevdoc [ docbook_xml_dtd_43 gtk-doc ]; buildInputs = [ xz zstd ] ++ lib.optional stdenv.isDarwin elf-header; + preConfigure = '' + ./autogen.sh + ''; + configureFlags = [ "--sysconfdir=/etc" "--with-xz" "--with-zstd" "--with-modulesdirs=${modulesDirs}" + (lib.enableFeature withDevdoc "gtk-doc") ] ++ lib.optional withStatic "--enable-static"; patches = [ ./module-dir.patch ]