Unverified Commit 884b4116 authored by Mikael Voss's avatar Mikael Voss
Browse files

linux-manual: provide simple installation check

parent b26abf80
Loading
Loading
Loading
Loading
+13 −3
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  perl,
  linuxPackages_latest,
  perl,
  man,
}:

stdenv.mkDerivation {
@@ -10,9 +11,11 @@ stdenv.mkDerivation {
  inherit (linuxPackages_latest.kernel) version src;

  nativeBuildInputs = [ perl ];
  nativeInstallCheckInputs = [ man ];

  dontConfigure = true;
  dontBuild = true;
  doInstallCheck = true;

  postPatch = ''
    patchShebangs --build \
@@ -35,11 +38,18 @@ stdenv.mkDerivation {
        "$SHELL" -c '{ scripts/kernel-doc -man "$@" || :; } \
          | scripts/split-man.pl "$mandir"' kernel-doc

    test -f "$mandir/kmalloc.9"

    runHook postInstall
  '';

  installCheckPhase = ''
    runHook preInstallCheck

    # Check for well‐known man page
    man -M "$out/share/man" -P cat 9 kmalloc >/dev/null

    runHook postInstallCheck
  '';

  meta = {
    homepage = "https://kernel.org/";
    description = "Linux kernel API manual pages";