summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2020-02-07 13:59:01 +0100
committerMichał Górny <mgorny@gentoo.org>2020-02-09 17:18:01 +0100
commit6f5fc2c6210fc7a5b12b1367cf12a9cd14d94732 (patch)
tree6f8f04ec5261b9439d5c415dcb1b9d92d9a79e24 /dev-ruby/pygments_rb/pygments_rb-1.2.1-r1.ebuild
parentdev-python/uranium: Switch to PYTHON_MULTI_USEDEP API (diff)
downloadgentoo-6f5fc2c6210fc7a5b12b1367cf12a9cd14d94732.tar.gz
gentoo-6f5fc2c6210fc7a5b12b1367cf12a9cd14d94732.tar.bz2
gentoo-6f5fc2c6210fc7a5b12b1367cf12a9cd14d94732.zip
dev-ruby/pygments_rb: Switch to PYTHON_MULTI_USEDEP API
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-ruby/pygments_rb/pygments_rb-1.2.1-r1.ebuild')
-rw-r--r--dev-ruby/pygments_rb/pygments_rb-1.2.1-r1.ebuild64
1 files changed, 64 insertions, 0 deletions
diff --git a/dev-ruby/pygments_rb/pygments_rb-1.2.1-r1.ebuild b/dev-ruby/pygments_rb/pygments_rb-1.2.1-r1.ebuild
new file mode 100644
index 000000000000..23f293301191
--- /dev/null
+++ b/dev-ruby/pygments_rb/pygments_rb-1.2.1-r1.ebuild
@@ -0,0 +1,64 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+USE_RUBY="ruby23 ruby24 ruby25 ruby26"
+PYTHON_COMPAT=( python2_7 )
+
+RUBY_FAKEGEM_NAME="pygments.rb"
+MY_P="${RUBY_FAKEGEM_NAME}-${PV}"
+
+RUBY_FAKEGEM_RECIPE_TEST="rake"
+RUBY_FAKEGEM_RECIPE_DOC="none"
+RUBY_FAKEGEM_EXTRADOC="CHANGELOG.md README.md"
+
+RUBY_FAKEGEM_GEMSPEC="${RUBY_FAKEGEM_NAME}.gemspec"
+
+inherit ruby-fakegem python-single-r1
+
+DESCRIPTION="Pygments syntax highlighting in ruby"
+HOMEPAGE="https://github.com/tmm1/pygments.rb"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE=""
+REQUIRED_USE+=" ${PYTHON_REQUIRED_USE}"
+
+RUBY_S="${MY_P}"
+
+RDEPEND+="
+ ${PYTHON_DEPS}
+ $(python_gen_cond_dep '
+ >=dev-python/pygments-2.2.0[${PYTHON_MULTI_USEDEP}]
+ dev-python/simplejson[${PYTHON_MULTI_USEDEP}]
+ ')"
+DEPEND+=" test? ( ${RDEPEND} )"
+
+ruby_add_rdepend ">=dev-ruby/multi_json-1.0.0"
+ruby_add_bdepend "dev-ruby/rake-compiler"
+
+pkg_setup() {
+ ruby-ng_pkg_setup
+ python-single-r1_pkg_setup
+}
+
+all_ruby_prepare() {
+ sed -i -e '/[Bb]undler/d' Rakefile || die
+ sed -i -e '/s.files/d' pygments.rb.gemspec || die
+ python_fix_shebang lib/pygments/mentos.py
+ # we are loosing a "custom github lexer here", no idea what it is,
+ # but if we need it, it should go into dev-python/pygments
+ rm -r vendor lexers || die "removing bundled libs failed"
+}
+
+each_ruby_compile() {
+ # regenerate the lexer cache, based on the system pygments pkg
+ ${RUBY} cache-lexers.rb || die "regenerating lexer cache failed"
+}
+
+each_ruby_install() {
+ each_fakegem_install
+ ruby_fakegem_doins lexers
+}