diff options
-rw-r--r-- | libre/ruby/PKGBUILD | 63 | ||||
-rw-r--r-- | libre/ruby/json-1.8.1-libre.patch | 238 | ||||
-rw-r--r-- | libre/ruby/json-2.0.2-libre.patch | 36 | ||||
-rw-r--r-- | libre/ruby/json-2.0.2-ruby-2.4.1-backports.patch | 64 | ||||
-rw-r--r-- | libre/ruby/ruby-2.4-libre.patch | 74 | ||||
-rw-r--r-- | libre/ruby/ruby-2.4.1-add-json_pure.patch | 32 | ||||
-rw-r--r-- | libre/ruby/ruby-2.4.1-remove-json-ext.patch | 114 |
7 files changed, 286 insertions, 335 deletions
diff --git a/libre/ruby/PKGBUILD b/libre/ruby/PKGBUILD index a837f85b4..e5e4c1d77 100644 --- a/libre/ruby/PKGBUILD +++ b/libre/ruby/PKGBUILD @@ -8,11 +8,18 @@ # Contributor: André Silva <emulatorman@parabola.nu> # Contributor: Luke Shumaker <lukeshu@parabola.nu> +# Rationale for inclusion in [libre]: Problematic license of +# generator.c in bundled json extension. +# +# https://labs.parabola.nu/issues/674 +# https://bugs.ruby-lang.org/issues/11844 +# https://github.com/flori/json/issues/277 + pkgname=(ruby ruby-docs) pkgver=2.4.1 -_jsonver=1.8.1 -pkgrel=3.parabola2 -_srcrel=1 # increment this to rebuild the sourceball without bumping pkgver +_jsonver=2.0.2 +pkgrel=3.parabola3 +_srcrel=2 # increment this to rebuild the sourceball without bumping pkgver arch=(i686 x86_64 armv7h) url='http://www.ruby-lang.org/en/' license=(BSD2 custom) @@ -20,41 +27,47 @@ makedepends=(gdbm openssl libffi doxygen graphviz libyaml ttf-dejavu tk) options=(!emptydirs) source=(https://repo.parabola.nu/other/ruby-libre/ruby-${pkgver}-libre${_srcrel}.tar.gz gemrc) -sha1sums=('2f110797f2188c05231e4a5c11aa1a30493f2c0f' +sha1sums=('ca7ca50c2e96200062afe081bf82c2cfaa3d18a1' 'dc536754c8fac2c3d82965c5a708cd8f79562d98') mkdepends=('ruby') # for 'gem build' mksource=(https://cache.ruby-lang.org/pub/ruby/${pkgver:0:3}/ruby-${pkgver}.tar.xz - ruby-${pkgver:0:3}-libre.patch + ruby-${pkgver}-remove-json-ext.patch + ruby-${pkgver}-add-json_pure.patch json-${_jsonver}.tar.gz::https://github.com/flori/json/archive/v${_jsonver}.tar.gz + json-${_jsonver}-ruby-${pkgver}-backports.patch json-${_jsonver}-libre.patch) mksha512sums=('e6fd290b6edd166348b70f0f1c56f7ed9d956c4c1eb91d97d0548041ca4196b9b75ec1ad35c745bdbfd4de195899093e7205d7f02b014ecf1c48e6f31cf25903' - 'fbb204bfbd1866b03f6e57b4d260fa8a62de9391d340ba081e8bf017b25f848b229ae54bedc2d4adff78e0195da400319aa3bf42716f1e67135895d436e7bdae' - '58906415c3f9a573950fe9c0606f808c8b9b1198ac08cd995fbec03ab1e315a5cff504245958a303dabf0e0fb3466abfd35f3c3b536161f805f1abccc9f5ccb6' - '3e3e2d48522fea84855e5305e08e7f8cc2ec7a2643c8882bc0a260c821ccdb16e70590d7ceec916d0d09297486b3c5bb6a1b4b31f670ec4ede72a429255db317') + 'a7b6a5a6da4861ee51f3e9a9064c39ef1e5f2efb7d969f20f93028acfa0eed0264c336fce2eb1c6a3bdcdc595ef2cf3441b5db7cd4eebf5f24e5cb4a19a7d915' + '29185acc7ea3ad48e805945e53717bfd8483a0581236eb49e63eb8e9f467ddcede38a606d089aa35e5fb73099a1ebdb253fc4c51a7933b900fc36918a43628b8' + '405f09681808c108ec4a889f7628ede4aec15122c8a6848b5a7ec99a17bd8d72bf410152461164acd0f17d92a460732bf525c26a17b319b94dc940dccf6d3ebf' + '1882619e98fa4b6cc2738c25ebf0ba957499f6b20f6837f23379b90700a6a751d0a9be85032f1c9e1d98f8d839784a3caa611266ad68e311dd3747cb0396b817' + '53459f8971e87a3a5dfff3e72be5d27460a624eff06ccabb57bef1fd039c77d67f0f9eecdc03661c929d9eda9bff8f86383c9b16b15602a874bcf1914aecf633') mksource() { - # First build a libre version of json-${_jsonver}.gem + # Start with the vanilla version of json cd "$srcdir/json-${_jsonver}" - rm -rf ext + # Apply changes made to it for the ruby distribution + patch -p1 -i ../json-${_jsonver}-ruby-${pkgver}-backports.patch + # Modify it so that 'json' doesn't try to load (non-free!) 'json/ext' + rm -rf -- json.gemspec ext lib/json/ext* patch -p1 -i ../json-${_jsonver}-libre.patch - gem build json.gemspec - mv json-${_jsonver}.gem .. + + # Now modify the ruby sources to include the json_pure lib instead + # of the json ext + cd "$srcdir/ruby-${pkgver}" + # remove the json ext + rm -rv ext/json test/json + patch -p1 -i ../ruby-${pkgver}-remove-json-ext.patch + # and insert the json_pure lib + cp -r ../json-${_jsonver}/lib/* -t lib/ + cp ../json-${_jsonver}/json_pure.gemspec -t lib/json/ + cp -rT ../json-${_jsonver}/tests test/json + patch -p1 -i ../ruby-${pkgver}-add-json_pure.patch # Clean up the original json sources cd "$srcdir" rm -rf "json-${_jsonver}" - - # Modify the Ruby sources to use the json .gem we created above. - cd "$srcdir/ruby-${pkgver}" - # remove the supplied json version - rm -rv ext/json test/json - patch -p1 -i ../ruby-${pkgver:0:3}-libre.patch - # and insert ours - cp ../"json-${_jsonver}.gem" gems/ - mkdir -p gems/json-${_jsonver} - cd gems/json-${_jsonver} - bsdtar xqOf ../json-${_jsonver}.gem data.tar.gz | bsdtar xzf - } build() { @@ -110,4 +123,8 @@ package_ruby-docs() { install -D -m644 COPYING "${pkgdir}/usr/share/licenses/ruby-docs/LICENSE" install -D -m644 BSDL "${pkgdir}/usr/share/licenses/ruby-docs/BSDL" + + # sometimes it installs ruby/capi/doxygen_objdb_XXXXXXX.tmp; + # otherwise /usr/share/doc is empty + rm -rf "$pkgdir/usr/share/doc" } diff --git a/libre/ruby/json-1.8.1-libre.patch b/libre/ruby/json-1.8.1-libre.patch deleted file mode 100644 index 4fb5dd1e2..000000000 --- a/libre/ruby/json-1.8.1-libre.patch +++ /dev/null @@ -1,238 +0,0 @@ -diff -Nur json-1.8.1.orig/Rakefile json-1.8.1/Rakefile ---- json-1.8.1.orig/Rakefile 2013-10-17 09:53:47.000000000 -0200 -+++ json-1.8.1/Rakefile 2015-04-14 15:33:02.055063119 -0300 -@@ -14,8 +14,7 @@ - require 'rake/clean' - CLOBBER.include 'doc', 'Gemfile.lock' - CLEAN.include FileList['diagrams/*.*'], 'doc', 'coverage', 'tmp', -- FileList["ext/**/{Makefile,mkmf.log}"], 'build', 'dist', FileList['**/*.rbc'], -- FileList["{ext,lib}/**/*.{so,bundle,#{CONFIG['DLEXT']},o,obj,pdb,lib,manifest,exp,def,jar,class,dSYM}"], -+ FileList["lib/**/*.{bundle,pdb,lib,manifest,exp,def,jar,class,dSYM}"], - FileList['java/src/**/*.class'] - - require 'rake/testtask' -@@ -34,15 +33,6 @@ - PKG_VERSION = File.read('VERSION').chomp - PKG_FILES = FileList[`git ls-files`.split(/\n/)] - --EXT_ROOT_DIR = 'ext/json/ext' --EXT_PARSER_DIR = "#{EXT_ROOT_DIR}/parser" --EXT_PARSER_DL = "#{EXT_PARSER_DIR}/parser.#{CONFIG['DLEXT']}" --RAGEL_PATH = "#{EXT_PARSER_DIR}/parser.rl" --EXT_PARSER_SRC = "#{EXT_PARSER_DIR}/parser.c" --EXT_GENERATOR_DIR = "#{EXT_ROOT_DIR}/generator" --EXT_GENERATOR_DL = "#{EXT_GENERATOR_DIR}/generator.#{CONFIG['DLEXT']}" --EXT_GENERATOR_SRC = "#{EXT_GENERATOR_DIR}/generator.c" -- - JAVA_DIR = "java/src/json/ext" - JAVA_RAGEL_PATH = "#{JAVA_DIR}/Parser.rl" - JAVA_PARSER_SRC = "#{JAVA_DIR}/Parser.java" -@@ -59,20 +49,8 @@ - ruby 'install.rb' - end - --task :install_ext_really do -- sitearchdir = CONFIG["sitearchdir"] -- cd 'ext' do -- for file in Dir["json/ext/*.#{CONFIG['DLEXT']}"] -- d = File.join(sitearchdir, file) -- mkdir_p File.dirname(d) -- install(file, d) -- end -- warn " *** Installed EXT ruby library." -- end --end -- - desc "Installing library (extension)" --task :install_ext => [ :compile, :install_pure, :install_ext_really ] -+task :install_ext => [ :compile, :install_pure ] - - desc "Installing library (extension)" - task :install => :install_ext -@@ -118,12 +96,10 @@ - s.name = 'json' - s.version = PKG_VERSION - s.summary = PKG_TITLE -- s.description = "This is a JSON implementation as a Ruby extension in C." -+ s.description = "This is a JSON implementation in pure Ruby." - - s.files = PKG_FILES - -- s.extensions = FileList['ext/**/extconf.rb'] -- - s.require_path = 'lib' - s.add_development_dependency 'permutation' - s.add_development_dependency 'sdoc', '~>0.3.16' -@@ -312,96 +288,21 @@ - task :release => :build - else - desc "Compiling extension" -- task :compile => [ EXT_PARSER_DL, EXT_GENERATOR_DL ] -- -- file EXT_PARSER_DL => EXT_PARSER_SRC do -- cd EXT_PARSER_DIR do -- ruby 'extconf.rb' -- sh MAKE -- end -- cp "#{EXT_PARSER_DIR}/parser.#{CONFIG['DLEXT']}", EXT_ROOT_DIR -- end -- -- file EXT_GENERATOR_DL => EXT_GENERATOR_SRC do -- cd EXT_GENERATOR_DIR do -- ruby 'extconf.rb' -- sh MAKE -- end -- cp "#{EXT_GENERATOR_DIR}/generator.#{CONFIG['DLEXT']}", EXT_ROOT_DIR -- end -+ task :compile - - desc "Testing library (extension)" -- task :test_ext => [ :compile, :do_test_ext ] -- -- UndocumentedTestTask.new do |t| -- t.name = 'do_test_ext' -- t.libs << 'ext' << 'lib' -- t.test_files = FileList['tests/test_*.rb'] -- t.verbose = true -- t.options = '-v' -- end -+ task :test_ext => :test_pure - - desc "Create RDOC documentation" -- task :doc => [ :version, EXT_PARSER_SRC ] do -- sh "sdoc -o doc -t '#{PKG_TITLE}' -m README.rdoc README.rdoc lib/json.rb #{FileList['lib/json/**/*.rb']} #{EXT_PARSER_SRC} #{EXT_GENERATOR_SRC}" -- end -- -- desc "Generate parser with ragel" -- task :ragel => EXT_PARSER_SRC -- -- desc "Delete the ragel generated C source" -- task :ragel_clean do -- rm_rf EXT_PARSER_SRC -+ task :doc => :version do -+ sh "sdoc -o doc -t '#{PKG_TITLE}' -m README.rdoc README.rdoc lib/json.rb #{FileList['lib/json/**/*.rb']}" - end - - desc "Update the tags file" - task :tags do -- system 'ctags', *Dir['**/*.{rb,c,h,java}'] -- end -- -- file EXT_PARSER_SRC => RAGEL_PATH do -- cd EXT_PARSER_DIR do -- if RAGEL_CODEGEN == 'ragel' -- sh "ragel parser.rl -G2 -o parser.c" -- else -- sh "ragel -x parser.rl | #{RAGEL_CODEGEN} -G2" -- end -- src = File.read("parser.c").gsub(/[ \t]+$/, '') -- File.open("parser.c", "w") {|f| f.print src} -- end -- end -- -- desc "Generate diagrams of ragel parser (ps)" -- task :ragel_dot_ps do -- root = 'diagrams' -- specs = [] -- File.new(RAGEL_PATH).grep(/^\s*machine\s*(\S+);\s*$/) { specs << $1 } -- for s in specs -- if RAGEL_DOTGEN == 'ragel' -- sh "ragel #{RAGEL_PATH} -S#{s} -p -V | dot -Tps -o#{root}/#{s}.ps" -- else -- sh "ragel -x #{RAGEL_PATH} -S#{s} | #{RAGEL_DOTGEN} -p|dot -Tps -o#{root}/#{s}.ps" -- end -- end -- end -- -- desc "Generate diagrams of ragel parser (png)" -- task :ragel_dot_png do -- root = 'diagrams' -- specs = [] -- File.new(RAGEL_PATH).grep(/^\s*machine\s*(\S+);\s*$/) { specs << $1 } -- for s in specs -- if RAGEL_DOTGEN == 'ragel' -- sh "ragel #{RAGEL_PATH} -S#{s} -p -V | dot -Tpng -o#{root}/#{s}.png" -- else -- sh "ragel -x #{RAGEL_PATH} -S#{s} | #{RAGEL_DOTGEN} -p|dot -Tpng -o#{root}/#{s}.png" -- end -- end -+ system 'ctags', *Dir['**/*.{rb,java}'] - end - -- desc "Generate diagrams of ragel parser" -- task :ragel_dot => [ :ragel_dot_png, :ragel_dot_ps ] -- - desc "Build all gems and archives for a new release of json and json_pure." - task :build => [ :clean, :gemspec, :package ] - -diff -Nur json-1.8.1.orig/json.gemspec json-1.8.1/json.gemspec ---- json-1.8.1.orig/json.gemspec 2013-10-17 09:53:47.000000000 -0200 -+++ json-1.8.1/json.gemspec 2015-04-14 15:33:02.055063119 -0300 -@@ -8,11 +8,10 @@ - s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= - s.authors = ["Florian Frank"] - s.date = "2013-10-17" -- s.description = "This is a JSON implementation as a Ruby extension in C." -+ s.description = "This is a JSON implementation in pure Ruby." - s.email = "flori@ping.de" -- s.extensions = ["ext/json/ext/generator/extconf.rb", "ext/json/ext/parser/extconf.rb"] - s.extra_rdoc_files = ["README.rdoc"] -- s.files = [".gitignore", ".travis.yml", "CHANGES", "COPYING", "COPYING-json-jruby", "GPL", "Gemfile", "README-json-jruby.markdown", "README.rdoc", "Rakefile", "TODO", "VERSION", "data/example.json", "data/index.html", "data/prototype.js", "diagrams/.keep", "ext/json/ext/fbuffer/fbuffer.h", "ext/json/ext/generator/depend", "ext/json/ext/generator/extconf.rb", "ext/json/ext/generator/generator.c", "ext/json/ext/generator/generator.h", "ext/json/ext/parser/depend", "ext/json/ext/parser/extconf.rb", "ext/json/ext/parser/parser.c", "ext/json/ext/parser/parser.h", "ext/json/ext/parser/parser.rl", "install.rb", "java/src/json/ext/ByteListTranscoder.java", "java/src/json/ext/Generator.java", "java/src/json/ext/GeneratorMethods.java", "java/src/json/ext/GeneratorService.java", "java/src/json/ext/GeneratorState.java", "java/src/json/ext/OptionsReader.java", "java/src/json/ext/Parser.java", "java/src/json/ext/Parser.rl", "java/src/json/ext/ParserService.java", "java/src/json/ext/RuntimeInfo.java", "java/src/json/ext/StringDecoder.java", "java/src/json/ext/StringEncoder.java", "java/src/json/ext/Utils.java", "json-java.gemspec", "json.gemspec", "json_pure.gemspec", "lib/json.rb", "lib/json/add/bigdecimal.rb", "lib/json/add/complex.rb", "lib/json/add/core.rb", "lib/json/add/date.rb", "lib/json/add/date_time.rb", "lib/json/add/exception.rb", "lib/json/add/ostruct.rb", "lib/json/add/range.rb", "lib/json/add/rational.rb", "lib/json/add/regexp.rb", "lib/json/add/struct.rb", "lib/json/add/symbol.rb", "lib/json/add/time.rb", "lib/json/common.rb", "lib/json/ext.rb", "lib/json/ext/.keep", "lib/json/generic_object.rb", "lib/json/pure.rb", "lib/json/pure/generator.rb", "lib/json/pure/parser.rb", "lib/json/version.rb", "tests/fixtures/fail1.json", "tests/fixtures/fail10.json", "tests/fixtures/fail11.json", "tests/fixtures/fail12.json", "tests/fixtures/fail13.json", "tests/fixtures/fail14.json", "tests/fixtures/fail18.json", "tests/fixtures/fail19.json", "tests/fixtures/fail2.json", "tests/fixtures/fail20.json", "tests/fixtures/fail21.json", "tests/fixtures/fail22.json", "tests/fixtures/fail23.json", "tests/fixtures/fail24.json", "tests/fixtures/fail25.json", "tests/fixtures/fail27.json", "tests/fixtures/fail28.json", "tests/fixtures/fail3.json", "tests/fixtures/fail4.json", "tests/fixtures/fail5.json", "tests/fixtures/fail6.json", "tests/fixtures/fail7.json", "tests/fixtures/fail8.json", "tests/fixtures/fail9.json", "tests/fixtures/pass1.json", "tests/fixtures/pass15.json", "tests/fixtures/pass16.json", "tests/fixtures/pass17.json", "tests/fixtures/pass2.json", "tests/fixtures/pass26.json", "tests/fixtures/pass3.json", "tests/setup_variant.rb", "tests/test_json.rb", "tests/test_json_addition.rb", "tests/test_json_encoding.rb", "tests/test_json_fixtures.rb", "tests/test_json_generate.rb", "tests/test_json_generic_object.rb", "tests/test_json_string_matching.rb", "tests/test_json_unicode.rb", "tools/fuzz.rb", "tools/server.rb", "./tests/test_json.rb", "./tests/test_json_addition.rb", "./tests/test_json_encoding.rb", "./tests/test_json_fixtures.rb", "./tests/test_json_generate.rb", "./tests/test_json_generic_object.rb", "./tests/test_json_string_matching.rb", "./tests/test_json_unicode.rb"] -+ s.files = [".gitignore", ".travis.yml", "CHANGES", "COPYING", "COPYING-json-jruby", "GPL", "Gemfile", "README-json-jruby.markdown", "README.rdoc", "Rakefile", "TODO", "VERSION", "data/example.json", "data/index.html", "data/prototype.js", "diagrams/.keep", "install.rb", "java/src/json/ext/ByteListTranscoder.java", "java/src/json/ext/Generator.java", "java/src/json/ext/GeneratorMethods.java", "java/src/json/ext/GeneratorService.java", "java/src/json/ext/GeneratorState.java", "java/src/json/ext/OptionsReader.java", "java/src/json/ext/Parser.java", "java/src/json/ext/Parser.rl", "java/src/json/ext/ParserService.java", "java/src/json/ext/RuntimeInfo.java", "java/src/json/ext/StringDecoder.java", "java/src/json/ext/StringEncoder.java", "java/src/json/ext/Utils.java", "json-java.gemspec", "json.gemspec", "json_pure.gemspec", "lib/json.rb", "lib/json/add/bigdecimal.rb", "lib/json/add/complex.rb", "lib/json/add/core.rb", "lib/json/add/date.rb", "lib/json/add/date_time.rb", "lib/json/add/exception.rb", "lib/json/add/ostruct.rb", "lib/json/add/range.rb", "lib/json/add/rational.rb", "lib/json/add/regexp.rb", "lib/json/add/struct.rb", "lib/json/add/symbol.rb", "lib/json/add/time.rb", "lib/json/common.rb", "lib/json/ext.rb", "lib/json/ext/.keep", "lib/json/generic_object.rb", "lib/json/pure.rb", "lib/json/pure/generator.rb", "lib/json/pure/parser.rb", "lib/json/version.rb", "tests/fixtures/fail1.json", "tests/fixtures/fail10.json", "tests/fixtures/fail11.json", "tests/fixtures/fail12.json", "tests/fixtures/fail13.json", "tests/fixtures/fail14.json", "tests/fixtures/fail18.json", "tests/fixtures/fail19.json", "tests/fixtures/fail2.json", "tests/fixtures/fail20.json", "tests/fixtures/fail21.json", "tests/fixtures/fail22.json", "tests/fixtures/fail23.json", "tests/fixtures/fail24.json", "tests/fixtures/fail25.json", "tests/fixtures/fail27.json", "tests/fixtures/fail28.json", "tests/fixtures/fail3.json", "tests/fixtures/fail4.json", "tests/fixtures/fail5.json", "tests/fixtures/fail6.json", "tests/fixtures/fail7.json", "tests/fixtures/fail8.json", "tests/fixtures/fail9.json", "tests/fixtures/pass1.json", "tests/fixtures/pass15.json", "tests/fixtures/pass16.json", "tests/fixtures/pass17.json", "tests/fixtures/pass2.json", "tests/fixtures/pass26.json", "tests/fixtures/pass3.json", "tests/setup_variant.rb", "tests/test_json.rb", "tests/test_json_addition.rb", "tests/test_json_encoding.rb", "tests/test_json_fixtures.rb", "tests/test_json_generate.rb", "tests/test_json_generic_object.rb", "tests/test_json_string_matching.rb", "tests/test_json_unicode.rb", "tools/fuzz.rb", "tools/server.rb", "./tests/test_json.rb", "./tests/test_json_addition.rb", "./tests/test_json_encoding.rb", "./tests/test_json_fixtures.rb", "./tests/test_json_generate.rb", "./tests/test_json_generic_object.rb", "./tests/test_json_string_matching.rb", "./tests/test_json_unicode.rb"] - s.homepage = "http://flori.github.com/json" - s.licenses = ["Ruby"] - s.rdoc_options = ["--title", "JSON implemention for Ruby", "--main", "README.rdoc"] -diff -Nur json-1.8.1.orig/json_pure.gemspec json-1.8.1/json_pure.gemspec ---- json-1.8.1.orig/json_pure.gemspec 2013-10-17 09:53:47.000000000 -0200 -+++ json-1.8.1/json_pure.gemspec 2015-04-14 15:33:02.055063119 -0300 -@@ -11,7 +11,7 @@ - s.description = "This is a JSON implementation in pure Ruby." - s.email = "flori@ping.de" - s.extra_rdoc_files = ["README.rdoc"] -- s.files = [".gitignore", ".travis.yml", "CHANGES", "COPYING", "COPYING-json-jruby", "GPL", "Gemfile", "README-json-jruby.markdown", "README.rdoc", "Rakefile", "TODO", "VERSION", "data/example.json", "data/index.html", "data/prototype.js", "diagrams/.keep", "ext/json/ext/fbuffer/fbuffer.h", "ext/json/ext/generator/depend", "ext/json/ext/generator/extconf.rb", "ext/json/ext/generator/generator.c", "ext/json/ext/generator/generator.h", "ext/json/ext/parser/depend", "ext/json/ext/parser/extconf.rb", "ext/json/ext/parser/parser.c", "ext/json/ext/parser/parser.h", "ext/json/ext/parser/parser.rl", "install.rb", "java/src/json/ext/ByteListTranscoder.java", "java/src/json/ext/Generator.java", "java/src/json/ext/GeneratorMethods.java", "java/src/json/ext/GeneratorService.java", "java/src/json/ext/GeneratorState.java", "java/src/json/ext/OptionsReader.java", "java/src/json/ext/Parser.java", "java/src/json/ext/Parser.rl", "java/src/json/ext/ParserService.java", "java/src/json/ext/RuntimeInfo.java", "java/src/json/ext/StringDecoder.java", "java/src/json/ext/StringEncoder.java", "java/src/json/ext/Utils.java", "json-java.gemspec", "json.gemspec", "json_pure.gemspec", "lib/json.rb", "lib/json/add/bigdecimal.rb", "lib/json/add/complex.rb", "lib/json/add/core.rb", "lib/json/add/date.rb", "lib/json/add/date_time.rb", "lib/json/add/exception.rb", "lib/json/add/ostruct.rb", "lib/json/add/range.rb", "lib/json/add/rational.rb", "lib/json/add/regexp.rb", "lib/json/add/struct.rb", "lib/json/add/symbol.rb", "lib/json/add/time.rb", "lib/json/common.rb", "lib/json/ext.rb", "lib/json/ext/.keep", "lib/json/generic_object.rb", "lib/json/pure.rb", "lib/json/pure/generator.rb", "lib/json/pure/parser.rb", "lib/json/version.rb", "tests/fixtures/fail1.json", "tests/fixtures/fail10.json", "tests/fixtures/fail11.json", "tests/fixtures/fail12.json", "tests/fixtures/fail13.json", "tests/fixtures/fail14.json", "tests/fixtures/fail18.json", "tests/fixtures/fail19.json", "tests/fixtures/fail2.json", "tests/fixtures/fail20.json", "tests/fixtures/fail21.json", "tests/fixtures/fail22.json", "tests/fixtures/fail23.json", "tests/fixtures/fail24.json", "tests/fixtures/fail25.json", "tests/fixtures/fail27.json", "tests/fixtures/fail28.json", "tests/fixtures/fail3.json", "tests/fixtures/fail4.json", "tests/fixtures/fail5.json", "tests/fixtures/fail6.json", "tests/fixtures/fail7.json", "tests/fixtures/fail8.json", "tests/fixtures/fail9.json", "tests/fixtures/pass1.json", "tests/fixtures/pass15.json", "tests/fixtures/pass16.json", "tests/fixtures/pass17.json", "tests/fixtures/pass2.json", "tests/fixtures/pass26.json", "tests/fixtures/pass3.json", "tests/setup_variant.rb", "tests/test_json.rb", "tests/test_json_addition.rb", "tests/test_json_encoding.rb", "tests/test_json_fixtures.rb", "tests/test_json_generate.rb", "tests/test_json_generic_object.rb", "tests/test_json_string_matching.rb", "tests/test_json_unicode.rb", "tools/fuzz.rb", "tools/server.rb", "./tests/test_json.rb", "./tests/test_json_addition.rb", "./tests/test_json_encoding.rb", "./tests/test_json_fixtures.rb", "./tests/test_json_generate.rb", "./tests/test_json_generic_object.rb", "./tests/test_json_string_matching.rb", "./tests/test_json_unicode.rb"] -+ s.files = [".gitignore", ".travis.yml", "CHANGES", "COPYING", "COPYING-json-jruby", "GPL", "Gemfile", "README-json-jruby.markdown", "README.rdoc", "Rakefile", "TODO", "VERSION", "data/example.json", "data/index.html", "data/prototype.js", "diagrams/.keep", "install.rb", "java/src/json/ext/ByteListTranscoder.java", "java/src/json/ext/Generator.java", "java/src/json/ext/GeneratorMethods.java", "java/src/json/ext/GeneratorService.java", "java/src/json/ext/GeneratorState.java", "java/src/json/ext/OptionsReader.java", "java/src/json/ext/Parser.java", "java/src/json/ext/Parser.rl", "java/src/json/ext/ParserService.java", "java/src/json/ext/RuntimeInfo.java", "java/src/json/ext/StringDecoder.java", "java/src/json/ext/StringEncoder.java", "java/src/json/ext/Utils.java", "json-java.gemspec", "json.gemspec", "json_pure.gemspec", "lib/json.rb", "lib/json/add/bigdecimal.rb", "lib/json/add/complex.rb", "lib/json/add/core.rb", "lib/json/add/date.rb", "lib/json/add/date_time.rb", "lib/json/add/exception.rb", "lib/json/add/ostruct.rb", "lib/json/add/range.rb", "lib/json/add/rational.rb", "lib/json/add/regexp.rb", "lib/json/add/struct.rb", "lib/json/add/symbol.rb", "lib/json/add/time.rb", "lib/json/common.rb", "lib/json/ext.rb", "lib/json/ext/.keep", "lib/json/generic_object.rb", "lib/json/pure.rb", "lib/json/pure/generator.rb", "lib/json/pure/parser.rb", "lib/json/version.rb", "tests/fixtures/fail1.json", "tests/fixtures/fail10.json", "tests/fixtures/fail11.json", "tests/fixtures/fail12.json", "tests/fixtures/fail13.json", "tests/fixtures/fail14.json", "tests/fixtures/fail18.json", "tests/fixtures/fail19.json", "tests/fixtures/fail2.json", "tests/fixtures/fail20.json", "tests/fixtures/fail21.json", "tests/fixtures/fail22.json", "tests/fixtures/fail23.json", "tests/fixtures/fail24.json", "tests/fixtures/fail25.json", "tests/fixtures/fail27.json", "tests/fixtures/fail28.json", "tests/fixtures/fail3.json", "tests/fixtures/fail4.json", "tests/fixtures/fail5.json", "tests/fixtures/fail6.json", "tests/fixtures/fail7.json", "tests/fixtures/fail8.json", "tests/fixtures/fail9.json", "tests/fixtures/pass1.json", "tests/fixtures/pass15.json", "tests/fixtures/pass16.json", "tests/fixtures/pass17.json", "tests/fixtures/pass2.json", "tests/fixtures/pass26.json", "tests/fixtures/pass3.json", "tests/setup_variant.rb", "tests/test_json.rb", "tests/test_json_addition.rb", "tests/test_json_encoding.rb", "tests/test_json_fixtures.rb", "tests/test_json_generate.rb", "tests/test_json_generic_object.rb", "tests/test_json_string_matching.rb", "tests/test_json_unicode.rb", "tools/fuzz.rb", "tools/server.rb", "./tests/test_json.rb", "./tests/test_json_addition.rb", "./tests/test_json_encoding.rb", "./tests/test_json_fixtures.rb", "./tests/test_json_generate.rb", "./tests/test_json_generic_object.rb", "./tests/test_json_string_matching.rb", "./tests/test_json_unicode.rb"] - s.homepage = "http://flori.github.com/json" - s.licenses = ["Ruby"] - s.rdoc_options = ["--title", "JSON implemention for ruby", "--main", "README.rdoc"] -diff -Nur json-1.8.1.orig/lib/json/ext.rb json-1.8.1/lib/json/ext.rb ---- json-1.8.1.orig/lib/json/ext.rb 2013-10-17 09:53:47.000000000 -0200 -+++ json-1.8.1/lib/json/ext.rb 2015-04-14 15:33:02.055063119 -0300 -@@ -5,16 +5,18 @@ - end - end - require 'json/common' -+require 'json/pure/parser' -+require 'json/pure/generator' - - module JSON - # This module holds all the modules/classes that implement JSON's -- # functionality as C extensions. -+ # functionality in pure ruby. -+ Ext = Pure -+ - module Ext -- require 'json/ext/parser' -- require 'json/ext/generator' -- $DEBUG and warn "Using Ext extension for JSON." -- JSON.parser = Parser -- JSON.generator = Generator -+ $DEBUG and warn "Using Pure library for JSON." -+ JSON.parser = Pure::Parser -+ JSON.generator = Pure::Generator - end - - JSON_LOADED = true unless defined?(::JSON::JSON_LOADED) -diff -Nur json-1.8.1.orig/lib/json.rb json-1.8.1/lib/json.rb ---- json-1.8.1.orig/lib/json.rb 2013-10-17 09:53:47.000000000 -0200 -+++ json-1.8.1/lib/json.rb 2015-04-14 15:33:02.055063119 -0300 -@@ -54,9 +54,5 @@ - module JSON - require 'json/version' - -- begin -- require 'json/ext' -- rescue LoadError -- require 'json/pure' -- end -+ require 'json/pure' - end diff --git a/libre/ruby/json-2.0.2-libre.patch b/libre/ruby/json-2.0.2-libre.patch new file mode 100644 index 000000000..188bc628e --- /dev/null +++ b/libre/ruby/json-2.0.2-libre.patch @@ -0,0 +1,36 @@ +diff --git a/lib/json.rb b/lib/json.rb +index b5a6912415..bf93c663fe 100644 +--- a/lib/json.rb ++++ b/lib/json.rb +@@ -55,9 +55,5 @@ + module JSON + require 'json/version' + +- begin +- require 'json/ext' +- rescue LoadError +- require 'json/pure' +- end ++ require 'json/pure' + end +--- a/tests/test_helper.rb ++++ b/tests/test_helper.rb +@@ -1,16 +1,7 @@ + gem 'json', File.read('VERSION').chomp + +-case ENV['JSON'] +-when 'pure' +- $:.unshift 'lib' +- require 'json/pure' +-when 'ext' +- $:.unshift 'ext', 'lib' +- require 'json/ext' +-else +- $:.unshift 'ext', 'lib' +- require 'json' +-end ++$:.unshift 'lib' ++require 'json' + + require 'test/unit' + begin diff --git a/libre/ruby/json-2.0.2-ruby-2.4.1-backports.patch b/libre/ruby/json-2.0.2-ruby-2.4.1-backports.patch new file mode 100644 index 000000000..4791731fb --- /dev/null +++ b/libre/ruby/json-2.0.2-ruby-2.4.1-backports.patch @@ -0,0 +1,64 @@ +This is the complete set of patches applied to json-2.0.2 for the ruby +2.4.1 distribution (excluding build system changes). + + -- Luke Shumaker + Parabola GNU/Linux-libre + +commit 1ffad9c1a7bafb59453acf0779231e241458260b +Author: nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> +Date: Fri Sep 9 09:27:38 2016 +0000 + + json_generator_test.rb: no Bignum + + * test/json/json_generator_test.rb (test_broken_bignum): get rid + of use of Bignum, obsolete name. + + git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56126 b2dd03c8-39d4-4d8f-98ff-823fe69b080e + (cherry picked from commit 7f6410f02d3092075b9990705d0151ffb44f51a1) + +diff --git a/tests/json_generator_test.rb b/tests/json_generator_test.rb +index 18b08337f8..86be398f46 100644 +--- a/tests/json_generator_test.rb ++++ b/tests/json_generator_test.rb +@@ -277,12 +277,13 @@ EOT + if defined?(JSON::Ext::Generator) + def test_broken_bignum # [ruby-core:38867] + pid = fork do +- Bignum.class_eval do ++ x = 1 << 64 ++ x.class.class_eval do + def to_s + end + end + begin +- JSON::Ext::Generator::State.new.generate(1<<64) ++ JSON::Ext::Generator::State.new.generate(x) + exit 1 + rescue TypeError + exit 0 + +commit 9f4a32dbd50df3bb066be4028a3b1bb9845c76cd +Author: nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> +Date: Tue Aug 30 06:27:29 2016 +0000 + + Fix rdoc of OpenStruct.json_create [ci skip] + + * ext/json/lib/json/add/ostruct.rb (OpenStruct.json_create): + Correct documentation, fix the name of values. [Fix GH-1421] + + git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56038 b2dd03c8-39d4-4d8f-98ff-823fe69b080e + (cherry picked from commit c2d77880c070fa94e6fe1e31e477225c13318933) + +diff --git a/lib/json/add/ostruct.rb b/lib/json/add/ostruct.rb +index 7c13910052..e064c85ff4 100644 +--- a/lib/json/add/ostruct.rb ++++ b/lib/json/add/ostruct.rb +@@ -7,7 +7,7 @@ require 'ostruct' + class OpenStruct + + # Deserializes JSON string by constructing new Struct object with values +- # <tt>v</tt> serialized by <tt>to_json</tt>. ++ # <tt>t</tt> serialized by <tt>to_json</tt>. + def self.json_create(object) + new(object['t'] || object[:t]) + end diff --git a/libre/ruby/ruby-2.4-libre.patch b/libre/ruby/ruby-2.4-libre.patch deleted file mode 100644 index 3f6647cca..000000000 --- a/libre/ruby/ruby-2.4-libre.patch +++ /dev/null @@ -1,74 +0,0 @@ -diff -Nur ruby-2.4.0.orig/common.mk ruby-2.4.0/common.mk ---- ruby-2.4.0.orig/common.mk 2016-11-30 14:29:19.000000000 -0300 -+++ ruby-2.4.0/common.mk 2017-01-11 14:30:02.197544090 -0300 -@@ -27,7 +27,7 @@ - RUBY_RELEASE_DATE = $(RUBY_RELEASE_YEAR)-$(RUBY_RELEASE_MONTH)-$(RUBY_RELEASE_DAY) - RUBYLIB = $(PATH_SEPARATOR) - RUBYOPT = - --RUN_OPTS = --disable-gems -+RUN_OPTS = --disable-gems -I$(srcdir)/../json-1.8.1/lib - - INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir) -I$(srcdir) -I$(UNICODE_HDR_DIR) - -@@ -814,8 +814,7 @@ - - srcs-ext: $(EXT_SRCS) - --srcs-extra: $(srcdir)/ext/json/parser/parser.c \ -- $(srcdir)/ext/date/zonetab.h \ -+srcs-extra: $(srcdir)/ext/date/zonetab.h \ - $(empty) - - LIB_SRCS = $(srcdir)/lib/unicode_normalize/tables.rb -@@ -911,11 +910,6 @@ - Q=$(Q) ECHO=$(ECHO) RM="$(RM)" top_srcdir=../.. srcdir=. VPATH="$(PWD)" \ - RUBY="$(BASERUBY)" PATH_SEPARATOR="$(PATH_SEPARATOR)" - --$(srcdir)/ext/json/parser/parser.c: $(srcdir)/ext/json/parser/parser.rl -- $(ECHO) generating $@ -- $(Q) $(CHDIR) $(@D) && $(exec) $(MAKE) -f prereq.mk $(MFLAGS) \ -- Q=$(Q) ECHO=$(ECHO) top_srcdir=../../.. srcdir=. VPATH=../../.. BASERUBY="$(BASERUBY)" -- - $(srcdir)/ext/date/zonetab.h: $(srcdir)/ext/date/zonetab.list - $(ECHO) generating $@ - $(Q) $(CHDIR) $(@D) && $(exec) $(MAKE) -f prereq.mk $(MFLAGS) \ -diff -Nur ruby-2.4.0.orig/ext/.document ruby-2.4.0/ext/.document ---- ruby-2.4.0.orig/ext/.document 2014-08-02 11:55:36.000000000 -0300 -+++ ruby-2.4.0/ext/.document 2017-01-11 14:25:50.386510205 -0300 -@@ -35,9 +35,6 @@ - io/nonblock/nonblock.c - io/wait/lib - io/wait/wait.c --json/ext/generator/generator.c --json/ext/parser/parser.c --json/lib - mathn/complex/complex.c - mathn/rational/rational.c - nkf/lib -diff -Nur ruby-2.4.0.orig/gems/bundled_gems ruby-2.4.0/gems/bundled_gems ---- ruby-2.4.0.orig/gems/bundled_gems 2016-12-22 00:53:53.000000000 -0300 -+++ ruby-2.4.0/gems/bundled_gems 2017-01-11 14:28:18.729284682 -0300 -@@ -5,3 +5,4 @@ - rake 12.0.0 - test-unit 3.2.3 - xmlrpc 0.2.1 -+json 1.8.1 -diff -Nur ruby-2.4.0.orig/test/ruby/test_module.rb ruby-2.4.0/test/ruby/test_module.rb ---- ruby-2.4.0.orig/test/ruby/test_module.rb 2016-11-14 16:27:24.000000000 -0300 -+++ ruby-2.4.0/test/ruby/test_module.rb 2017-01-11 14:25:50.386510205 -0300 -@@ -211,7 +211,6 @@ - - ancestors = Object.ancestors - mixins = ancestors - [Object, Kernel, BasicObject] -- mixins << JSON::Ext::Generator::GeneratorMethods::String if defined?(JSON::Ext::Generator::GeneratorMethods::String) - assert_equal([Object, Kernel, BasicObject], ancestors - mixins) - assert_equal([String, Comparable, Object, Kernel, BasicObject], String.ancestors - mixins) - end -@@ -449,7 +448,6 @@ - assert_equal([Mixin], User.included_modules) - - mixins = Object.included_modules - [Kernel] -- mixins << JSON::Ext::Generator::GeneratorMethods::String if defined?(JSON::Ext::Generator::GeneratorMethods::String) - assert_equal([Kernel], Object.included_modules - mixins) - assert_equal([Comparable, Kernel], String.included_modules - mixins) - end diff --git a/libre/ruby/ruby-2.4.1-add-json_pure.patch b/libre/ruby/ruby-2.4.1-add-json_pure.patch new file mode 100644 index 000000000..b624687d0 --- /dev/null +++ b/libre/ruby/ruby-2.4.1-add-json_pure.patch @@ -0,0 +1,32 @@ +diff --git a/doc/maintainers.rdoc b/doc/maintainers.rdoc +index ec6a6b7134..11a1079e57 100644 +--- a/doc/maintainers.rdoc ++++ b/doc/maintainers.rdoc +@@ -72,6 +72,8 @@ Zachary Scott (zzak) + Akinori MUSHA (knu) + [lib/irb.rb, lib/irb/*] + Keiju ISHITSUKA (keiju) ++[lib/json] ++ NARUSE, Yui (naruse) + [lib/logger.rb] + Naotoshi Seo (sonots) + [lib/mathn.rb] +diff --git a/lib/json/.document b/lib/json/.document +new file mode 100644 +index 0000000000..7ae6b614de +--- /dev/null ++++ b/lib/json/.document +@@ -0,0 +1,3 @@ ++*.rb ++add/*.rb ++pure/*.rb +diff --git a/test/json/test_helper.rb b/test/json/test_helper.rb +index 9d3665d47a..3feed36b6a 100644 +--- a/test/json/test_helper.rb ++++ b/test/json/test_helper.rb +@@ -1,5 +1,3 @@ +-gem 'json', File.read('VERSION').chomp +- + $:.unshift 'lib' + require 'json' + diff --git a/libre/ruby/ruby-2.4.1-remove-json-ext.patch b/libre/ruby/ruby-2.4.1-remove-json-ext.patch new file mode 100644 index 000000000..4005e4ccf --- /dev/null +++ b/libre/ruby/ruby-2.4.1-remove-json-ext.patch @@ -0,0 +1,114 @@ +diff --git a/LEGAL b/LEGAL +index 8080cfef61..d5dfef033c 100644 +--- a/LEGAL ++++ b/LEGAL +@@ -593,28 +593,6 @@ ext/digest/sha2/sha2.[ch]: + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + +-ext/json/generator/generator.c: +- +- Copyright 2001-2004 Unicode, Inc. +- +- Disclaimer +- +- This source code is provided as is by Unicode, Inc. No claims are +- made as to fitness for any particular purpose. No warranties of any +- kind are expressed or implied. The recipient agrees to determine +- applicability of information provided. If this file has been +- purchased on magnetic or optical media from Unicode, Inc., the +- sole remedy for any claim will be exchange of defective media +- within 90 days of receipt. +- +- Limitations on Rights to Redistribute This Code +- +- Unicode, Inc. hereby grants the right to freely use the information +- supplied in this file in the creation of products supporting the +- Unicode Standard, and to make copies of this file in any form +- for internal or external distribution as long as this notice +- remains attached. +- + ext/nkf/nkf-utf8/config.h: + ext/nkf/nkf-utf8/nkf.c: + ext/nkf/nkf-utf8/utf8tbl.c: +diff --git a/common.mk b/common.mk +index 3f4bcf6c3a..6c5bea5402 100644 +--- a/common.mk ++++ b/common.mk +@@ -814,8 +814,7 @@ EXT_SRCS = $(srcdir)/ext/ripper/ripper.c \ + + srcs-ext: $(EXT_SRCS) + +-srcs-extra: $(srcdir)/ext/json/parser/parser.c \ +- $(srcdir)/ext/date/zonetab.h \ ++srcs-extra: $(srcdir)/ext/date/zonetab.h \ + $(empty) + + LIB_SRCS = $(srcdir)/lib/unicode_normalize/tables.rb +@@ -911,11 +910,6 @@ $(srcdir)/ext/ripper/ripper.c: $(srcdir)/parse.y id.h + Q=$(Q) ECHO=$(ECHO) RM="$(RM)" top_srcdir=../.. srcdir=. VPATH="$(PWD)" \ + RUBY="$(BASERUBY)" PATH_SEPARATOR="$(PATH_SEPARATOR)" + +-$(srcdir)/ext/json/parser/parser.c: $(srcdir)/ext/json/parser/parser.rl +- $(ECHO) generating $@ +- $(Q) $(CHDIR) $(@D) && $(exec) $(MAKE) -f prereq.mk $(MFLAGS) \ +- Q=$(Q) ECHO=$(ECHO) top_srcdir=../../.. srcdir=. VPATH=../../.. BASERUBY="$(BASERUBY)" +- + $(srcdir)/ext/date/zonetab.h: $(srcdir)/ext/date/zonetab.list + $(ECHO) generating $@ + $(Q) $(CHDIR) $(@D) && $(exec) $(MAKE) -f prereq.mk $(MFLAGS) \ +diff --git a/doc/maintainers.rdoc b/doc/maintainers.rdoc +index d22d09f7a4..ec6a6b7134 100644 +--- a/doc/maintainers.rdoc ++++ b/doc/maintainers.rdoc +@@ -209,8 +209,6 @@ Zachary Scott (zzak) + Nobuyuki Nakada (nobu) + [ext/io/wait] + Nobuyuki Nakada (nobu) +-[ext/json] +- NARUSE, Yui (naruse) + [ext/mathn/complex] + Keiju ISHITSUKA (keiju) + [ext/mathn/rational] +diff --git a/ext/.document b/ext/.document +index 2e6fc78879..f5da0912ed 100644 +--- a/ext/.document ++++ b/ext/.document +@@ -35,9 +35,6 @@ io/console/console.c + io/nonblock/nonblock.c + io/wait/lib + io/wait/wait.c +-json/ext/generator/generator.c +-json/ext/parser/parser.c +-json/lib + mathn/complex/complex.c + mathn/rational/rational.c + nkf/lib +diff --git a/ext/Setup b/ext/Setup +index 0929d647ae..7d5e99bca7 100644 +--- a/ext/Setup ++++ b/ext/Setup +@@ -20,9 +20,6 @@ + #io/console + #io/nonblock + #io/wait +-#json +-#json/generator +-#json/parser + #mathn/complex + #mathn/rational + #nkf +diff --git a/ext/Setup.nacl b/ext/Setup.nacl +index eb8a1a70cd..4b1cca1392 100644 +--- a/ext/Setup.nacl ++++ b/ext/Setup.nacl +@@ -22,9 +22,6 @@ + # io/console + # io/nonblock + # io/wait +-# #json +-# json/generator +-# json/parser + # mathn/complex + # mathn/rational + # nkf |