git: 8370ed121639 - main - sysutils/upower: Fix build when xsltproc is present and MANPAGES disabled

From: Guido Falsi <madpilot_at_FreeBSD.org>
Date: Mon, 28 Mar 2022 19:22:09 UTC
The branch main has been updated by madpilot:

URL: https://cgit.FreeBSD.org/ports/commit/?id=8370ed121639270a4196b3d609f5d9baf92d698a

commit 8370ed121639270a4196b3d609f5d9baf92d698a
Author:     Guido Falsi <madpilot@FreeBSD.org>
AuthorDate: 2022-03-28 19:14:06 +0000
Commit:     Guido Falsi <madpilot@FreeBSD.org>
CommitDate: 2022-03-28 19:22:04 +0000

    sysutils/upower: Fix build when xsltproc is present and MANPAGES disabled
    
    The new meson build system performs an unconditional check for
    xsltproc, even when bot gtk_doc and man options are disabled, marking
    it only as required if any of those options are enabled.
    
    if xsltproc is found building manual pages and gtk_doc files is
    performed unconditionally, but, when the MANPAGES option is disabled,
    gtk-doc is not required and most probably missing from the system,
    causing the build to fail.
    
    Fix by performing the check for sltproc only when one of those two
    options are enabled, and disabling building all docs otherwise.
    
    PR:             262885
    Fixes:          4025875f76dd78090a158a3077ca447a05722510
---
 sysutils/upower/files/patch-meson.build | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/sysutils/upower/files/patch-meson.build b/sysutils/upower/files/patch-meson.build
index 9108eefe6942..42a7e4747166 100644
--- a/sysutils/upower/files/patch-meson.build
+++ b/sysutils/upower/files/patch-meson.build
@@ -1,6 +1,19 @@
 --- meson.build.orig	2022-03-09 17:46:34 UTC
 +++ meson.build
-@@ -105,7 +105,7 @@ endif
+@@ -47,7 +47,11 @@ m_dep = cc.find_library('m', required: true)
+ gio_unix_dep = dependency('gio-unix-2.0', version: '>=' + glib_min_version)
+ m_dep = cc.find_library('m', required: true)
+ 
+-xsltproc = find_program('xsltproc', disabler: true, required: get_option('gtk-doc') or get_option('man'))
++if get_option('gtk-doc') or get_option('man')
++  xsltproc = find_program('xsltproc', disabler: true, required: get_option('gtk-doc') or get_option('man'))
++else
++  xsltproc = disabler()
++endif
+ 
+ # Resolve OS backend
+ os_backend = get_option('os_backend')
+@@ -105,7 +109,7 @@ subdir('etc')
  config_h = configure_file(output: 'config.h', configuration: cdata)
  
  subdir('etc')