mirror of
https://github.com/void-linux/void-packages.git
synced 2025-06-09 08:33:51 +02:00
mpc: build documentation and manpages with Sphinx, adopt.
This commit is contained in:
parent
bdb9dc7d2a
commit
31802f50bf
2 changed files with 89 additions and 4 deletions
85
srcpkgs/mpc/patches/add-docs-switch.patch
Normal file
85
srcpkgs/mpc/patches/add-docs-switch.patch
Normal file
|
@ -0,0 +1,85 @@
|
||||||
|
From a338ce20f68ecff14600b30b946d07c8e8ec11e2 Mon Sep 17 00:00:00 2001
|
||||||
|
From: maxice8 <thinkabit.ukim@gmail.com>
|
||||||
|
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')
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
# Template file for 'mpc'
|
# Template file for 'mpc'
|
||||||
pkgname=mpc
|
pkgname=mpc
|
||||||
version=0.30
|
version=0.30
|
||||||
revision=1
|
revision=2
|
||||||
build_style=meson
|
build_style=meson
|
||||||
configure_args="-Dtest=true"
|
configure_args="-Dtest=true -Ddocs=true"
|
||||||
hostmakedepends="pkg-config"
|
hostmakedepends="pkg-config python3-Sphinx"
|
||||||
makedepends="libmpdclient-devel check-devel"
|
makedepends="libmpdclient-devel check-devel"
|
||||||
short_desc="Minimalist command line interface to MPD"
|
short_desc="Minimalist command line interface to MPD"
|
||||||
maintainer="Juan RP <xtraeme@voidlinux.eu>"
|
maintainer="maxice8 <thinkabit.ukim@gmail.com>"
|
||||||
license="GPL-2.0-or-later"
|
license="GPL-2.0-or-later"
|
||||||
homepage="http://www.musicpd.org/clients/mpc/"
|
homepage="http://www.musicpd.org/clients/mpc/"
|
||||||
#changelog="https://raw.githubusercontent.com/MusicPlayerDaemon/mpc/master/NEWS"
|
#changelog="https://raw.githubusercontent.com/MusicPlayerDaemon/mpc/master/NEWS"
|
||||||
|
|
Loading…
Add table
Reference in a new issue