From c1a33e86b561b10fac55c3b0b4f2c552353d634a Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Fri, 27 Mar 2026 01:10:17 +0100 Subject: [PATCH] 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. --- pkgs/by-name/li/libnl/package.nix | 32 +++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/pkgs/by-name/li/libnl/package.nix b/pkgs/by-name/li/libnl/package.nix index 8931b841a88e..4e7ec50f0d16 100644 --- a/pkgs/by-name/li/libnl/package.nix +++ b/pkgs/by-name/li/libnl/package.nix @@ -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" '';