From 1152ae98e34f9d0a60f62c61339182eaf70f142b Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Sun, 12 Apr 2026 21:36:14 +0200 Subject: [PATCH 1/4] pacemaker: enable strictDeps --- pkgs/by-name/pa/pacemaker/package.nix | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/pa/pacemaker/package.nix b/pkgs/by-name/pa/pacemaker/package.nix index a9e5a0fc5a8b..7a775ee11e54 100644 --- a/pkgs/by-name/pa/pacemaker/package.nix +++ b/pkgs/by-name/pa/pacemaker/package.nix @@ -8,6 +8,8 @@ corosync, dbus, fetchFromGitHub, + getopt, + gettext, glib, gnutls, libqb, @@ -42,25 +44,30 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ autoconf automake + gettext + getopt libtool pkg-config + python3 ]; buildInputs = [ bash bzip2 corosync - dbus.dev + dbus glib gnutls libqb + libtool libuuid - libxml2.dev - libxslt.dev + libxml2 + libxslt pam - python3 ]; + strictDeps = true; + preConfigure = '' ./autogen.sh --prefix="$out" ''; From 56edd414f6b9f218ba77afbf58b976d97effeed9 Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Sun, 12 Apr 2026 21:38:05 +0200 Subject: [PATCH 2/4] pacemaker: use tag/hash in fetcher --- pkgs/by-name/pa/pacemaker/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/pa/pacemaker/package.nix b/pkgs/by-name/pa/pacemaker/package.nix index 7a775ee11e54..bc670ea43265 100644 --- a/pkgs/by-name/pa/pacemaker/package.nix +++ b/pkgs/by-name/pa/pacemaker/package.nix @@ -37,8 +37,8 @@ stdenv.mkDerivation (finalAttrs: { src = fetchFromGitHub { owner = "ClusterLabs"; repo = "pacemaker"; - rev = "Pacemaker-${finalAttrs.version}"; - sha256 = "sha256-23YkNzqiimLy/KjO+hxVQQ4rUhSEhn5Oc2jUJO/VRo0="; + tag = "Pacemaker-${finalAttrs.version}"; + hash = "sha256-23YkNzqiimLy/KjO+hxVQQ4rUhSEhn5Oc2jUJO/VRo0="; }; nativeBuildInputs = [ From 6c5cff998a322bee516ac0336e9d0f2fb21d84d2 Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Sun, 12 Apr 2026 21:37:47 +0200 Subject: [PATCH 3/4] pacemaker: add versionCheckHook --- pkgs/by-name/pa/pacemaker/package.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/by-name/pa/pacemaker/package.nix b/pkgs/by-name/pa/pacemaker/package.nix index bc670ea43265..f3122636fdad 100644 --- a/pkgs/by-name/pa/pacemaker/package.nix +++ b/pkgs/by-name/pa/pacemaker/package.nix @@ -21,6 +21,7 @@ pkg-config, python3, nixosTests, + versionCheckHook, # Pacemaker is compiled twice, once with forOCF = true to extract its # OCF definitions for use in the ocf-resource-agents derivation, then @@ -100,6 +101,11 @@ stdenv.mkDerivation (finalAttrs: { rm -r $out/nix ''; + doInstallCheck = true; + nativeInstallCheckInputs = [ versionCheckHook ]; + versionCheckProgram = [ "${placeholder "out"}/sbin/pacemakerd" ]; + versionCheckProgramArg = "--version"; + passthru.tests = { inherit (nixosTests) pacemaker; }; From e9dd23201e34cc85c13fc88295b4989418337e4e Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Sat, 30 May 2026 13:27:00 +0200 Subject: [PATCH 4/4] 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 ];