diff --git a/srcpkgs/mpc/patches/add-docs-switch.patch b/srcpkgs/mpc/patches/add-docs-switch.patch new file mode 100644 index 00000000000..cb5044d26fb --- /dev/null +++ b/srcpkgs/mpc/patches/add-docs-switch.patch @@ -0,0 +1,85 @@ +From a338ce20f68ecff14600b30b946d07c8e8ec11e2 Mon Sep 17 00:00:00 2001 +From: maxice8 +Date: Sat, 25 Aug 2018 17:56:48 -0300 +Subject: [PATCH] meson: add docs combo switch. + +--- + doc/meson.build | 40 ++++++++++++++++++---------------------- + meson.build | 13 ++++++++++++- + meson_options.txt | 4 ++++ + 3 files changed, 34 insertions(+), 23 deletions(-) + +--- doc/meson.build ++++ doc/meson.build +@@ -1,23 +1,19 @@ +-sphinx = find_program('sphinx-build', required:false) ++custom_target( ++ 'HTML documentation', ++ output: 'html', ++ input: ['index.rst', 'conf.py'], ++ command: [sphinx, '-q', '-b', 'html', '-d', '@OUTDIR@/doctrees', meson.current_source_dir(), '@OUTPUT@'], ++ build_by_default: true, ++ install: true, ++ install_dir: join_paths(get_option('datadir'), 'doc', meson.project_name()), ++) + +-if sphinx.found() +- custom_target( +- 'HTML documentation', +- output: 'html', +- input: ['index.rst', 'conf.py'], +- command: [sphinx, '-q', '-b', 'html', '-d', '@OUTDIR@/doctrees', meson.current_source_dir(), '@OUTPUT@'], +- build_by_default: true, +- install: true, +- install_dir: join_paths(get_option('datadir'), 'doc', meson.project_name()), +- ) +- +- custom_target( +- 'Manpage documentation', +- output: 'man', +- input: ['index.rst', 'conf.py'], +- command: [sphinx, '-q', '-b', 'man', '-d', '@OUTDIR@/doctrees', meson.current_source_dir(), '@OUTPUT@/man1'], +- build_by_default: true, +- install: true, +- install_dir: get_option('datadir'), +- ) +-endif ++custom_target( ++ 'Manpage documentation', ++ output: 'man', ++ input: ['index.rst', 'conf.py'], ++ command: [sphinx, '-q', '-b', 'man', '-d', '@OUTDIR@/doctrees', meson.current_source_dir(), '@OUTPUT@/man1'], ++ build_by_default: true, ++ install: true, ++ install_dir: get_option('datadir'), ++) +--- meson.build ++++ meson.build +@@ -114,4 +114,15 @@ if get_option('test') + subdir('test') + endif + +-subdir('doc') ++with_docs = get_option('docs') ++sphinx = find_program('sphinx-build', required: false) ++ ++if with_docs == 'auto' and sphinx.found() ++ subdir('doc') ++elif with_docs == 'true' ++ if not sphinx.found() ++ error('docs enabled but sphinx-build not found') ++ endif ++ subdir('doc') ++endif ++ +--- meson_options.txt ++++ meson_options.txt +@@ -6,3 +6,7 @@ option('iconv', type: 'combo', + option('test', type: 'boolean', + value: false, + description: 'Enable unit tests') ++ ++option('docs', type: 'combo', ++ choices: ['true', 'false', 'auto'], value: 'auto', ++ description: 'Build documentation and manpage with Sphinx') + diff --git a/srcpkgs/mpc/template b/srcpkgs/mpc/template index 64e11488f1d..34b0bbf034d 100644 --- a/srcpkgs/mpc/template +++ b/srcpkgs/mpc/template @@ -1,13 +1,13 @@ # Template file for 'mpc' pkgname=mpc version=0.30 -revision=1 +revision=2 build_style=meson -configure_args="-Dtest=true" -hostmakedepends="pkg-config" +configure_args="-Dtest=true -Ddocs=true" +hostmakedepends="pkg-config python3-Sphinx" makedepends="libmpdclient-devel check-devel" short_desc="Minimalist command line interface to MPD" -maintainer="Juan RP " +maintainer="maxice8 " license="GPL-2.0-or-later" homepage="http://www.musicpd.org/clients/mpc/" #changelog="https://raw.githubusercontent.com/MusicPlayerDaemon/mpc/master/NEWS"