From e9dd23201e34cc85c13fc88295b4989418337e4e Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Sat, 30 May 2026 13:27:00 +0200 Subject: [PATCH] pacemaker: optionally enable manpages In particular, if we are building for OCF we don't need the manpages. But then we might as well make it its own parameter with a sensible default. --- pkgs/by-name/pa/pacemaker/package.nix | 35 +++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/pkgs/by-name/pa/pacemaker/package.nix b/pkgs/by-name/pa/pacemaker/package.nix index f3122636fdad..7d670749fe05 100644 --- a/pkgs/by-name/pa/pacemaker/package.nix +++ b/pkgs/by-name/pa/pacemaker/package.nix @@ -7,11 +7,13 @@ bzip2, corosync, dbus, + docbook_xsl, fetchFromGitHub, getopt, gettext, glib, gnutls, + help2man, libqb, libtool, libuuid, @@ -29,6 +31,7 @@ # as the OCF_ROOT. forOCF ? false, ocf-resource-agents, + withManpages ? !forOCF, }: stdenv.mkDerivation (finalAttrs: { @@ -42,6 +45,8 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-23YkNzqiimLy/KjO+hxVQQ4rUhSEhn5Oc2jUJO/VRo0="; }; + outputs = [ "out" ] ++ lib.optionals withManpages [ "man" ]; + nativeBuildInputs = [ autoconf automake @@ -50,6 +55,12 @@ stdenv.mkDerivation (finalAttrs: { libtool pkg-config python3 + ] + ++ lib.optionals withManpages [ + # If we don't supply the dependencies the manpage build will be silently skipped + help2man # for tool man pages (see mk/man.mk) + libxml2 # for other man pages (xmllint) + libxslt # for other man pages (xsltproc) ]; buildInputs = [ @@ -69,6 +80,15 @@ stdenv.mkDerivation (finalAttrs: { strictDeps = true; + # If we do this unconditionally the build will fail because it sees a valid MANPAGE_XSLT + # but required executables are not available. + postPatch = lib.optionalString withManpages '' + # Avoid the use of xmlcatalog to resolve stylesheet for manpages, but set the path directly + substituteInPlace configure.ac \ + --replace-fail 'MANPAGE_XSLT=""' 'MANPAGE_XSLT="${docbook_xsl}/xml/xsl/docbook/manpages/docbook.xsl"' \ + --replace-fail 'AS_IF([test x"''${XSLTPROC}" != x""],' 'AS_IF([false],' + ''; + preConfigure = '' ./autogen.sh --prefix="$out" ''; @@ -95,11 +115,16 @@ stdenv.mkDerivation (finalAttrs: { enableParallelBuilding = true; - postInstall = '' - # pacemaker's install linking requires a weirdly nested hierarchy - mv $out$out/* $out - rm -r $out/nix - ''; + # pacemaker's install linking requires a weirdly nested hierarchy + postInstall = + lib.optionalString withManpages '' + mkdir -p $man + mv $out$man/* $man + '' + + '' + mv $out$out/* $out + rm -r $out/nix + ''; doInstallCheck = true; nativeInstallCheckInputs = [ versionCheckHook ];