mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-06-05 21:03:40 +00:00
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.
This commit is contained in:
@@ -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 ];
|
||||
|
||||
Reference in New Issue
Block a user