91ea2a1703ab67eb6c7ed4c9bac58cf9434683c9
[gentoo.git] / dev-ruby / rbst / rbst-0.5.1.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5 PYTHON_COMPAT=( python{2_7,3_5,3_6,3_7} )
6 USE_RUBY="ruby23 ruby24 ruby25 ruby26"
7
8 RUBY_FAKEGEM_NAME="RbST"
9 RUBY_FAKEGEM_GEMSPEC="RbST.gemspec"
10
11 inherit python-single-r1 ruby-fakegem
12
13 DESCRIPTION="A simple Ruby wrapper for processing rST via docutils"
14 HOMEPAGE="https://github.com/alphabetum/rbst"
15 SRC_URI="https://github.com/alphabetum/rbst/archive/${PV}.tar.gz -> ${P}.tar.gz"
16
17 LICENSE="MIT"
18 SLOT="0"
19 KEYWORDS="~amd64"
20 IUSE="test"
21
22 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
23
24 RDEPEND="dev-python/docutils ${PYTHON_DEPS}"
25 DEPEND="test? ( ${RDEPEND} )"
26
27 ruby_add_bdepend "
28         test? (
29                 >=dev-ruby/mocha-1.1.0:1.0
30                 >=dev-ruby/shoulda-3.5.0:3
31                 >=dev-ruby/test-unit-3.0.9:2
32         )"
33
34 # Tests are pretty much useless as they depend on very specific output
35 # from an unknown docutils version.
36 RESTRICT="test"
37
38 pkg_setup() {
39         python-single-r1_pkg_setup
40         ruby-ng_pkg_setup
41 }
42
43 all_ruby_prepare() {
44         # do not use bundler
45         sed -i -e '/bundler/,/end/d' \
46                 Rakefile test/helper.rb || die
47
48         # force our python version
49         sed -i -e "s:\(python_path=\"\)python:\1${EPYTHON}:" lib/rbst.rb || die
50         python_fix_shebang lib/rst2parts
51 }