dev-ruby/rbpdf: cleanup
[gentoo.git] / dev-ruby / pygments_rb / pygments_rb-1.2.1-r1.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 USE_RUBY="ruby23 ruby24 ruby25 ruby26"
7 PYTHON_COMPAT=( python2_7 )
8
9 RUBY_FAKEGEM_NAME="pygments.rb"
10 MY_P="${RUBY_FAKEGEM_NAME}-${PV}"
11
12 RUBY_FAKEGEM_RECIPE_TEST="rake"
13 RUBY_FAKEGEM_RECIPE_DOC="none"
14 RUBY_FAKEGEM_EXTRADOC="CHANGELOG.md README.md"
15
16 RUBY_FAKEGEM_GEMSPEC="${RUBY_FAKEGEM_NAME}.gemspec"
17
18 inherit ruby-fakegem python-single-r1
19
20 DESCRIPTION="Pygments syntax highlighting in ruby"
21 HOMEPAGE="https://github.com/tmm1/pygments.rb"
22
23 LICENSE="MIT"
24 SLOT="0"
25 KEYWORDS="~amd64"
26 IUSE=""
27 REQUIRED_USE+=" ${PYTHON_REQUIRED_USE}"
28
29 RUBY_S="${MY_P}"
30
31 RDEPEND+="
32         ${PYTHON_DEPS}
33         $(python_gen_cond_dep '
34                 >=dev-python/pygments-2.2.0[${PYTHON_MULTI_USEDEP}]
35                 dev-python/simplejson[${PYTHON_MULTI_USEDEP}]
36         ')"
37 DEPEND+=" test? ( ${RDEPEND} )"
38
39 ruby_add_rdepend ">=dev-ruby/multi_json-1.0.0"
40 ruby_add_bdepend "dev-ruby/rake-compiler"
41
42 pkg_setup() {
43         ruby-ng_pkg_setup
44         python-single-r1_pkg_setup
45 }
46
47 all_ruby_prepare() {
48         sed -i -e '/[Bb]undler/d' Rakefile || die
49         sed -i -e '/s.files/d' pygments.rb.gemspec || die
50         python_fix_shebang lib/pygments/mentos.py
51         # we are loosing a "custom github lexer here", no idea what it is,
52         # but if we need it, it should go into dev-python/pygments
53         rm -r vendor lexers || die "removing bundled libs failed"
54 }
55
56 each_ruby_compile() {
57         # regenerate the lexer cache, based on the system pygments pkg
58         ${RUBY} cache-lexers.rb || die "regenerating lexer cache failed"
59 }
60
61 each_ruby_install() {
62         each_fakegem_install
63         ruby_fakegem_doins lexers
64 }