diff options
Diffstat (limited to 'ext')
-rw-r--r-- | ext/psych/extconf.rb | 8 | ||||
-rw-r--r-- | ext/psych/extlibs | 7 |
2 files changed, 15 insertions, 0 deletions
diff --git a/ext/psych/extconf.rb b/ext/psych/extconf.rb index 05e3f4a..02e0b7a 100644 --- a/ext/psych/extconf.rb +++ b/ext/psych/extconf.rb @@ -9,6 +9,14 @@ end yaml_source = with_config("libyaml-source-dir") || enable_config("bundled-libyaml", false) if yaml_source == true yaml_source = Dir.glob("#{$srcdir}/yaml{,-*}/").max_by {|n| File.basename(n).scan(/\d+/).map(&:to_i)} + unless yaml_source + require_relative '../../tool/extlibs.rb' + extlibs = ExtLibs.new(cache_dir: File.expand_path("../../tmp/download_cache", $srcdir)) + unless extlibs.process_under($srcdir) + raise "failed to download libyaml source" + end + yaml_source, = Dir.glob("#{$srcdir}/yaml-*/") + end elsif yaml_source yaml_source = yaml_source.gsub(/\$\((\w+)\)|\$\{(\w+)\}/) {ENV[$1||$2]} end diff --git a/ext/psych/extlibs b/ext/psych/extlibs new file mode 100644 index 0000000..b4ac02e --- /dev/null +++ b/ext/psych/extlibs @@ -0,0 +1,7 @@ +ver = 0.2.5 + +https://github.com/yaml/libyaml/releases/download/$(ver)/yaml-$(ver).tar.gz \ + rmd160:cc175ed640046722fb7790de828002633407b6b9 \ + sha256:c642ae9b75fee120b2d96c712538bd2cf283228d2337df2cf2988e3c02678ef4 \ + sha512:dadd7d8e0d88b5ebab005e5d521d56d541580198aa497370966b98c904586e642a1cd4f3881094eb57624f218d50db77417bbfd0ffdce50340f011e35e8c4c02 \ + # |