diff options
author | Marek Szuba <marecki@gentoo.org> | 2020-11-13 22:51:12 +0100 |
---|---|---|
committer | Marek Szuba <marecki@gentoo.org> | 2020-11-13 22:54:31 +0100 |
commit | b88f37ce277c6d9ea1d55296f723b882addd27ca (patch) | |
tree | 1e06ed10a63fac8679da4fcd03c3bc652179c6ee /dev-ruby/duktape-rb/files | |
parent | sys-apps/acl: Stabilize 2.2.53-r1 amd64, #753347 (diff) | |
download | gentoo-b88f37ce277c6d9ea1d55296f723b882addd27ca.tar.gz gentoo-b88f37ce277c6d9ea1d55296f723b882addd27ca.tar.bz2 gentoo-b88f37ce277c6d9ea1d55296f723b882addd27ca.zip |
dev-ruby/duktape-rb: use system dev-lang/duktape
Signed-off-by: Marek Szuba <marecki@gentoo.org>
Diffstat (limited to 'dev-ruby/duktape-rb/files')
-rw-r--r-- | dev-ruby/duktape-rb/files/duktape-rb-2.3.0.0_duktape-2.5.0-tests.patch | 28 | ||||
-rw-r--r-- | dev-ruby/duktape-rb/files/duktape-rb-2.3.0.0_use-system-duktape.patch | 79 |
2 files changed, 107 insertions, 0 deletions
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' |