libnl: optionally actually build docs

A bunch of big dependencies were pulled in, but the documentation was not actually generated.

See https://github.com/thom311/libnl/issues/422#issuecomment-2671351008 / `tools/build_release.sh` .

Since the docs have been broken and I don't see any issues complaining about it they are now off by default to
minimize dependencies.

The doc build also wants pygments.
This commit is contained in:
Stefan Frijters
2026-03-27 01:25:21 +01:00
parent 6e5fb42326
commit c1a33e86b5
+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"
'';