diff options
author | Kazuki Yamaguchi <k@rhe.jp> | 2016-04-04 16:07:50 +0900 |
---|---|---|
committer | Kazuki Yamaguchi <k@rhe.jp> | 2016-04-04 16:07:50 +0900 |
commit | 6d3818266cb43e377975f082d66f2de268f1b366 (patch) | |
tree | 496145ef91e43a188fe8ed7796af7cfd69a18384 | |
parent | 38feec14a51ef6b5f32960256e3d5ee87cf5b0da (diff) | |
download | poe-6d3818266cb43e377975f082d66f2de268f1b366.tar.gz |
rakefile: RVM のパッチセットを流用することにした
-rw-r--r-- | .gitmodules | 3 | ||||
-rw-r--r-- | Rakefile | 15 | ||||
-rw-r--r-- | config.json | 7 | ||||
m--------- | vendor/rvm | 0 |
4 files changed, 25 insertions, 0 deletions
diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..c1beb0e --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "vendor/rvm"] + path = vendor/rvm + url = https://github.com/rvm/rvm.git @@ -49,6 +49,21 @@ namespace :compiler do system("curl -o archive.tar.gz #{Shellwords.escape(url)}") or raise("failed to download") system("tar xf archive.tar.gz") or raise("failed to extract") FileUtils.chdir("ruby-#{version}") { + patch_ccnames = ["ruby", "ruby/#{version.split("-")[0]}", "ruby/#{version.split("-").join("/")}"] + patch_ccnames.each { |patch_ccname| + rvm_patchsets_path = File.expand_path("../vendor/rvm/patchsets/#{patch_ccname}/default", __FILE__) + if File.exist?(rvm_patchsets_path) + puts "RVM patchset found (#{patch_ccname})... applying..." + patches = File.read(rvm_patchsets_path).lines.map(&:chomp) + patches.each { |patch| + patch_path = patch_ccnames + .map { |pp| File.expand_path("../vendor/rvm/patches/#{pp}/#{patch}.patch", __FILE__) } + .find(&File.method(:exist?)) + patch_path and system("patch -R -p1 --silent --dry-run <#{patch_path} || patch -p1 <#{patch_path}") or + raise("failed to apply patch") + } + end + } retriable { system("./configure --prefix=#{prefix} --enable-shared --disable-install-doc") or raise("failed to configure") system("make -j6") or raise("failed to make") diff --git a/config.json b/config.json index b53e0c3..43655e0 100644 --- a/config.json +++ b/config.json @@ -23,6 +23,13 @@ "/opt/bin/ruby", "{}" ] + }, + "ruby-1.9.3-p551": { + "version": "ruby 1.9.3p551 (2014-11-13 revision 48407) [x86_64-linux]", + "commandline": [ + "/opt/bin/ruby", + "{}" + ] } }, "php": { diff --git a/vendor/rvm b/vendor/rvm new file mode 160000 +Subproject cbc4488028ccc682a872034ba823f61bf2d9cf6 |