libnl: optionally actually build docs (#503901)

This commit is contained in:
Franz Pletz
2026-04-04 06:51:24 +00:00
committed by GitHub
+26 -6
View File
@@ -7,14 +7,16 @@
bison,
flex,
pkg-config,
pythonSupport ? false,
swig ? null,
python ? null,
enableDocs ? false,
doxygen,
graphviz,
mscgen,
asciidoc,
sourceHighlight,
pythonSupport ? false,
swig ? null,
python ? null,
python3Packages,
}:
stdenv.mkDerivation (finalAttrs: {
@@ -34,23 +36,31 @@ stdenv.mkDerivation (finalAttrs: {
"out"
"man"
]
++ lib.optional pythonSupport "py";
++ lib.optional pythonSupport "py"
++ lib.optional enableDocs "doc";
enableParallelBuilding = true;
configureFlags = [ (lib.enableFeature enableDocs "doc") ];
nativeBuildInputs = [
autoreconfHook
bison
flex
pkg-config
file
]
++ lib.optionals pythonSupport [
swig
]
++ lib.optionals enableDocs [
doxygen
graphviz
mscgen
asciidoc
sourceHighlight
]
++ lib.optional pythonSupport swig;
python3Packages.pygments
];
postBuild = lib.optionalString pythonSupport ''
cd python
@@ -58,6 +68,16 @@ stdenv.mkDerivation (finalAttrs: {
cd -
'';
postInstall = lib.optionalString enableDocs ''
patchShebangs doc
# See tools/build_release.sh
make -C doc
make -C doc gendoc
make -C doc dist
mkdir -p $doc/share/doc/libnl
cp doc/libnl-doc-${finalAttrs.version}.tar.gz $doc/share/doc/libnl
'';
postFixup = lib.optionalString pythonSupport ''
mv "pythonlib/" "$py"
'';