1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 USE_RUBY="ruby23 ruby24 ruby25 ruby26"
7 PYTHON_COMPAT=( python2_7 )
9 RUBY_FAKEGEM_NAME="pygments.rb"
10 MY_P="${RUBY_FAKEGEM_NAME}-${PV}"
12 RUBY_FAKEGEM_RECIPE_TEST="rake"
13 RUBY_FAKEGEM_RECIPE_DOC="none"
14 RUBY_FAKEGEM_EXTRADOC="CHANGELOG.md README.md"
16 RUBY_FAKEGEM_GEMSPEC="${RUBY_FAKEGEM_NAME}.gemspec"
18 inherit ruby-fakegem python-single-r1
20 DESCRIPTION="Pygments syntax highlighting in ruby"
21 HOMEPAGE="https://github.com/tmm1/pygments.rb"
27 REQUIRED_USE+=" ${PYTHON_REQUIRED_USE}"
33 $(python_gen_cond_dep '
34 >=dev-python/pygments-2.2.0[${PYTHON_MULTI_USEDEP}]
35 dev-python/simplejson[${PYTHON_MULTI_USEDEP}]
37 DEPEND+=" test? ( ${RDEPEND} )"
39 ruby_add_rdepend ">=dev-ruby/multi_json-1.0.0"
40 ruby_add_bdepend "dev-ruby/rake-compiler"
44 python-single-r1_pkg_setup
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"
57 # regenerate the lexer cache, based on the system pygments pkg
58 ${RUBY} cache-lexers.rb || die "regenerating lexer cache failed"
63 ruby_fakegem_doins lexers