diff options
Diffstat (limited to 'dev-ruby/json')
-rw-r--r-- | dev-ruby/json/Manifest | 6 | ||||
-rw-r--r-- | dev-ruby/json/files/json-2.1.0-ruby26-1.patch | 20 | ||||
-rw-r--r-- | dev-ruby/json/files/json-2.1.0-ruby26-2.patch | 105 | ||||
-rw-r--r-- | dev-ruby/json/files/json-2.1.0-ruby26-3.patch | 143 | ||||
-rw-r--r-- | dev-ruby/json/json-2.1.0-r1.ebuild | 79 | ||||
-rw-r--r-- | dev-ruby/json/json-2.1.0.ebuild | 2 |
6 files changed, 353 insertions, 2 deletions
diff --git a/dev-ruby/json/Manifest b/dev-ruby/json/Manifest index 074c520a3886..96f8c86e9637 100644 --- a/dev-ruby/json/Manifest +++ b/dev-ruby/json/Manifest @@ -1,6 +1,10 @@ AUX json-1.8.6-heap-exposure.patch 2937 BLAKE2B 204f4c5a16df8fa99ea46e7d29c4a7e8790da9c11ff1dddfeba47b73a3bbf3e06a9243a48fa1d95fc029d21a1031e689b16a91295a1601d4e62a4c18cee2bb3b SHA512 42545c069c8c36b120b63e74b8276b8a6b57237e6cd8ccdeb0e6e9b9acd4f9213e5a4fc35b2f804300e8d00a12546c51b9ef944bde60d679567544de796c87e1 +AUX json-2.1.0-ruby26-1.patch 703 BLAKE2B 13244c273a10ace888376318f0b940aa76dd8e67a46c811d03537fa9718c784a2eba077b7620315e11abd216fc22e34eae6b97f5845aba6433ea3ab79be48c02 SHA512 909d90e619070d33e1c9c3351731f121beee1497d1c0ea8593795b25cda3ce44d11c82244ea98ce9163057820087a81dc6e242b91f95f16bb66c56402811caeb +AUX json-2.1.0-ruby26-2.patch 2855 BLAKE2B 1d6f31223d8f42883664d9462e49bc7032902972a80348ae0a20363569f6e086110838742702ec3100646e9163c39e8292a8c695a89b7ca157159b70c92dce2c SHA512 8932c773d0b7b479afbf5e110c7fce6605912966aea1c4a23bae9d5a041183001b63a2a52f98d836b892e9ca0709fc1a7ead8e7958ab02d1aefc8ab106fdcffc +AUX json-2.1.0-ruby26-3.patch 5184 BLAKE2B a2b82163b5827de5c411b439fe179402a37018f7ec4ff64d9be6d3a762aac3a232a40d16af31362ef0ce0ed50a78715f9ec75813790203ac882a25bd22ad0a04 SHA512 49bf7536b319186cb0cad05e8edd66d0db94ba52936e8eb4e8bba22078e283a1d609794166d06d49ed0d26763a9d4ad9a76109ceaca7f24f29b87a6e021b0383 DIST json-1.8.6.gem 144384 BLAKE2B db9e407be4ac7e0cb2e09369637b88f70cdac7a659c600dc83a5390746dfd21b0a5243af62afaeeff013b5a4116a3b22c65a481cad89f1ca9be8904af87d0345 SHA512 8f393da080293965389df4a606e0604c500b4b267897b3c1b9007b7700dde8156f6598c25790e84fa20a7e03c7ae359a0b267c7b84e52dfe2a1ac83cf652ad9b DIST json-2.1.0.gem 140800 BLAKE2B 28bb5334358369351ec9f13f5fb609ce34eb429cfeffb8dfde70864541516a0c2abd00a640b4647f76dcef198f967456bae0a858a2f213e5a30272c1be1878c7 SHA512 bffbe462e952bca321d4325ecb9c5e9f61e51cad13758581ecfaa6a038bac4e30dc7db50bd897086a5592f6fc437d0e0909f91e279aaf4dd71cf127100c3550b EBUILD json-1.8.6-r1.ebuild 2117 BLAKE2B 73c347a1b355e862f58de9df53ff014569623c8eec076943a664444cb8fe537e6ebc0645429265730c3e8f649245cca967e8b0c488968a0054c537f8705d6490 SHA512 40709b7d045f68490cd78d9dd27a044c13ca4581a3286cffe3646013152b3a7968b1e3a5a3586413254e6660dc0beb4067f92443368d3400d043dbc1d72cd930 -EBUILD json-2.1.0.ebuild 2055 BLAKE2B 46e27f798ce67c0c12bd180f4448b1ffad4b727ba71d114fc120d88205eb7804a15ff60681534f3aa17438937a9aa8564d189bc21753a1c996b3b2a9ed245012 SHA512 8885d19286e4135c3ac158a7aedeeb0e1aa189a8cc2851c7bda0d3daff34b51d034a6ef15819e5111f5b3c824f67c5f130348a8647bcf56b6c1de700f0ba1493 +EBUILD json-2.1.0-r1.ebuild 2178 BLAKE2B 6217f4b60bfa2d6db65e313da19d7d8497abee285ae47cd8a5a7be08b03259333b838ecbe84c15928933fc9e03a46a416c61ee71cb4464a533437c2db70bff60 SHA512 28cb7763693156c2fdbc891295522ea55de94c212cf22230bd44a2e30f6e160bdc3d58dc6e9673ad456d35e9787197d7dd270dc25c652db582c5ecc81ce611bc +EBUILD json-2.1.0.ebuild 2050 BLAKE2B 53970a464f586134fc8bf7bd4cb1188f2d51cce8fa0946e809091597014b960b57282484aba5898f514a8791a2efb9eb2573c720ee83a313b863bf770aa18d47 SHA512 652bfdbbaef0ab883d5f536a1a8d624f0c7c92714fccc5a1d0529b3a3837b3582dce11e663be63ced085d1a7257b557fbd43455d217c5a587ed3a850cda0027e MISC metadata.xml 336 BLAKE2B e1094160e19b252f7b3233dbd2006c889c0a02aa4b04063caeb7ded80bb2f08a2c4bc31cfb7bdc17398b8d1b8c3fc9f3600eafad9920fe0355c807d3899f794f SHA512 8b4fa7ef9b753bbf1206b1f8a796d3f3b8e3f9ca07906a2e01dbcc8c69d4cb5e5cb26c395d0676b4dedd70fb910cf0abd3be83d3c94f0b90aee87ea6fda12877 diff --git a/dev-ruby/json/files/json-2.1.0-ruby26-1.patch b/dev-ruby/json/files/json-2.1.0-ruby26-1.patch new file mode 100644 index 000000000000..e6f76a4be141 --- /dev/null +++ b/dev-ruby/json/files/json-2.1.0-ruby26-1.patch @@ -0,0 +1,20 @@ +commit bf226a9ac40e2296589004be89b4420b2121e000 +Author: eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> +Date: Fri Aug 3 15:11:22 2018 +0000 + + Fix missed update of parser source in r62429 + + git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64175 b2dd03c8-39d4-4d8f-98ff-823fe69b080e + +diff --git a/ext/json/parser/parser.rl b/ext/json/parser/parser.rl +index 29900a4a4a..fba01ac0e5 100644 +--- a/ext/json/ext/parser/parser.rl ++++ b/ext/json/ext/parser/parser.rl +@@ -824,6 +824,7 @@ static VALUE cParser_source(VALUE self) + + void Init_parser(void) + { ++#undef rb_intern + rb_require("json/common"); + mJSON = rb_define_module("JSON"); + mExt = rb_define_module_under(mJSON, "Ext"); diff --git a/dev-ruby/json/files/json-2.1.0-ruby26-2.patch b/dev-ruby/json/files/json-2.1.0-ruby26-2.patch new file mode 100644 index 000000000000..9f1bff9b691e --- /dev/null +++ b/dev-ruby/json/files/json-2.1.0-ruby26-2.patch @@ -0,0 +1,105 @@ +commit e7da0fc34e8ed7fa250fc38f1109e4944cbad808 +Author: eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> +Date: Fri Aug 3 15:11:36 2018 +0000 + + ext/json/parser/parser.c: do not call rb_str_resize() on Time object + + * See https://github.com/flori/json/issues/342 + + git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64177 b2dd03c8-39d4-4d8f-98ff-823fe69b080e + +diff --git a/ext/json/parser/parser.c b/ext/json/parser/parser.c +index b5ed093c1f..c8012796a4 100644 +--- a/ext/json/ext/parser/parser.c ++++ b/ext/json/ext/parser/parser.c +@@ -1659,7 +1659,9 @@ case 7: + if (json->symbolize_names && json->parsing_name) { + *result = rb_str_intern(*result); + } else { +- rb_str_resize(*result, RSTRING_LEN(*result)); ++ if (RB_TYPE_P(*result, T_STRING)) { ++ rb_str_resize(*result, RSTRING_LEN(*result)); ++ } + } + if (cs >= JSON_string_first_final) { + return p + 1; +@@ -1830,7 +1832,7 @@ static VALUE cParser_initialize(int argc, VALUE *argv, VALUE self) + } + + +-#line 1834 "parser.c" ++#line 1836 "parser.c" + enum {JSON_start = 1}; + enum {JSON_first_final = 10}; + enum {JSON_error = 0}; +@@ -1838,7 +1840,7 @@ enum {JSON_error = 0}; + enum {JSON_en_main = 1}; + + +-#line 742 "parser.rl" ++#line 744 "parser.rl" + + + /* +@@ -1855,16 +1857,16 @@ static VALUE cParser_parse(VALUE self) + GET_PARSER; + + +-#line 1859 "parser.c" ++#line 1861 "parser.c" + { + cs = JSON_start; + } + +-#line 758 "parser.rl" ++#line 760 "parser.rl" + p = json->source; + pe = p + json->len; + +-#line 1868 "parser.c" ++#line 1870 "parser.c" + { + if ( p == pe ) + goto _test_eof; +@@ -1898,7 +1900,7 @@ st0: + cs = 0; + goto _out; + tr2: +-#line 734 "parser.rl" ++#line 736 "parser.rl" + { + char *np = JSON_parse_value(json, p, pe, &result, 0); + if (np == NULL) { p--; {p++; cs = 10; goto _out;} } else {p = (( np))-1;} +@@ -1908,7 +1910,7 @@ st10: + if ( ++p == pe ) + goto _test_eof10; + case 10: +-#line 1912 "parser.c" ++#line 1914 "parser.c" + switch( (*p) ) { + case 13: goto st10; + case 32: goto st10; +@@ -1997,7 +1999,7 @@ case 9: + _out: {} + } + +-#line 761 "parser.rl" ++#line 763 "parser.rl" + + if (cs >= JSON_first_final && p == pe) { + return result; +diff --git a/ext/json/parser/parser.rl b/ext/json/parser/parser.rl +index fba01ac0e5..edab32b78f 100644 +--- a/ext/json/ext/parser/parser.rl ++++ b/ext/json/ext/parser/parser.rl +@@ -554,7 +554,9 @@ static char *JSON_parse_string(JSON_Parser *json, char *p, char *pe, VALUE *resu + if (json->symbolize_names && json->parsing_name) { + *result = rb_str_intern(*result); + } else { +- rb_str_resize(*result, RSTRING_LEN(*result)); ++ if (RB_TYPE_P(*result, T_STRING)) { ++ rb_str_resize(*result, RSTRING_LEN(*result)); ++ } + } + if (cs >= JSON_string_first_final) { + return p + 1; diff --git a/dev-ruby/json/files/json-2.1.0-ruby26-3.patch b/dev-ruby/json/files/json-2.1.0-ruby26-3.patch new file mode 100644 index 000000000000..cf16e235216c --- /dev/null +++ b/dev-ruby/json/files/json-2.1.0-ruby26-3.patch @@ -0,0 +1,143 @@ +commit a7e3516ff1116a15b3ed62f55143eceee27c4ce9 +Author: mrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> +Date: Sun Dec 2 05:21:57 2018 +0000 + + Fix JSON::Parser against bigdecimal updates + + git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e + +diff --git a/ext/json/parser/parser.c b/ext/json/parser/parser.c +index c8012796a4..b02aae8fb9 100644 +--- a/ext/json/ext/parser/parser.c ++++ b/ext/json/ext/parser/parser.c +@@ -91,12 +91,13 @@ static int convert_UTF32_to_UTF8(char *buf, UTF32 ch) + + static VALUE mJSON, mExt, cParser, eParserError, eNestingError; + static VALUE CNaN, CInfinity, CMinusInfinity; ++static VALUE cBigDecimal = Qundef; + + static ID i_json_creatable_p, i_json_create, i_create_id, i_create_additions, + i_chr, i_max_nesting, i_allow_nan, i_symbolize_names, + i_object_class, i_array_class, i_decimal_class, i_key_p, + i_deep_const_get, i_match, i_match_string, i_aset, i_aref, +- i_leftshift, i_new; ++ i_leftshift, i_new, i_BigDecimal; + + + #line 125 "parser.rl" +@@ -985,6 +986,19 @@ enum {JSON_float_en_main = 1}; + #line 340 "parser.rl" + + ++static int is_bigdecimal_class(VALUE obj) ++{ ++ if (cBigDecimal == Qundef) { ++ if (rb_const_defined(rb_cObject, i_BigDecimal)) { ++ cBigDecimal = rb_const_get_at(rb_cObject, i_BigDecimal); ++ } ++ else { ++ return 0; ++ } ++ } ++ return obj == cBigDecimal; ++} ++ + static char *JSON_parse_float(JSON_Parser *json, char *p, char *pe, VALUE *result) + { + int cs = EVIL; +@@ -1136,7 +1150,11 @@ case 7: + } else { + VALUE text; + text = rb_str_new2(FBUFFER_PTR(json->fbuffer)); +- *result = rb_funcall(json->decimal_class, i_new, 1, text); ++ if (is_bigdecimal_class(json->decimal_class)) { ++ *result = rb_funcall(Qnil, i_BigDecimal, 1, text); ++ } else { ++ *result = rb_funcall(json->decimal_class, i_new, 1, text); ++ } + } + return p + 1; + } else { +@@ -2101,6 +2119,7 @@ void Init_parser(void) + i_aref = rb_intern("[]"); + i_leftshift = rb_intern("<<"); + i_new = rb_intern("new"); ++ i_BigDecimal = rb_intern("BigDecimal"); + } + + /* +diff --git a/ext/json/parser/parser.rl b/ext/json/parser/parser.rl +index edab32b78f..d4e7a60e9d 100644 +--- a/ext/json/ext/parser/parser.rl ++++ b/ext/json/ext/parser/parser.rl +@@ -89,12 +89,13 @@ static int convert_UTF32_to_UTF8(char *buf, UTF32 ch) + + static VALUE mJSON, mExt, cParser, eParserError, eNestingError; + static VALUE CNaN, CInfinity, CMinusInfinity; ++static VALUE cBigDecimal = Qundef; + + static ID i_json_creatable_p, i_json_create, i_create_id, i_create_additions, + i_chr, i_max_nesting, i_allow_nan, i_symbolize_names, + i_object_class, i_array_class, i_decimal_class, i_key_p, + i_deep_const_get, i_match, i_match_string, i_aset, i_aref, +- i_leftshift, i_new; ++ i_leftshift, i_new, i_BigDecimal; + + %%{ + machine JSON_common; +@@ -339,6 +340,19 @@ static char *JSON_parse_integer(JSON_Parser *json, char *p, char *pe, VALUE *res + ) (^[0-9Ee.\-]? @exit ); + }%% + ++static int is_bigdecimal_class(VALUE obj) ++{ ++ if (cBigDecimal == Qundef) { ++ if (rb_const_defined(rb_cObject, i_BigDecimal)) { ++ cBigDecimal = rb_const_get_at(rb_cObject, i_BigDecimal); ++ } ++ else { ++ return 0; ++ } ++ } ++ return obj == cBigDecimal; ++} ++ + static char *JSON_parse_float(JSON_Parser *json, char *p, char *pe, VALUE *result) + { + int cs = EVIL; +@@ -357,7 +371,11 @@ static char *JSON_parse_float(JSON_Parser *json, char *p, char *pe, VALUE *resul + } else { + VALUE text; + text = rb_str_new2(FBUFFER_PTR(json->fbuffer)); +- *result = rb_funcall(json->decimal_class, i_new, 1, text); ++ if (is_bigdecimal_class(json->decimal_class)) { ++ *result = rb_funcall(Qnil, i_BigDecimal, 1, text); ++ } else { ++ *result = rb_funcall(json->decimal_class, i_new, 1, text); ++ } + } + return p + 1; + } else { +@@ -861,6 +879,7 @@ void Init_parser(void) + i_aref = rb_intern("[]"); + i_leftshift = rb_intern("<<"); + i_new = rb_intern("new"); ++ i_BigDecimal = rb_intern("BigDecimal"); + } + + /* +diff --git a/test/json/json_parser_test.rb b/test/json/json_parser_test.rb +index 5f454eb121..68aeb572bb 100644 +--- a/tests/json_parser_test.rb ++++ b/tests/json_parser_test.rb +@@ -110,8 +110,8 @@ def test_parse_numbers + end + + def test_parse_bigdecimals +- assert_equal(BigDecimal, JSON.parse('{"foo": 9.01234567890123456789}', decimal_class: BigDecimal)["foo"].class) +- assert_equal(BigDecimal.new("0.901234567890123456789E1"),JSON.parse('{"foo": 9.01234567890123456789}', decimal_class: BigDecimal)["foo"] ) ++ assert_equal(BigDecimal, JSON.parse('{"foo": 9.01234567890123456789}', decimal_class: BigDecimal)["foo"].class) ++ assert_equal(BigDecimal("0.901234567890123456789E1"),JSON.parse('{"foo": 9.01234567890123456789}', decimal_class: BigDecimal)["foo"] ) + end + + if Array.method_defined?(:permutation) diff --git a/dev-ruby/json/json-2.1.0-r1.ebuild b/dev-ruby/json/json-2.1.0-r1.ebuild new file mode 100644 index 000000000000..74c58ff51b81 --- /dev/null +++ b/dev-ruby/json/json-2.1.0-r1.ebuild @@ -0,0 +1,79 @@ +# Copyright 1999-2018 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 +USE_RUBY="ruby23 ruby24 ruby25 ruby26" + +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" + +PATCHES=( + "${FILESDIR}/${P}-ruby26-1.patch" + "${FILESDIR}/${P}-ruby26-2.patch" + "${FILESDIR}/${P}-ruby26-3.patch" +) + +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/json-2.1.0.ebuild b/dev-ruby/json/json-2.1.0.ebuild index 42e724edaee8..b85cf87e90ea 100644 --- a/dev-ruby/json/json-2.1.0.ebuild +++ b/dev-ruby/json/json-2.1.0.ebuild @@ -16,7 +16,7 @@ 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" +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="" |