]> git.draconx.ca Git - gentoo-fixes.git/blob - dev-python/python-musicbrainz-ngs/python-musicbrainz-ngs-0.6.ebuild
dev-python/python-musicbrainz-ngs: Fix examples installation.
[gentoo-fixes.git] / dev-python / python-musicbrainz-ngs / python-musicbrainz-ngs-0.6.ebuild
1 # Copyright © 2020 Nick Bowler
2 # License GPLv2+: GNU General Public License version 2 or any later version.
3 # This is free software: you are free to change and redistribute it.
4 # There is NO WARRANTY, to the extent permitted by law.
5 #
6 # This is a modified version of the original ebuild from Gentoo GNU/Linux,
7 # covered by the following copyright and permission notice:
8 #
9 #   Copyright 2019-2020 Gentoo Authors
10 #   Distributed under the terms of the GNU General Public License v2
11
12 EAPI=7
13
14 PYTHON_COMPAT=( python2_7 python3_{6,7} )
15
16 inherit distutils-r1
17
18 MY_PN=${PN%-ngs}ngs
19 MY_P=$MY_PN-$PV
20
21 DESCRIPTION="Python bindings for the MusicBrainz NGS and the Cover Art Archive webservices"
22 HOMEPAGE="https://github.com/alastair/python-musicbrainzngs"
23 SRC_URI="https://github.com/alastair/$MY_PN/archive/v$PV.tar.gz -> $MY_P.tar.gz"
24
25 LICENSE="BSD-2 ISC"
26 SLOT="0"
27 KEYWORDS="amd64 x86"
28 IUSE="doc examples test"
29 RESTRICT="!test? ( test )"
30
31 S=$WORKDIR/$MY_P
32
33 PATCHES="$FILESDIR/$PN-0.6-fix-test-submit.patch"
34
35 DEPEND="dev-python/setuptools[$PYTHON_USEDEP]
36         doc? ( dev-python/sphinx[$PYTHON_USEDEP] )"
37
38 python_prepare_all() {
39         # Prevent un-needed d'loading
40         sed -e "s/^ *'sphinx.ext.intersphinx'//" -i docs/conf.py || die
41         distutils-r1_python_prepare_all
42 }
43
44 python_compile_all() {
45         use doc && emake -C docs html
46 }
47
48 python_test() {
49         esetup.py test --verbosity=2
50 }
51
52 python_install_all() {
53         use doc && local HTML_DOCS=( docs/_build/html/. )
54
55         if use examples; then
56                 dodoc -r examples
57                 docompress -x "/usr/share/doc/$PF/examples"
58         fi
59
60         distutils-r1_python_install_all
61 }