source: EcnlProtoTool/trunk/mruby-1.3.0/tasks/mrbgems.rake@ 331

Last change on this file since 331 was 331, checked in by coas-nagasima, 6 years ago

prototoolに関連するプロジェクトをnewlibからmuslを使うよう変更・更新
ntshellをnewlibの下位の実装から、muslのsyscallの実装に変更・更新
以下のOSSをアップデート
・mruby-1.3.0
・musl-1.1.18
・onigmo-6.1.3
・tcc-0.9.27
以下のOSSを追加
・openssl-1.1.0e
・curl-7.57.0
・zlib-1.2.11
以下のmrbgemsを追加
・iij/mruby-digest
・iij/mruby-env
・iij/mruby-errno
・iij/mruby-iijson
・iij/mruby-ipaddr
・iij/mruby-mock
・iij/mruby-require
・iij/mruby-tls-openssl

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/x-ruby;charset=UTF-8
File size: 3.6 KB
Line 
1MRuby.each_target do
2 if enable_gems?
3 # set up all gems
4 gems.each(&:setup)
5 gems.check self
6
7 # loader all gems
8 self.libmruby << objfile("#{build_dir}/mrbgems/gem_init")
9 file objfile("#{build_dir}/mrbgems/gem_init") => ["#{build_dir}/mrbgems/gem_init.c", "#{build_dir}/LEGAL"]
10 file "#{build_dir}/mrbgems/gem_init.c" => [MRUBY_CONFIG, __FILE__] do |t|
11 FileUtils.mkdir_p "#{build_dir}/mrbgems"
12 open(t.name, 'w') do |f|
13 gem_func_gems = gems.select { |g| g.generate_functions }
14 gem_func_decls = gem_func_gems.each_with_object('') do |g, s|
15 s << "void GENERATED_TMP_mrb_#{g.funcname}_gem_init(mrb_state*);\n" \
16 "void GENERATED_TMP_mrb_#{g.funcname}_gem_final(mrb_state*);\n"
17 end
18 gem_init_calls = gem_func_gems.each_with_object('') do |g, s|
19 s << " GENERATED_TMP_mrb_#{g.funcname}_gem_init(mrb);\n"
20 end
21 gem_final_calls = gem_func_gems.each_with_object('') do |g, s|
22 s << " GENERATED_TMP_mrb_#{g.funcname}_gem_final(mrb);\n"
23 end
24 f.puts %Q[/*]
25 f.puts %Q[ * This file contains a list of all]
26 f.puts %Q[ * initializing methods which are]
27 f.puts %Q[ * necessary to bootstrap all gems.]
28 f.puts %Q[ *]
29 f.puts %Q[ * IMPORTANT:]
30 f.puts %Q[ * This file was generated!]
31 f.puts %Q[ * All manual changes will get lost.]
32 f.puts %Q[ */]
33 f.puts %Q[]
34 f.puts %Q[#include <mruby.h>]
35 f.puts %Q[]
36 f.write gem_func_decls
37 f.puts %Q[]
38 f.puts %Q[static void]
39 f.puts %Q[mrb_final_mrbgems(mrb_state *mrb) {]
40 f.write gem_final_calls
41 f.puts %Q[}]
42 f.puts %Q[]
43 f.puts %Q[void]
44 f.puts %Q[mrb_init_mrbgems(mrb_state *mrb) {]
45 f.write gem_init_calls
46 f.puts %Q[ mrb_state_atexit(mrb, mrb_final_mrbgems);] unless gem_final_calls.empty?
47 f.puts %Q[}]
48 end
49 end
50 end
51
52 # legal documents
53 file "#{build_dir}/LEGAL" => [MRUBY_CONFIG, __FILE__] do |t|
54 open(t.name, 'w+') do |f|
55 f.puts <<LEGAL
56Copyright (c) #{Time.now.year} mruby developers
57
58Permission is hereby granted, free of charge, to any person obtaining a
59copy of this software and associated documentation files (the "Software"),
60to deal in the Software without restriction, including without limitation
61the rights to use, copy, modify, merge, publish, distribute, sublicense,
62and/or sell copies of the Software, and to permit persons to whom the
63Software is furnished to do so, subject to the following conditions:
64
65The above copyright notice and this permission notice shall be included in
66all copies or substantial portions of the Software.
67
68THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
69IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
70FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
71AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
72LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
73FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
74DEALINGS IN THE SOFTWARE.
75LEGAL
76
77 if enable_gems?
78 f.puts <<GEMS_LEGAL
79
80Additional Licenses
81
82Due to the reason that you choosed additional mruby packages (GEMS),
83please check the following additional licenses too:
84GEMS_LEGAL
85
86 gems.map do |g|
87 authors = [g.authors].flatten.sort.join(", ")
88 f.puts
89 f.puts "GEM: #{g.name}"
90 f.puts "Copyright (c) #{Time.now.year} #{authors}"
91 f.puts "License: #{g.licenses}"
92 end
93 end
94 end
95 end
96end
Note: See TracBrowser for help on using the repository browser.