openvswitch: generalize builder
[NixPkgs.git] / pkgs / data / documentation / linux-manual / default.nix
blob27690f9b99cd57725328e3a766759ac75928bfe0
1 { lib, stdenv, fetchurl, perl, linuxPackages_latest }:
3 stdenv.mkDerivation rec {
4   pname = "linux-manual";
5   inherit (linuxPackages_latest.kernel) version src;
7   nativeBuildInputs = [ perl ];
9   dontConfigure = true;
10   dontBuild = true;
12   postPatch = ''
13     patchShebangs --build \
14       scripts/kernel-doc \
15       scripts/split-man.pl
16   '';
18   installPhase = ''
19     mandir=$out/share/man/man9
20     mkdir -p $mandir
22     KBUILD_BUILD_TIMESTAMP=$(stat -c %Y Makefile) \
23     grep -F -l -Z \
24       --exclude-dir Documentation \
25       --exclude-dir tools \
26       -R '/**' \
27       | xargs -0 -n 256 -P $NIX_BUILD_CORES \
28         $SHELL -c '{ scripts/kernel-doc -man "$@" || :; } \
29           | scripts/split-man.pl '$mandir kernel-doc
31     test -f $mandir/kmalloc.9
32   '';
34   meta = with lib; {
35     homepage = "https://kernel.org/";
36     description = "Linux kernel API manual pages";
37     license = licenses.gpl2Only;
38     maintainers = with maintainers; [ mvs ];
39   };