summaryrefslogtreecommitdiff
path: root/dev-ruby/json
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /dev-ruby/json
reinit the tree, so we can have metadata
Diffstat (limited to 'dev-ruby/json')
-rw-r--r--dev-ruby/json/Manifest13
-rw-r--r--dev-ruby/json/files/json-1.8.6-heap-exposure.patch82
-rw-r--r--dev-ruby/json/json-1.8.2-r1.ebuild69
-rw-r--r--dev-ruby/json/json-1.8.3.ebuild69
-rw-r--r--dev-ruby/json/json-1.8.6-r1.ebuild70
-rw-r--r--dev-ruby/json/json-1.8.6.ebuild68
-rw-r--r--dev-ruby/json/json-2.1.0.ebuild73
-rw-r--r--dev-ruby/json/metadata.xml11
8 files changed, 455 insertions, 0 deletions
diff --git a/dev-ruby/json/Manifest b/dev-ruby/json/Manifest
new file mode 100644
index 000000000000..533aa0f392ac
--- /dev/null
+++ b/dev-ruby/json/Manifest
@@ -0,0 +1,13 @@
+AUX json-1.8.6-heap-exposure.patch 2937 SHA256 8fc50abbcc0298e24c9a02094e0f2d8c3c0008d77b10a4f19247c52eddeb7c9b SHA512 42545c069c8c36b120b63e74b8276b8a6b57237e6cd8ccdeb0e6e9b9acd4f9213e5a4fc35b2f804300e8d00a12546c51b9ef944bde60d679567544de796c87e1 WHIRLPOOL e1e8728508112c3c126f32634def632f84a7e8d5fec3b0baa5bba6eccb89c22ebba54eadbe2d63c2251eb965d5a6a7c2ba384ef6788017068c505db5490e34a4
+DIST json-1.8.2.gem 152064 SHA256 256f73d107635f54e3dd84daba65da7b08f9d6a6e6aeb046db6a46b98bd8fb7f SHA512 5c94ec2c5378f7f54cd87a2e265b058e80031d2dd29daf14639c80ba0ac285a527ab7961f5a2cd1e483f455fd8f8c88575950822b7b2d431aa7b2b9c8be819c1 WHIRLPOOL dc17e0c011523434ed29e428a2658ebe58d08df8252e7ee8990882b6d17c19354b3e4ba6985a2a45e4b94932ad265698197ba64ef891f38d3be154da4edde8cb
+DIST json-1.8.3.gem 152064 SHA256 8ca2091e26678fb989d66cdb9f0104f1307bc584b429c2fd783d51e4b3f14bdb SHA512 313f6016aca5eba4d4a14a72b60b3e9c5e863a6681eb9e499cacedb63969694be563990af0a44dae52963f07b6e6c7aa7e0876ab1348b214f53d925bdc5e83ea WHIRLPOOL 8c6dc26a578aedcd4bbc1e6ea95f2a72debe6bdaca5a4c2a4e70b81d9947048c6648b62d5546fa572084d37ba99ce199a177b87838be5cc3f11d8d0fa0f62a63
+DIST json-1.8.6.gem 144384 SHA256 65af27ca985f70eb0d083aab0f75712c771871222af021ce533bad77bd3bb262 SHA512 8f393da080293965389df4a606e0604c500b4b267897b3c1b9007b7700dde8156f6598c25790e84fa20a7e03c7ae359a0b267c7b84e52dfe2a1ac83cf652ad9b WHIRLPOOL 0d55a8086f54eafa8e2d9e49e71436750b63c4bb7164fe06e5fa298f112f5612c428e3d4377e1ca824577d01eb21a6862b42236a147c85e9faa8a3f623184bf8
+DIST json-2.1.0.gem 140800 SHA256 b76fd09b881088c6c64a12721a1528f2f747a1c2ee52fab4c1f60db8af946607 SHA512 bffbe462e952bca321d4325ecb9c5e9f61e51cad13758581ecfaa6a038bac4e30dc7db50bd897086a5592f6fc437d0e0909f91e279aaf4dd71cf127100c3550b WHIRLPOOL 94140475051d90e9b207c6d0224483b5ee0c371a27b7a4aafc612bc2e828cffb350afd4001ba20a3b5ddb124561da960cdb0d757bfbfbba031942d6bbb9cc641
+EBUILD json-1.8.2-r1.ebuild 2076 SHA256 39a27b3f18d67234cc4050d91e0d978da1d807c365ef18e4a72adb301d36e357 SHA512 99ce2593c742309f7b9d2d984f53eb6d71c6743fe59571e42a173a62040455ff8a46d5a2169a49784a40e8bfd3cf8b54d190281821c35fd6ba81b87640b3c0f3 WHIRLPOOL 699c12bd7f87a799c3432cd162a6e190b74bc4b116b6eaebb6ecffe661d23eedf8d323ff355801fd3fa14822399c2f0dee3abb1c9b68b554eead242c24292250
+EBUILD json-1.8.3.ebuild 2091 SHA256 773113fe37f7b0279e37885f38482b3ab948000ff9c5b1ce16693ce50961ec0d SHA512 3601ceb5b0bbdada74836475f3730f11da8c7a6bfec49397e7eecdf9686571917f5b51fccfa900656991baaa2e99c154a1e7b31af1cefbc5d8b6fbd966d3e6b7 WHIRLPOOL a5e7768dea6034ea17f66f754e029a9b83af463158b929e67bce026d98094962cc1b57f91f6ddd304454ae87d029ffd391c518ba8575e68fe6efadbfa59ef595
+EBUILD json-1.8.6-r1.ebuild 2112 SHA256 2e8470a852c89b565e10b4fdc1e1f1e6ef757d618c4fcb0c9202c63168da4709 SHA512 ceb6f70688c5ee61b3b27c8970d7884e8de09ca77e70019c6a0f0e74be5d29e3fe3cfeb60409d286232dd409ee508ad1aa6d05e9b33f6dcd05f0857b3bfd65f1 WHIRLPOOL 3755ce1d84af3c641f668f783a6c0d9aca401a02ae07c7ee9906d805981148e703793328f06ae27684bde11bb68b26283a140707f20be19b5573752ee8c7ae23
+EBUILD json-1.8.6.ebuild 2072 SHA256 63c2c41007efa04c76cab32def125fd36191455de71227adb6885b63000805a1 SHA512 6ad22157e84c0b69370558cb7fa31e1d8b93b289dd6ed751712306081635251293013f712d841620b7e4c79946554f960e39df70e0789903b2cc9ea3833bc5cf WHIRLPOOL 4c19749f7c43cc07d1c161550e584c488d683bb1e1e5cecc47df4bde0a53861c6ef3f53582abd6b84fd58d69b7c6ec4e4e8dfaf19a32021dddc45e1668c6dde2
+EBUILD json-2.1.0.ebuild 2063 SHA256 f855d12cdaa40f0e6c5ebf8ed52b6c156d7272ffa1f5e9b1ed73dff2ddbe5ca9 SHA512 296d0175321fd6811b144f37bbb39ebad763edf5f4424a0ef35a6f4a3c75a555df35629ab356e12813e09eff35fd0f5564ad46bbbf655d6fd4a7de52e9bdcb64 WHIRLPOOL b4d6f9693b03827d97256e42407960ea6536c172b39957768e2650eab9beaf718b7a8375c11da6c16a4987cf5a3e7d9aba2100082b31068fb5d37d5f5cdd8232
+MISC ChangeLog 5018 SHA256 750823aba9ab4df34144d05f071a2b36c18527bab998f6741d59b4f99c4701f2 SHA512 b268c64bd0e58227ec1052ea12713b8d0d51ff1280e6641fd2117703a2e9517e8bdf1e138df610037b1cff980a34dd844326dcac7e7cc8b3491a0e25c543e708 WHIRLPOOL 577b200a89cdaffce3fbf40bcee0c882007faa982647c7d1b79833465e517d084a2db2cd81ee25636b348f833a0f90abd92431ecff7aff37260a6f0982f2058b
+MISC ChangeLog-2015 20045 SHA256 e3f3ab67700f231a561d3ab99988db930c1dc066698b4730c407fd39cd832524 SHA512 f9d82a3e6e29acba465330a216bf28e3b7d6a5c7ed0a4d2d39ddee4af85a075c3a6578f1e17219f55a7b178c702b75c2510b5a3a9148007f4c7daf15f541492a WHIRLPOOL 8b47239e0bd8006fe488c1998db10b8b52253590c472b65d3c375d6a90aecbfcb75c42affae3ecaf6d74ab18bf6c81c6c004fc6812ee791066f1e5f669a9cfd9
+MISC metadata.xml 336 SHA256 9bb83327b4577dff546572d885e7303c7f5f04d51cdc2ebcc8272bbf34465f93 SHA512 8b4fa7ef9b753bbf1206b1f8a796d3f3b8e3f9ca07906a2e01dbcc8c69d4cb5e5cb26c395d0676b4dedd70fb910cf0abd3be83d3c94f0b90aee87ea6fda12877 WHIRLPOOL 5ced3794475e3d7a48c68a9dd061cd9bf9d72043334de5e1c1afa63d1de9b6a68b62188b7a301abbdebfbb66ebd4c368e7bb0f6ce4bc0363c5f22460282b9deb
diff --git a/dev-ruby/json/files/json-1.8.6-heap-exposure.patch b/dev-ruby/json/files/json-1.8.6-heap-exposure.patch
new file mode 100644
index 000000000000..d3da7a0f86f9
--- /dev/null
+++ b/dev-ruby/json/files/json-1.8.6-heap-exposure.patch
@@ -0,0 +1,82 @@
+diff --git ext/json/generator/generator.c ext/json/generator/generator.c
+index a135e28348..2cdca5685f 100644
+--- a/ext/json/ext/generator/generator.c
++++ b/ext/json/ext/generator/generator.c
+@@ -301,7 +301,7 @@ static char *fstrndup(const char *ptr, unsigned long len) {
+ char *result;
+ if (len <= 0) return NULL;
+ result = ALLOC_N(char, len);
+- memccpy(result, ptr, 0, len);
++ memcpy(result, ptr, len);
+ return result;
+ }
+
+@@ -1055,7 +1055,7 @@ static VALUE cState_indent_set(VALUE self, VALUE indent)
+ }
+ } else {
+ if (state->indent) ruby_xfree(state->indent);
+- state->indent = strdup(RSTRING_PTR(indent));
++ state->indent = fstrndup(RSTRING_PTR(indent), len);
+ state->indent_len = len;
+ }
+ return Qnil;
+@@ -1093,7 +1093,7 @@ static VALUE cState_space_set(VALUE self, VALUE space)
+ }
+ } else {
+ if (state->space) ruby_xfree(state->space);
+- state->space = strdup(RSTRING_PTR(space));
++ state->space = fstrndup(RSTRING_PTR(space), len);
+ state->space_len = len;
+ }
+ return Qnil;
+@@ -1129,7 +1129,7 @@ static VALUE cState_space_before_set(VALUE self, VALUE space_before)
+ }
+ } else {
+ if (state->space_before) ruby_xfree(state->space_before);
+- state->space_before = strdup(RSTRING_PTR(space_before));
++ state->space_before = fstrndup(RSTRING_PTR(space_before), len);
+ state->space_before_len = len;
+ }
+ return Qnil;
+@@ -1166,7 +1166,7 @@ static VALUE cState_object_nl_set(VALUE self, VALUE object_nl)
+ }
+ } else {
+ if (state->object_nl) ruby_xfree(state->object_nl);
+- state->object_nl = strdup(RSTRING_PTR(object_nl));
++ state->object_nl = fstrndup(RSTRING_PTR(object_nl), len);
+ state->object_nl_len = len;
+ }
+ return Qnil;
+@@ -1201,7 +1201,7 @@ static VALUE cState_array_nl_set(VALUE self, VALUE array_nl)
+ }
+ } else {
+ if (state->array_nl) ruby_xfree(state->array_nl);
+- state->array_nl = strdup(RSTRING_PTR(array_nl));
++ state->array_nl = fstrndup(RSTRING_PTR(array_nl), len);
+ state->array_nl_len = len;
+ }
+ return Qnil;
+diff --git ext/json/generator/generator.h ext/json/generator/generator.h
+index 298c0a4965..6bbf817b7d 100644
+--- a/ext/json/ext/generator/generator.h
++++ b/ext/json/ext/generator/generator.h
+@@ -1,7 +1,6 @@
+ #ifndef _GENERATOR_H_
+ #define _GENERATOR_H_
+
+-#include <string.h>
+ #include <math.h>
+ #include <ctype.h>
+
+diff --git ext/json/lib/json/version.rb ext/json/lib/json/version.rb
+index b5748334b9..cd7ddf8777 100644
+--- a/lib/json/version.rb
++++ b/lib/json/version.rb
+@@ -1,7 +1,7 @@
+ module JSON
+ # JSON version
+- VERSION = '1.8.6'
++ VERSION = '1.8.6.1'
+ VERSION_ARRAY = VERSION.split(/\./).map { |x| x.to_i } # :nodoc:
+ VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
+ VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
diff --git a/dev-ruby/json/json-1.8.2-r1.ebuild b/dev-ruby/json/json-1.8.2-r1.ebuild
new file mode 100644
index 000000000000..e15a6827e7db
--- /dev/null
+++ b/dev-ruby/json/json-1.8.2-r1.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+USE_RUBY="ruby21 ruby22"
+
+RUBY_FAKEGEM_TASK_DOC="doc"
+RUBY_FAKEGEM_EXTRADOC="CHANGES TODO README.rdoc README-json-jruby.markdown"
+RUBY_FAKEGEM_DOCDIR="doc"
+
+RUBY_FAKEGEM_GEMSPEC="json.gemspec"
+
+inherit multilib ruby-fakegem
+
+DESCRIPTION="A JSON implementation as a Ruby extension"
+HOMEPAGE="https://github.com/flori/json"
+LICENSE="|| ( Ruby GPL-2 )"
+
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh ~sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+SLOT="0"
+IUSE=""
+
+RDEPEND="${RDEPEND}"
+DEPEND="${DEPEND}
+ dev-util/ragel"
+
+ruby_add_bdepend "dev-ruby/rake
+ doc? ( dev-ruby/rdoc )"
+
+all_ruby_prepare() {
+ # Avoid building the extension twice!
+ # And use rdoc instead of sdoc which we don't have packaged
+ # And don't call git to list files. We're using the pregenerated spec anyway.
+ sed -i \
+ -e 's| => :compile||' \
+ -e 's| => :clean||' \
+ -e 's|sdoc|rdoc|' \
+ -e 's|`git ls-files`|""|' \
+ Rakefile || die "rakefile fix failed"
+
+ # Remove hardcoded and broken -O setting.
+ sed -i -e '/^ \(if\|unless\)/,/^ end/ s:^:#:' \
+ -e '/^unless/,/^end/ s:^:#:' ext/json/ext/*/extconf.rb || die
+}
+
+each_ruby_compile() {
+ # Since 1.5.0 a Java extension is provided but it does not compile.
+ if [[ $(basename ${RUBY}) != "jruby" ]]; then
+ ${RUBY} -S rake compile || die "extension compile failed"
+ fi
+}
+
+each_ruby_test() {
+ JSON=pure \
+ ${RUBY} -Iext:lib -S testrb-2 tests/test_*.rb || die "pure ruby tests failed"
+
+ if [[ $(basename ${RUBY}) != "jruby" ]]; then
+ JSON=ext \
+ ${RUBY} -Iext:lib -S testrb-2 tests/test_*.rb || die "ext ruby tests failed"
+ fi
+}
+
+each_ruby_install() {
+ each_fakegem_install
+ if [[ $(basename ${RUBY}) != "jruby" ]]; then
+ ruby_fakegem_newins ext/json/ext/generator$(get_modname) lib/json/ext/generator$(get_modname)
+ ruby_fakegem_newins ext/json/ext/parser$(get_modname) lib/json/ext/parser$(get_modname)
+ fi
+}
diff --git a/dev-ruby/json/json-1.8.3.ebuild b/dev-ruby/json/json-1.8.3.ebuild
new file mode 100644
index 000000000000..73c77483200b
--- /dev/null
+++ b/dev-ruby/json/json-1.8.3.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+USE_RUBY="ruby20 ruby21 ruby22 ruby23"
+
+RUBY_FAKEGEM_TASK_DOC="doc"
+RUBY_FAKEGEM_EXTRADOC="CHANGES TODO README.rdoc README-json-jruby.markdown"
+RUBY_FAKEGEM_DOCDIR="doc"
+
+RUBY_FAKEGEM_GEMSPEC="json.gemspec"
+
+inherit multilib ruby-fakegem
+
+DESCRIPTION="A JSON implementation as a Ruby extension"
+HOMEPAGE="https://github.com/flori/json"
+LICENSE="|| ( Ruby GPL-2 )"
+
+KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh ~sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+SLOT="0"
+IUSE=""
+
+RDEPEND="${RDEPEND}"
+DEPEND="${DEPEND}
+ dev-util/ragel"
+
+ruby_add_bdepend "dev-ruby/rake
+ doc? ( dev-ruby/rdoc )"
+
+all_ruby_prepare() {
+ # Avoid building the extension twice!
+ # And use rdoc instead of sdoc which we don't have packaged
+ # And don't call git to list files. We're using the pregenerated spec anyway.
+ sed -i \
+ -e 's| => :compile||' \
+ -e 's| => :clean||' \
+ -e 's|sdoc|rdoc|' \
+ -e 's|`git ls-files`|""|' \
+ Rakefile || die "rakefile fix failed"
+
+ # Remove hardcoded and broken -O setting.
+ sed -i -e '/^ \(if\|unless\)/,/^ end/ s:^:#:' \
+ -e '/^unless/,/^end/ s:^:#:' ext/json/ext/*/extconf.rb || die
+}
+
+each_ruby_compile() {
+ # Since 1.5.0 a Java extension is provided but it does not compile.
+ if [[ $(basename ${RUBY}) != "jruby" ]]; then
+ ${RUBY} -S rake compile || die "extension compile failed"
+ fi
+}
+
+each_ruby_test() {
+ JSON=pure \
+ ${RUBY} -Iext:lib -S testrb-2 tests/test_*.rb || die "pure ruby tests failed"
+
+ if [[ $(basename ${RUBY}) != "jruby" ]]; then
+ JSON=ext \
+ ${RUBY} -Iext:lib -S testrb-2 tests/test_*.rb || die "ext ruby tests failed"
+ fi
+}
+
+each_ruby_install() {
+ each_fakegem_install
+ if [[ $(basename ${RUBY}) != "jruby" ]]; then
+ ruby_fakegem_newins ext/json/ext/generator$(get_modname) lib/json/ext/generator$(get_modname)
+ ruby_fakegem_newins ext/json/ext/parser$(get_modname) lib/json/ext/parser$(get_modname)
+ fi
+}
diff --git a/dev-ruby/json/json-1.8.6-r1.ebuild b/dev-ruby/json/json-1.8.6-r1.ebuild
new file mode 100644
index 000000000000..1d21b4bfdf29
--- /dev/null
+++ b/dev-ruby/json/json-1.8.6-r1.ebuild
@@ -0,0 +1,70 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+USE_RUBY="ruby22 ruby23 ruby24"
+
+RUBY_FAKEGEM_RECIPE_DOC="rdoc"
+RUBY_FAKEGEM_EXTRADOC="CHANGES TODO README.md README-json-jruby.markdown"
+
+RUBY_FAKEGEM_GEMSPEC="json.gemspec"
+
+inherit multilib ruby-fakegem
+
+DESCRIPTION="A JSON implementation as a Ruby extension"
+HOMEPAGE="https://github.com/flori/json"
+LICENSE="|| ( Ruby GPL-2 )"
+
+KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+SLOT="0"
+IUSE=""
+
+RDEPEND="${RDEPEND}"
+DEPEND="${DEPEND}
+ dev-util/ragel"
+
+ruby_add_bdepend "dev-ruby/rake
+ doc? ( dev-ruby/rdoc )"
+
+PATCHES=( "${FILESDIR}/${P}-heap-exposure.patch" )
+
+all_ruby_prepare() {
+ # Avoid building the extension twice!
+ # And use rdoc instead of sdoc which we don't have packaged
+ # And don't call git to list files. We're using the pregenerated spec anyway.
+ sed -i \
+ -e 's| => :compile||' \
+ -e 's| => :clean||' \
+ -e 's|sdoc|rdoc|' \
+ -e 's|`git ls-files`|""|' \
+ Rakefile || die "rakefile fix failed"
+
+ # Remove hardcoded and broken -O setting.
+ sed -i -e '/^ \(if\|unless\)/,/^ end/ s:^:#:' \
+ -e '/^unless/,/^end/ s:^:#:' ext/json/ext/*/extconf.rb || die
+}
+
+each_ruby_compile() {
+ # Since 1.5.0 a Java extension is provided but it does not compile.
+ if [[ $(basename ${RUBY}) != "jruby" ]]; then
+ ${RUBY} -S rake compile || die "extension compile failed"
+ fi
+}
+
+each_ruby_test() {
+ JSON=pure \
+ ${RUBY} -Iext:lib -S testrb-2 tests/test_*.rb || die "pure ruby tests failed"
+
+ if [[ $(basename ${RUBY}) != "jruby" ]]; then
+ JSON=ext \
+ ${RUBY} -Iext:lib -S testrb-2 tests/test_*.rb || die "ext ruby tests failed"
+ fi
+}
+
+each_ruby_install() {
+ each_fakegem_install
+ if [[ $(basename ${RUBY}) != "jruby" ]]; then
+ ruby_fakegem_newins ext/json/ext/generator$(get_modname) lib/json/ext/generator$(get_modname)
+ ruby_fakegem_newins ext/json/ext/parser$(get_modname) lib/json/ext/parser$(get_modname)
+ fi
+}
diff --git a/dev-ruby/json/json-1.8.6.ebuild b/dev-ruby/json/json-1.8.6.ebuild
new file mode 100644
index 000000000000..0810a567dd1b
--- /dev/null
+++ b/dev-ruby/json/json-1.8.6.ebuild
@@ -0,0 +1,68 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+USE_RUBY="ruby21 ruby22 ruby23 ruby24"
+
+RUBY_FAKEGEM_RECIPE_DOC="rdoc"
+RUBY_FAKEGEM_EXTRADOC="CHANGES TODO README.md README-json-jruby.markdown"
+
+RUBY_FAKEGEM_GEMSPEC="json.gemspec"
+
+inherit multilib ruby-fakegem
+
+DESCRIPTION="A JSON implementation as a Ruby extension"
+HOMEPAGE="https://github.com/flori/json"
+LICENSE="|| ( Ruby GPL-2 )"
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ia64 ~mips ~ppc ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+SLOT="0"
+IUSE=""
+
+RDEPEND="${RDEPEND}"
+DEPEND="${DEPEND}
+ dev-util/ragel"
+
+ruby_add_bdepend "dev-ruby/rake
+ doc? ( dev-ruby/rdoc )"
+
+all_ruby_prepare() {
+ # Avoid building the extension twice!
+ # And use rdoc instead of sdoc which we don't have packaged
+ # And don't call git to list files. We're using the pregenerated spec anyway.
+ sed -i \
+ -e 's| => :compile||' \
+ -e 's| => :clean||' \
+ -e 's|sdoc|rdoc|' \
+ -e 's|`git ls-files`|""|' \
+ Rakefile || die "rakefile fix failed"
+
+ # Remove hardcoded and broken -O setting.
+ sed -i -e '/^ \(if\|unless\)/,/^ end/ s:^:#:' \
+ -e '/^unless/,/^end/ s:^:#:' ext/json/ext/*/extconf.rb || die
+}
+
+each_ruby_compile() {
+ # Since 1.5.0 a Java extension is provided but it does not compile.
+ if [[ $(basename ${RUBY}) != "jruby" ]]; then
+ ${RUBY} -S rake compile || die "extension compile failed"
+ fi
+}
+
+each_ruby_test() {
+ JSON=pure \
+ ${RUBY} -Iext:lib -S testrb-2 tests/test_*.rb || die "pure ruby tests failed"
+
+ if [[ $(basename ${RUBY}) != "jruby" ]]; then
+ JSON=ext \
+ ${RUBY} -Iext:lib -S testrb-2 tests/test_*.rb || die "ext ruby tests failed"
+ fi
+}
+
+each_ruby_install() {
+ each_fakegem_install
+ if [[ $(basename ${RUBY}) != "jruby" ]]; then
+ ruby_fakegem_newins ext/json/ext/generator$(get_modname) lib/json/ext/generator$(get_modname)
+ ruby_fakegem_newins ext/json/ext/parser$(get_modname) lib/json/ext/parser$(get_modname)
+ fi
+}
diff --git a/dev-ruby/json/json-2.1.0.ebuild b/dev-ruby/json/json-2.1.0.ebuild
new file mode 100644
index 000000000000..ef2c8a1174f7
--- /dev/null
+++ b/dev-ruby/json/json-2.1.0.ebuild
@@ -0,0 +1,73 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+USE_RUBY="ruby21 ruby22 ruby23 ruby24"
+
+RUBY_FAKEGEM_RECIPE_DOC="rdoc"
+RUBY_FAKEGEM_EXTRADOC="CHANGES.md README.md"
+RUBY_FAKEGEM_DOCDIR="doc"
+
+RUBY_FAKEGEM_GEMSPEC="json.gemspec"
+
+inherit multilib ruby-fakegem
+
+DESCRIPTION="A JSON implementation as a Ruby extension"
+HOMEPAGE="https://github.com/flori/json"
+LICENSE="Ruby"
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+SLOT="2"
+IUSE=""
+
+RDEPEND="${RDEPEND}"
+DEPEND="${DEPEND}
+ dev-util/ragel"
+
+ruby_add_bdepend "dev-ruby/rake
+ doc? ( dev-ruby/rdoc )"
+
+all_ruby_prepare() {
+ # Avoid building the extension twice!
+ # And use rdoc instead of sdoc which we don't have packaged
+ # And don't call git to list files. We're using the pregenerated spec anyway.
+ sed -i \
+ -e '/task :test/ s|:compile,||' \
+ -e 's| => :clean||' \
+ -e 's|sdoc|rdoc|' \
+ -e 's|`git ls-files`|""|' \
+ Rakefile || die "rakefile fix failed"
+
+ # Remove hardcoded and broken -O setting.
+ sed -i -e '/^ \(if\|unless\)/,/^ end/ s:^:#:' \
+ -e '/^unless/,/^end/ s:^:#:' ext/json/ext/*/extconf.rb || die
+
+ # Avoid setting gem since it will not be available yet when installing
+ sed -i -e '/gem/ s:^:#:' tests/test_helper.rb || die
+}
+
+each_ruby_configure() {
+ for ext in parser generator ; do
+ ${RUBY} -Cext/json/ext/${ext} extconf.rb || die
+ done
+}
+
+each_ruby_compile() {
+ for ext in parser generator ; do
+ emake V=1 -Cext/json/ext/${ext}
+ cp ext/json/ext/${ext}/${ext}$(get_modname) ext/json/ext/ || die
+ done
+}
+
+each_ruby_test() {
+ for t in pure ext ; do
+ JSON=${T} ${RUBY} -S rake do_test_${t} || die
+ done
+}
+
+each_ruby_install() {
+ each_fakegem_install
+
+ ruby_fakegem_newins ext/json/ext/generator$(get_modname) lib/json/ext/generator$(get_modname)
+ ruby_fakegem_newins ext/json/ext/parser$(get_modname) lib/json/ext/parser$(get_modname)
+}
diff --git a/dev-ruby/json/metadata.xml b/dev-ruby/json/metadata.xml
new file mode 100644
index 000000000000..892c8b0116a2
--- /dev/null
+++ b/dev-ruby/json/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>ruby@gentoo.org</email>
+ <name>Gentoo Ruby Project</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">flori/json</remote-id>
+ </upstream>
+</pkgmetadata>