From c3891ab1b8b938b380dfdc29c4baa0aecb406617 Mon Sep 17 00:00:00 2001 From: ender672 Date: Fri, 27 Feb 2009 23:30:02 -0800 Subject: [PATCH] Modify fork of the new rubyinstaller repository to build shoes --- config/ruby_installer.rb | 157 ++++++++++++++++- rake/contrib/zip/zip.rb | 2 +- recipes/defaults.rake | 12 +- recipes/dependencies/glib.rake | 36 ++++ recipes/dependencies/libjpeg.rake | 36 ++++ .../libjpeg_patch.rake} | 14 +- recipes/dependencies/libpng.rake | 36 ++++ recipes/dependencies/libungif.rake | 36 ++++ recipes/dependencies/pango.rake | 36 ++++ recipes/dependencies/port_audio.rake | 75 ++++++++ recipes/dependencies/sqlite3.rake | 46 +++++ recipes/dependencies/winhttp.rake | 36 ++++ recipes/dependencies/zlib.rake | 24 +-- recipes/interpreter/ruby18.rake | 32 ++-- recipes/interpreter/ruby19.rake | 164 ++++++++++++++++++ recipes/shoes/shoes.rake | 27 +++ recipes/tools/rubygems.rake | 15 +- 17 files changed, 728 insertions(+), 56 deletions(-) create mode 100644 recipes/dependencies/glib.rake create mode 100644 recipes/dependencies/libjpeg.rake rename recipes/{interpreter/patch.rake => dependencies/libjpeg_patch.rake} (73%) create mode 100644 recipes/dependencies/libpng.rake create mode 100644 recipes/dependencies/libungif.rake create mode 100644 recipes/dependencies/pango.rake create mode 100644 recipes/dependencies/port_audio.rake create mode 100644 recipes/dependencies/sqlite3.rake create mode 100644 recipes/dependencies/winhttp.rake create mode 100644 recipes/interpreter/ruby19.rake create mode 100644 recipes/shoes/shoes.rake diff --git a/config/ruby_installer.rb b/config/ruby_installer.rb index cae52fc1..7edfdaab 100644 --- a/config/ruby_installer.rb +++ b/config/ruby_installer.rb @@ -55,20 +55,20 @@ module Version Ruby18 = OpenStruct.new( :release => "preview1", - :version => "1.8.6-p114", + :version => "1.8.7-p72", :url => "http://ftp.ruby-lang.org/pub/ruby/1.8", :checkout => 'http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8_6', :checkout_target => 'downloads/ruby_1_8', :target => 'sandbox/ruby_1_8', :build_target => 'sandbox/ruby_build', - :install_target => 'sandbox/ruby_mingw', + :install_target => RubyInstaller::MinGW.target, :configure_options => [ '--enable-shared', '--with-winsock2', '--disable-install-doc' ], :files => [ - 'ruby-1.8.6-p114.tar.bz2' + 'ruby-1.8.7-p72.tar.bz2' ], :dependencies => [ 'readline5.dll', @@ -80,14 +80,44 @@ module Version 'gdbm3.dll' ] ) - + + Ruby19 = OpenStruct.new( + :release => "p0", + :version => "1.9.1", + :url => "http://ftp.ruby-lang.org/pub/ruby/1.9", + :checkout => 'http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1', + :checkout_target => 'downloads/ruby_1_9', + :target => 'sandbox/ruby_1_9', + :build_target => 'sandbox/ruby_build_1_9', + :install_target => RubyInstaller::MinGW.target, + :configure_options => [ + '--enable-shared', + '--disable-install-doc', + "optflags='-O0'", + "debugflags='-g3 -ggdb'" + ], + :files => [ + 'ruby-1.9.1-p0.tar.bz2' + ], + :dependencies => [ + 'readline5.dll', + 'zlib1.dll', + 'libeay32.dll', + 'libssl32.dll', + 'libiconv2.dll', + 'pdcurses.dll', + 'gdbm3.dll' + ] + ) + Zlib = OpenStruct.new( - :release => "official", + :release => 'official', :version => "1.2.3", - :url => "http://www.zlib.net", + :url => "http://easynews.dl.sourceforge.net/gnuwin32", :target => RubyInstaller::MinGW.target, :files => [ - 'zlib123-dll.zip' + 'zlib-1.2.3-bin.zip', + 'zlib-1.2.3-lib.zip' ] ) @@ -161,7 +191,7 @@ module Version :checkout => 'svn://rubyforge.org/var/svn/rubygems/trunk', :checkout_target => 'downloads/rubygems', :target => 'sandbox/rubygems', - :install_target => 'sandbox/rubygems_mingw', + :install_target => RubyInstaller::MinGW.target, :configure_options => [ '--no-ri', '--no-rdoc' @@ -170,7 +200,118 @@ module Version 'rubygems-1.3.1.tgz' ] ) + + #Begin Shoes Dependencies + + Shoes = OpenStruct.new( + :release => 'raisins', + :version => 'r1134', + :url => 'http://shoooes.net/dist', + :checkout => 'git://github.com/ender672/shoes', + :checkout_target => 'sandbox/shoes', + :target => 'sandbox/shoes', + + :build_target => 'sandbox/shoes_build', + :install_target => 'sandbox/shoes_mingw', + :configure_options => [], + :files => [ + 'shoes2.tar.gz' + ] + ) + + Winhttp = OpenStruct.new( + :url => "http://www.holymonkey.com/shoes-packages", + :target => RubyInstaller::MinGW.target, + :files => ['winhttp.zip'] + ) + + Glib = OpenStruct.new( + :url => "http://ftp.gnome.org/pub/gnome/binaries/win32/glib/2.18", + :version => '2.18.4-1', + :target => RubyInstaller::MinGW.target, + :files => [ + 'glib-dev_2.18.4-1_win32.zip', + 'glib_2.18.4-1_win32.zip' + ] + ) + + LibUnGif = OpenStruct.new( + :url => "http://easynews.dl.sourceforge.net/gnuwin32", + :version => '', + :target => RubyInstaller::MinGW.target, + :files => [ + 'libungif-4.1.4-bin.zip', + 'libungif-4.1.4-lib.zip' + ] + ) + + Sqlite3 = OpenStruct.new( + :url => "http://www.sqlite.org", + :target => 'sandbox/sqlite3', + :files => [ + 'sqlitedll-3_6_11.zip', + 'sqlite-amalgamation-3_6_11.zip' + ] + ) + + PortAudio = OpenStruct.new( + :url => "http://www.portaudio.com/archives", + :target => 'sandbox/portaudio', + :install_target => RubyInstaller::MinGW.target, + :files => ['pa_snapshot.tgz'] + ) + + LibJpeg = OpenStruct.new( + :url => "http://easynews.dl.sourceforge.net/gnuwin32", + :version => '6b', + :target => RubyInstaller::MinGW.target, + :files => [ + 'libjpeg-6b-bin.zip', + 'libjpeg-6b-lib.zip' + ] + ) + LibJpegPatch = OpenStruct.new( + :url => "http://www.holymonkey.com/shoes-packages", + :target => "sandbox/lib_jpeg_patch", + :prepare_target => RubyInstaller::LibJpeg.target, + :files => [ + 'lib_jpeg_patch.zip' + ] + ) + + Cairo = OpenStruct.new( + :url => "http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies", + :version => '1.8.6-1', + :target => RubyInstaller::MinGW.target, + :files => [ + 'cairo-dev_1.8.6-1_win32.zip', + 'cairo_1.8.6-1_win32.zip' + ] + ) + + Pango = OpenStruct.new( + :url => "http://ftp.gnome.org/pub/gnome/binaries/win32/pango/1.22", + :version => '1.22.2-1', + :target => RubyInstaller::MinGW.target, + :files => [ + 'pango-dev_1.22.2-1_win32.zip', + 'pango_1.22.2-1_win32.zip' + ] + ) + + LibPng = OpenStruct.new( + :url => "http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/", + :version => '1.2.35-1', + :target => RubyInstaller::MinGW.target, + :files => [ + 'libpng_1.2.34-1_win32.zip', + 'libpng-dev_1.2.34-1_win32.zip' + ] + ) + + # End Shoes Dependencies + Wix = OpenStruct.new( :release => 'stable', :version => '2.0.5805.1', diff --git a/rake/contrib/zip/zip.rb b/rake/contrib/zip/zip.rb index 19d90f51..b780fb50 100644 --- a/rake/contrib/zip/zip.rb +++ b/rake/contrib/zip/zip.rb @@ -1,7 +1,7 @@ require 'delegate' require 'singleton' require 'tempfile' -require 'ftools' +require 'ftools' if RUBY_VERSION < '1.9' require 'stringio' require 'zlib' require 'zip/stdrubyext' diff --git a/recipes/defaults.rake b/recipes/defaults.rake index 4010bfd6..0cdbe2d8 100644 --- a/recipes/defaults.rake +++ b/recipes/defaults.rake @@ -25,7 +25,17 @@ task :check desc "Test drive the sandbox (using IRB)." task :irb -descr =[:download, :extract, :prepare, :configure, :compile, :install] +descr =[ + :download, + :extract, + :prepare, + :source_dependency_configure, + :source_dependency_compile, + :source_dependency_install, + :configure, + :compile, + :install +] desc "Do everything! #{descr.inspect}" task :default => descr diff --git a/recipes/dependencies/glib.rake b/recipes/dependencies/glib.rake new file mode 100644 index 00000000..73a74fe7 --- /dev/null +++ b/recipes/dependencies/glib.rake @@ -0,0 +1,36 @@ +require 'rake' +require 'rake/clean' + +namespace(:dependencies) do + namespace(:glib) do + package = RubyInstaller::Glib + directory package.target + CLEAN.include(package.target) + + # Put files for the :download task + package.files.each do |f| + file_source = "#{package.url}/#{f}" + file_target = "downloads/#{f}" + download file_target => file_source + + # depend on downloads directory + file file_target => "downloads" + + # download task need these files as pre-requisites + task :download => file_target + end + + # Prepare the :sandbox, it requires the :download task + task :extract => [:extract_utils, :download, package.target] do + # grab the files from the download task + files = Rake::Task['dependencies:glib:download'].prerequisites + + files.each { |f| + extract(File.join(RubyInstaller::ROOT, f), package.target) + } + end + end +end + +task :download => ['dependencies:glib:download'] +task :extract => ['dependencies:glib:extract'] diff --git a/recipes/dependencies/libjpeg.rake b/recipes/dependencies/libjpeg.rake new file mode 100644 index 00000000..317389a0 --- /dev/null +++ b/recipes/dependencies/libjpeg.rake @@ -0,0 +1,36 @@ +require 'rake' +require 'rake/clean' + +namespace(:dependencies) do + namespace(:libjpeg) do + package = RubyInstaller::LibJpeg + directory package.target + CLEAN.include(package.target) + + # Put files for the :download task + package.files.each do |f| + file_source = "#{package.url}/#{f}" + file_target = "downloads/#{f}" + download file_target => file_source + + # depend on downloads directory + file file_target => "downloads" + + # download task need these files as pre-requisites + task :download => file_target + end + + # Prepare the :sandbox, it requires the :download task + task :extract => [:extract_utils, :download, package.target] do + # grab the files from the download task + files = Rake::Task['dependencies:libjpeg:download'].prerequisites + + files.each { |f| + extract(File.join(RubyInstaller::ROOT, f), package.target) + } + end + end +end + +task :download => ['dependencies:libjpeg:download'] +task :extract => ['dependencies:libjpeg:extract'] diff --git a/recipes/interpreter/patch.rake b/recipes/dependencies/libjpeg_patch.rake similarity index 73% rename from recipes/interpreter/patch.rake rename to recipes/dependencies/libjpeg_patch.rake index ce5f5162..d9649b40 100644 --- a/recipes/interpreter/patch.rake +++ b/recipes/dependencies/libjpeg_patch.rake @@ -2,8 +2,8 @@ require 'rake' require 'rake/clean' namespace(:interpreter) do - namespace(:patch) do - package = RubyInstaller::Patches + namespace(:libjpeg_patch) do + package = RubyInstaller::LibJpegPatch directory package.target CLEAN.include(package.target) @@ -22,7 +22,7 @@ namespace(:interpreter) do task :extract => [:extract_utils, :download, package.target] do # grab the files from the download task - files = Rake::Task['interpreter:patch:download'].prerequisites + files = Rake::Task['interpreter:libjpeg_patch:download'].prerequisites files.each do |f| extract(File.join(RubyInstaller::ROOT, f), package.target) @@ -33,7 +33,7 @@ namespace(:interpreter) do glob = File.join(RubyInstaller::ROOT, package.target, '*.patch') cd package.prepare_target do Dir[glob].sort.each do |patch| - msys_sh "patch -p1 -f < #{patch}" + msys_sh "patch -p1 -t < #{patch}" end end end @@ -42,7 +42,7 @@ namespace(:interpreter) do end unless ENV['CHECKOUT'] - task :download => ['interpreter:patch:download'] - task :extract => ['interpreter:patch:extract'] - task :prepare => ['interpreter:patch:prepare'] + task :download => ['interpreter:libjpeg_patch:download'] + task :extract => ['interpreter:libjpeg_patch:extract'] + task :prepare => ['interpreter:libjpeg_patch:prepare'] end diff --git a/recipes/dependencies/libpng.rake b/recipes/dependencies/libpng.rake new file mode 100644 index 00000000..ab811730 --- /dev/null +++ b/recipes/dependencies/libpng.rake @@ -0,0 +1,36 @@ +require 'rake' +require 'rake/clean' + +namespace(:dependencies) do + namespace(:libpng) do + package = RubyInstaller::LibPng + directory package.target + CLEAN.include(package.target) + + # Put files for the :download task + package.files.each do |f| + file_source = "#{package.url}/#{f}" + file_target = "downloads/#{f}" + download file_target => file_source + + # depend on downloads directory + file file_target => "downloads" + + # download task need these files as pre-requisites + task :download => file_target + end + + # Prepare the :sandbox, it requires the :download task + task :extract => [:extract_utils, :download, package.target] do + # grab the files from the download task + files = Rake::Task['dependencies:libpng:download'].prerequisites + + files.each { |f| + extract(File.join(RubyInstaller::ROOT, f), package.target) + } + end + end +end + +task :download => ['dependencies:libpng:download'] +task :extract => ['dependencies:libpng:extract'] diff --git a/recipes/dependencies/libungif.rake b/recipes/dependencies/libungif.rake new file mode 100644 index 00000000..e84750a3 --- /dev/null +++ b/recipes/dependencies/libungif.rake @@ -0,0 +1,36 @@ +require 'rake' +require 'rake/clean' + +namespace(:dependencies) do + namespace(:libungif) do + package = RubyInstaller::LibUnGif + directory package.target + CLEAN.include(package.target) + + # Put files for the :download task + package.files.each do |f| + file_source = "#{package.url}/#{f}" + file_target = "downloads/#{f}" + download file_target => file_source + + # depend on downloads directory + file file_target => "downloads" + + # download task need these files as pre-requisites + task :download => file_target + end + + # Prepare the :sandbox, it requires the :download task + task :extract => [:extract_utils, :download, package.target] do + # grab the files from the download task + files = Rake::Task['dependencies:libungif:download'].prerequisites + + files.each { |f| + extract(File.join(RubyInstaller::ROOT, f), package.target) + } + end + end +end + +task :download => ['dependencies:libungif:download'] +task :extract => ['dependencies:libungif:extract'] diff --git a/recipes/dependencies/pango.rake b/recipes/dependencies/pango.rake new file mode 100644 index 00000000..85d5a8f9 --- /dev/null +++ b/recipes/dependencies/pango.rake @@ -0,0 +1,36 @@ +require 'rake' +require 'rake/clean' + +namespace(:dependencies) do + namespace(:pango) do + package = RubyInstaller::Pango + directory package.target + CLEAN.include(package.target) + + # Put files for the :download task + package.files.each do |f| + file_source = "#{package.url}/#{f}" + file_target = "downloads/#{f}" + download file_target => file_source + + # depend on downloads directory + file file_target => "downloads" + + # download task need these files as pre-requisites + task :download => file_target + end + + # Prepare the :sandbox, it requires the :download task + task :extract => [:extract_utils, :download, package.target] do + # grab the files from the download task + files = Rake::Task['dependencies:pango:download'].prerequisites + + files.each { |f| + extract(File.join(RubyInstaller::ROOT, f), package.target) + } + end + end +end + +task :download => ['dependencies:pango:download'] +task :extract => ['dependencies:pango:extract'] diff --git a/recipes/dependencies/port_audio.rake b/recipes/dependencies/port_audio.rake new file mode 100644 index 00000000..a9f3aa6d --- /dev/null +++ b/recipes/dependencies/port_audio.rake @@ -0,0 +1,75 @@ +require 'rake' +require 'rake/clean' + +namespace(:dependencies) do + namespace(:port_audio) do + package = RubyInstaller::PortAudio + extracted_files_target = File.join package.target, 'portaudio' + + directory extracted_files_target + directory package.install_target + CLEAN.include(package.target) + CLEAN.include(package.install_target) + + # Put files for the :download task + package.files.each do |f| + file_source = "#{package.url}/#{f}" + file_target = "downloads/#{f}" + download file_target => file_source + + # depend on downloads directory + file file_target => "downloads" + + # download task need these files as pre-requisites + task :download => file_target + end + + # Prepare the :sandbox, it requires the :download task + task :extract => [:extract_utils, :download, package.target] do + # grab the files from the download task + files = Rake::Task['dependencies:port_audio:download'].prerequisites + + files.each { |f| + extract(File.join(RubyInstaller::ROOT, f), package.target) + } + end + + makefile = File.join(extracted_files_target, 'Makefile') + configurescript = File.join(extracted_files_target, 'configure') + + file makefile => [ package.target, configurescript ] do + cd extracted_files_target do + msys_sh "configure --prefix=#{File.join(RubyInstaller::ROOT, package.install_target)}" + end + end + + task :configure => makefile + + task :compile => makefile do + cd extracted_files_target do + msys_sh "make" + end + end + + task :make_install => [package.install_target] do + cd extracted_files_target do + msys_sh "make install" + end + end + + task :install => [package.install_target] do + full_install_target = File.expand_path(File.join(RubyInstaller::ROOT, package.install_target)) + + # perform make install + cd extracted_files_target do + msys_sh "make install" + end + end + end +end + +task :download => ['dependencies:port_audio:download'] +task :extract => ['dependencies:port_audio:extract'] +task :source_dependency_configure => ['dependencies:port_audio:configure'] +task :source_dependency_compile => ['dependencies:port_audio:compile'] +task :source_dependency_install => ['dependencies:port_audio:make_install'] diff --git a/recipes/dependencies/sqlite3.rake b/recipes/dependencies/sqlite3.rake new file mode 100644 index 00000000..6ac7fe5d --- /dev/null +++ b/recipes/dependencies/sqlite3.rake @@ -0,0 +1,46 @@ +require 'rake' +require 'rake/clean' + +namespace(:dependencies) do + namespace(:sqlite3) do + package = RubyInstaller::Sqlite3 + directory package.target + CLEAN.include(package.target) + + # Put files for the :download task + package.files.each do |f| + file_source = "#{package.url}/#{f}" + file_target = "downloads/#{f}" + download file_target => file_source + + # depend on downloads directory + file file_target => "downloads" + + # download task need these files as pre-requisites + task :download => file_target + end + + # Prepare the :sandbox, it requires the :download task + task :extract => [:extract_utils, :download, package.target] do + # grab the files from the download task + files = Rake::Task['dependencies:sqlite3:download'].prerequisites + + files.each { |f| + extract(File.join(RubyInstaller::ROOT, f), package.target) + } + end + + task :prepare => [package.target] do + cp File.join(package.target, 'sqlite3.dll'), File.join(RubyInstaller::MinGW.target, 'bin') + cp File.join(package.target, 'sqlite3.h'), File.join(RubyInstaller::MinGW.target, 'include') + end + + task :link_dll => [:prepare] do + msys_sh "dlltool --dllname #{package.target}/sqlite3.dll --def #{package.target}/sqlite3.def --output-lib #{RubyInstaller::MinGW.target}/lib/sqlite3.lib" + end + end +end + +task :download => ['dependencies:sqlite3:download'] +task :extract => ['dependencies:sqlite3:extract'] +task :prepare => ['dependencies:sqlite3:prepare', 'dependencies:sqlite3:link_dll'] diff --git a/recipes/dependencies/winhttp.rake b/recipes/dependencies/winhttp.rake new file mode 100644 index 00000000..b9c06828 --- /dev/null +++ b/recipes/dependencies/winhttp.rake @@ -0,0 +1,36 @@ +require 'rake' +require 'rake/clean' + +namespace(:dependencies) do + namespace(:winhttp) do + package = RubyInstaller::Winhttp + directory package.target + CLEAN.include(package.target) + + # Put files for the :download task + package.files.each do |f| + file_source = "#{package.url}/#{f}" + file_target = "downloads/#{f}" + download file_target => file_source + + # depend on downloads directory + file file_target => "downloads" + + # download task need these files as pre-requisites + task :download => file_target + end + + # Prepare the :sandbox, it requires the :download task + task :extract => [:extract_utils, :download, package.target] do + # grab the files from the download task + files = Rake::Task['dependencies:winhttp:download'].prerequisites + + files.each { |f| + extract(File.join(RubyInstaller::ROOT, f), package.target) + } + end + end +end + +task :download => ['dependencies:winhttp:download'] +task :extract => ['dependencies:winhttp:extract'] diff --git a/recipes/dependencies/zlib.rake b/recipes/dependencies/zlib.rake index f33d5b13..ba293246 100644 --- a/recipes/dependencies/zlib.rake +++ b/recipes/dependencies/zlib.rake @@ -2,8 +2,7 @@ require 'rake' require 'rake/clean' namespace(:dependencies) do - namespace(:zlib) do - # zlib needs mingw and downloads + namespace(:libzlib) do package = RubyInstaller::Zlib directory package.target CLEAN.include(package.target) @@ -24,29 +23,14 @@ namespace(:dependencies) do # Prepare the :sandbox, it requires the :download task task :extract => [:extract_utils, :download, package.target] do # grab the files from the download task - files = Rake::Task['dependencies:zlib:download'].prerequisites + files = Rake::Task['dependencies:libzlib:download'].prerequisites files.each { |f| extract(File.join(RubyInstaller::ROOT, f), package.target) } end - - task :prepare => [package.target] do - # zlib needs some relocation of files - # remove test/*.exe - # remove *.txt - # move zlib1.dll to bin - cd File.join(RubyInstaller::ROOT, package.target) do - rm_rf "test" - Dir.glob("*.txt").each do |path| - rm_f path - end - mv "zlib1.dll", "bin" - end - end end end -task :download => ['dependencies:zlib:download'] -task :extract => ['dependencies:zlib:extract'] -task :prepare => ['dependencies:zlib:prepare'] +task :download => ['dependencies:libzlib:download'] +task :extract => ['dependencies:libzlib:extract'] diff --git a/recipes/interpreter/ruby18.rake b/recipes/interpreter/ruby18.rake index 5c284f30..455bec38 100644 --- a/recipes/interpreter/ruby18.rake +++ b/recipes/interpreter/ruby18.rake @@ -84,6 +84,12 @@ namespace(:interpreter) do end end + task :make_install => [package.install_target] do + cd package.build_target do + msys_sh "make install" + end + end + task :install => [package.install_target] do full_install_target = File.expand_path(File.join(RubyInstaller::ROOT, package.install_target)) @@ -137,15 +143,17 @@ namespace(:interpreter) do end end -if ENV['CHECKOUT'] - task :download => ['interpreter:ruby18:checkout'] -else - task :download => ['interpreter:ruby18:download'] -end -task :extract => ['interpreter:ruby18:extract'] -task :prepare => ['interpreter:ruby18:prepare'] -task :configure => ['interpreter:ruby18:configure'] -task :compile => ['interpreter:ruby18:compile'] -task :install => ['interpreter:ruby18:install'] -task :check => ['interpreter:ruby18:check'] -task :irb => ['interpreter:ruby18:irb'] +if ENV['RUBY18'] + if ENV['CHECKOUT'] + task :download => ['interpreter:ruby18:checkout'] + else + task :download => ['interpreter:ruby18:download'] + end + task :extract => ['interpreter:ruby18:extract'] + task :prepare => ['interpreter:ruby18:prepare'] + task :source_dependency_configure => ['interpreter:ruby18:configure'] + task :source_dependency_compile => ['interpreter:ruby18:compile'] + task :source_dependency_install => ['interpreter:ruby18:make_install'] + task :check => ['interpreter:ruby18:check'] + task :irb => ['interpreter:ruby18:irb'] +end \ No newline at end of file diff --git a/recipes/interpreter/ruby19.rake b/recipes/interpreter/ruby19.rake new file mode 100644 index 00000000..a2fb3b66 --- /dev/null +++ b/recipes/interpreter/ruby19.rake @@ -0,0 +1,164 @@ +require 'rake' +require 'rake/clean' + +namespace(:interpreter) do + namespace(:ruby19) do + package = RubyInstaller::Ruby19 + directory package.target + directory package.build_target + directory package.install_target + CLEAN.include(package.target) + CLEAN.include(package.build_target) + CLEAN.include(package.install_target) + + # Put files for the :download task + package.files.each do |f| + file_source = "#{package.url}/#{f}" + file_target = "downloads/#{f}" + download file_target => file_source + + # depend on downloads directory + file file_target => "downloads" + + # download task need these files as pre-requisites + task :download => file_target + end + + task :checkout => "downloads" do + cd RubyInstaller::ROOT do + # If is there already a checkout, update instead of checkout" + if File.exist?(File.join(RubyInstaller::ROOT, package.checkout_target, '.svn')) + sh "svn update #{package.checkout_target}" + else + sh "svn co #{package.checkout} #{package.checkout_target}" + end + end + end + + task :extract => [:extract_utils, package.target] do + # grab the files from the download task + files = Rake::Task['interpreter:ruby19:download'].prerequisites + + # use the checkout copy instead of the packaged file + unless ENV['CHECKOUT'] + files.each { |f| + extract(File.join(RubyInstaller::ROOT, f), package.target) + } + else + cp_r(package.checkout_target, File.join(RubyInstaller::ROOT, 'sandbox'), :verbose => true, :remove_destination => true) + end + end + ENV['CHECKOUT'] ? task(:extract => :checkout) : task(:extract => :download) + + task :prepare => [package.build_target] do + cd RubyInstaller::ROOT do + cp_r(Dir.glob('resources/icons/*.ico'), package.build_target, :verbose => true) + end + + # FIXME: Readline is not working, remove it for now. + cd package.target do + rm_f 'test/readline/test_readline.rb' + end + end + + makefile = File.join(package.build_target, 'Makefile') + configurescript = File.join(package.target, 'configure') + + file configurescript => [ package.target ] do + cd package.target do + msys_sh "autoconf" + end + end + + file makefile => [ package.build_target, configurescript ] do + cd package.build_target do + msys_sh "../ruby_1_9/configure #{package.configure_options.join(' ')} --enable-shared --prefix=#{File.join(RubyInstaller::ROOT, package.install_target)}" + end + end + + task :configure => makefile + + task :compile => makefile do + cd package.build_target do + msys_sh "make" + end + end + + task :make_install => [package.install_target] do + cd package.build_target do + msys_sh "make install" + end + cd package.target do + %w{rake gem irb}.each do |s| + cp File.join('bin', s), File.join(RubyInstaller::ROOT, RubyInstaller::MinGW.target, 'bin') + end + end + end + + task :install => [package.install_target] do + full_install_target = File.expand_path(File.join(RubyInstaller::ROOT, package.install_target)) + + # perform make install + cd package.build_target do + msys_sh "make install" + end + + # verbatim copy the binaries listed in package.dependencies + package.dependencies.each do |dep| + Dir.glob("#{RubyInstaller::MinGW.target}/**/#{dep}").each do |path| + cp path, File.join(package.install_target, "bin") + end + end + + # copy original scripts from ruby_1_9 to install_target + Dir.glob("#{package.target}/bin/*").each do |path| + cp path, File.join(package.install_target, "bin") + end + + # remove path reference to sandbox (after install!!!) + rbconfig = File.join(package.install_target, 'lib/ruby/1.9.1/i386-mingw32/rbconfig.rb') + contents = File.read(rbconfig).gsub(/#{Regexp.escape(full_install_target)}/) { |match| "" } + File.open(rbconfig, 'w') { |f| f.write(contents) } + end + + # makes the installed ruby the first in the path and use if for the tests! + task :check do + new_ruby = File.join(RubyInstaller::ROOT, package.install_target, "bin").gsub(File::SEPARATOR, File::ALT_SEPARATOR) + ENV['PATH'] = "#{new_ruby};#{ENV['PATH']}" + cd package.build_target do + msys_sh "make check" + end + end + + task :manifest do + manifest = File.open(File.join(package.build_target, "manifest"), 'w') + cd package.install_target do + Dir.glob("**/*").each do |f| + manifest.puts(f) unless File.directory?(f) + end + end + manifest.close + end + + task :irb do + cd File.join(package.install_target, 'bin') do + sh "irb" + end + end + end +end + +unless ENV['RUBY18'] + if ENV['CHECKOUT'] + task :download => ['interpreter:ruby19:checkout'] + else + task :download => ['interpreter:ruby19:download'] + end + task :extract => ['interpreter:ruby19:extract'] + task :prepare => ['interpreter:ruby19:prepare'] + task :source_dependency_configure => ['interpreter:ruby19:configure'] + task :source_dependency_compile => ['interpreter:ruby19:compile'] + task :source_dependency_install => ['interpreter:ruby19:make_install'] + task :check => ['interpreter:ruby19:check'] + task :irb => ['interpreter:ruby19:irb'] +end diff --git a/recipes/shoes/shoes.rake b/recipes/shoes/shoes.rake new file mode 100644 index 00000000..95d87f15 --- /dev/null +++ b/recipes/shoes/shoes.rake @@ -0,0 +1,27 @@ +require 'rake' +require 'rake/clean' + +namespace(:interpreter) do + namespace(:shoes) do + package = RubyInstaller::Shoes + + task :checkout do + # If is there already a checkout, update instead of checkout" + if File.exist?(File.join(RubyInstaller::ROOT, package.checkout_target, '.git')) + cd File.join(RubyInstaller::ROOT, package.checkout_target) do + sh "git pull" + end + else + cd RubyInstaller::ROOT do + sh "git clone #{package.checkout} #{package.checkout_target}" + end + end + end + + task :compile do + cd File.join(RubyInstaller::ROOT, package.target) do + msys_sh "rake --trace" + end + end + end +end diff --git a/recipes/tools/rubygems.rake b/recipes/tools/rubygems.rake index edb3330a..f3f03ad1 100644 --- a/recipes/tools/rubygems.rake +++ b/recipes/tools/rubygems.rake @@ -95,11 +95,12 @@ TEXT end end - -if ENV['CHECKOUT'] - task :download => ['tools:rubygems:checkout'] -else - task :download => ['tools:rubygems:download'] +if ENV['RUBY18'] + if ENV['CHECKOUT'] + task :download => ['tools:rubygems:checkout'] + else + task :download => ['tools:rubygems:download'] + end + task :extract => ['tools:rubygems:extract'] + task :install => ['tools:rubygems:install'] end -task :extract => ['tools:rubygems:extract'] -task :install => ['tools:rubygems:install']