From d934827bf44b7cfcf6711964418148fa60877668 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Wed, 25 Nov 2020 22:39:15 +0000 Subject: gentoo resync : 25.11.2020 --- .../duktape-rb-2.3.0.0_duktape-2.5.0-tests.patch | 28 ++++++++ .../duktape-rb-2.3.0.0_use-system-duktape.patch | 79 ++++++++++++++++++++++ 2 files changed, 107 insertions(+) create mode 100644 dev-ruby/duktape-rb/files/duktape-rb-2.3.0.0_duktape-2.5.0-tests.patch create mode 100644 dev-ruby/duktape-rb/files/duktape-rb-2.3.0.0_use-system-duktape.patch (limited to 'dev-ruby/duktape-rb/files') diff --git a/dev-ruby/duktape-rb/files/duktape-rb-2.3.0.0_duktape-2.5.0-tests.patch b/dev-ruby/duktape-rb/files/duktape-rb-2.3.0.0_duktape-2.5.0-tests.patch new file mode 100644 index 000000000000..20228c480da8 --- /dev/null +++ b/dev-ruby/duktape-rb/files/duktape-rb-2.3.0.0_duktape-2.5.0-tests.patch @@ -0,0 +1,28 @@ +The parse-error message asserted by two of the tests has changed since +duktape-2.3.0, it is now + +# encoding: ASCII-8BIT +parse error (line 1, end of input) + +This should hopefully cover both cases. + +--- a/test/test_duktape.rb ++++ b/test/test_duktape.rb +@@ -102,7 +102,7 @@ + @ctx.eval_string('{') + end + +- assert_equal "parse error (line 1)", err.message ++ assert_match /parse error [(]line 1/, err.message + end + + def test_type_error +@@ -160,7 +160,7 @@ + @ctx.exec_string('{') + end + +- assert_equal "parse error (line 1)", err.message ++ assert_match /parse error [(]line 1/, err.message + end + + def test_type_error diff --git a/dev-ruby/duktape-rb/files/duktape-rb-2.3.0.0_use-system-duktape.patch b/dev-ruby/duktape-rb/files/duktape-rb-2.3.0.0_use-system-duktape.patch new file mode 100644 index 000000000000..9f35293c9e81 --- /dev/null +++ b/dev-ruby/duktape-rb/files/duktape-rb-2.3.0.0_use-system-duktape.patch @@ -0,0 +1,79 @@ +--- a/MANIFEST.txt ++++ b/MANIFEST.txt +@@ -1,9 +1,6 @@ + README.md + CHANGELOG.md +-ext/duktape/duktape.c +-ext/duktape/duktape.h + ext/duktape/duktape_ext.c +-ext/duktape/duk_config.h + ext/duktape/extconf.rb + lib/duktape/version.rb + lib/duktape.rb +--- a/ext/duktape/extconf.rb ++++ b/ext/duktape/extconf.rb +@@ -1,6 +1,64 @@ + require 'mkmf' + require 'zlib' + ++# ++# functions ++# ++ ++def package_config pkg, options={} ++ package = pkg_config(pkg) ++ return package if package ++ ++ begin ++ require 'rubygems' ++ gem 'pkg-config', (gem_ver='~> 1.1') ++ require 'pkg-config' and message("Using pkg-config gem version #{PKGConfig::VERSION}\n") ++ rescue LoadError ++ message "pkg-config could not be used to find #{pkg}\nPlease install either `pkg-config` or the pkg-config gem per\n\n gem install pkg-config -v #{gem_ver.inspect}\n\n" ++ else ++ return nil unless PKGConfig.have_package(pkg) ++ ++ cflags = PKGConfig.cflags(pkg) ++ ldflags = PKGConfig.libs_only_L(pkg) ++ libs = PKGConfig.libs_only_l(pkg) ++ ++ Logging::message "PKGConfig package configuration for %s\n", pkg ++ Logging::message "cflags: %s\nldflags: %s\nlibs: %s\n\n", cflags, ldflags, libs ++ ++ [cflags, ldflags, libs] ++ end ++end ++ ++def duktape_try_compile ++ try_compile "int main() {return 0;}", "", {werror: true} ++end ++ ++def add_cflags(flags) ++ print "checking if the C compiler accepts #{flags}... " ++ with_cflags("#{$CFLAGS} #{flags}") do ++ if duktape_try_compile ++ puts 'yes' ++ true ++ else ++ puts 'no' ++ false ++ end ++ end ++end ++ ++# ++# main ++# ++ ++if ENV['CC'] ++ RbConfig::CONFIG['CC'] = RbConfig::MAKEFILE_CONFIG['CC'] = ENV['CC'] ++end ++$LIBS << " #{ENV["LIBS"]}" ++$LDFLAGS << " #{ENV["LDFLAGS"]}" ++add_cflags(ENV["CFLAGS"]) ++ ++package_config('duktape') ++ + $CFLAGS += ' -std=c99' + have_func 'rb_sym2str' + create_makefile 'duktape_ext' -- cgit v1.2.3