Permalink
Browse files

Merge branch 'master' of ender672/shoes (commit b68487f) into work

Resolved the following conflicts:
	req/sqlite3/ext/sqlite3_api/sqlite3_api_wrap.c
	shoes/config.h
	shoes/http/windownload.c
	shoes/native/windows.c
  • Loading branch information...
2 parents aadcefd + b68487f commit f870a09a56722cd3e428baa407d238071a13adf8 @ashbb ashbb committed Jan 23, 2010
Showing with 2,851 additions and 4,625 deletions.
  1. +54 −9 Rakefile
  2. +9 −1 bin/main.skel
  3. +3 −1 lib/shoes/log.rb
  4. +8 −2 req/binject/ext/binject_c/binject.c
  5. +7 −2 req/ftsearch/ext/ftsearchrt/ftsearch.c
  6. BIN req/rubygems/._ubygems.rb
  7. BIN req/rubygems/rbconfig/._datadir.rb
  8. +23 −13 req/rubygems/rubygems.rb
  9. BIN req/rubygems/rubygems/._builder.rb
  10. BIN req/rubygems/rubygems/._command.rb
  11. BIN req/rubygems/rubygems/._command_manager.rb
  12. BIN req/rubygems/rubygems/._dependency.rb
  13. BIN req/rubygems/rubygems/._dependency_list.rb
  14. BIN req/rubygems/rubygems/._exceptions.rb
  15. BIN req/rubygems/rubygems/._ext.rb
  16. BIN req/rubygems/rubygems/._format.rb
  17. BIN req/rubygems/rubygems/._gem_openssl.rb
  18. BIN req/rubygems/rubygems/._gem_runner.rb
  19. BIN req/rubygems/rubygems/._install_update_options.rb
  20. BIN req/rubygems/rubygems/._old_format.rb
  21. BIN req/rubygems/rubygems/._package.rb
  22. BIN req/rubygems/rubygems/._require_paths_builder.rb
  23. BIN req/rubygems/rubygems/._requirement.rb
  24. BIN req/rubygems/rubygems/._security.rb
  25. BIN req/rubygems/rubygems/._server.rb
  26. BIN req/rubygems/rubygems/._source_info_cache_entry.rb
  27. BIN req/rubygems/rubygems/._timer.rb
  28. BIN req/rubygems/rubygems/._user_interaction.rb
  29. BIN req/rubygems/rubygems/._version.rb
  30. BIN req/rubygems/rubygems/._version_option.rb
  31. BIN req/rubygems/rubygems/commands/._build_command.rb
  32. BIN req/rubygems/rubygems/commands/._cert_command.rb
  33. BIN req/rubygems/rubygems/commands/._cleanup_command.rb
  34. BIN req/rubygems/rubygems/commands/._dependency_command.rb
  35. BIN req/rubygems/rubygems/commands/._fetch_command.rb
  36. BIN req/rubygems/rubygems/commands/._help_command.rb
  37. BIN req/rubygems/rubygems/commands/._list_command.rb
  38. BIN req/rubygems/rubygems/commands/._mirror_command.rb
  39. BIN req/rubygems/rubygems/commands/._search_command.rb
  40. BIN req/rubygems/rubygems/commands/._server_command.rb
  41. BIN req/rubygems/rubygems/commands/._sources_command.rb
  42. BIN req/rubygems/rubygems/commands/._stale_command.rb
  43. BIN req/rubygems/rubygems/commands/._uninstall_command.rb
  44. BIN req/rubygems/rubygems/commands/._which_command.rb
  45. +2 −1 req/rubygems/rubygems/commands/check_command.rb
  46. +1 −1 req/rubygems/rubygems/commands/unpack_command.rb
  47. +4 −5 req/rubygems/rubygems/commands/update_command.rb
  48. +4 −1 req/rubygems/rubygems/config_file.rb
  49. +15 −7 req/rubygems/rubygems/custom_require.rb
  50. +5 −0 req/rubygems/rubygems/defaults.rb
  51. BIN req/rubygems/rubygems/digest/._digest_adapter.rb
  52. BIN req/rubygems/rubygems/digest/._md5.rb
  53. BIN req/rubygems/rubygems/digest/._sha1.rb
  54. BIN req/rubygems/rubygems/digest/._sha2.rb
  55. BIN req/rubygems/rubygems/ext/._configure_builder.rb
  56. BIN req/rubygems/rubygems/ext/._ext_conf_builder.rb
  57. BIN req/rubygems/rubygems/ext/._rake_builder.rb
  58. +1 −1 req/rubygems/rubygems/installer.rb
  59. BIN req/rubygems/rubygems/package/._f_sync_dir.rb
  60. BIN req/rubygems/rubygems/package/._tar_header.rb
  61. BIN req/rubygems/rubygems/package/._tar_input.rb
  62. BIN req/rubygems/rubygems/package/._tar_output.rb
  63. BIN req/rubygems/rubygems/package/._tar_reader.rb
  64. BIN req/rubygems/rubygems/package/._tar_writer.rb
  65. BIN req/rubygems/rubygems/package/tar_reader/._entry.rb
  66. +1 −1 req/rubygems/rubygems/rubygems_version.rb
  67. +1 −2 req/rubygems/rubygems/source_index.rb
  68. +147 −125 req/rubygems/rubygems/validator.rb
  69. +1,874 −3,790 req/sqlite3/ext/sqlite3_api/sqlite3_api_wrap.c
  70. +267 −267 samples/expert-minesweeper.rb
  71. +174 −174 samples/good-reminder.rb
  72. +6 −1 shoes/config.h
  73. +1 −0 shoes/http.h
  74. +6 −8 shoes/http/curl.c
  75. +5 −5 shoes/http/nsurl.m
  76. +1 −0 shoes/http/windownload.c
  77. +6 −0 shoes/image.c
  78. +1 −1 shoes/internal.c
  79. +1 −1 shoes/internal.h
  80. +20 −16 shoes/native/windows.c
  81. +15 −1 shoes/ruby.c
  82. +1 −1 shoes/ruby.h
  83. +188 −188 static/code_highlighter.js
View
@@ -55,6 +55,15 @@ def env(x)
ENV[x]
end
+# Execute shell calls through bash if we are compiling with mingw. This breaks us
+# out of the windows command shell if we are compiling from there.
+if RUBY_PLATFORM =~ /mingw/
+ def sh(*args)
+ cmd = args.join(' ')
+ super "bash.exe --login -i -c \"#{cmd}\""
+ end
+end
+
# Subs in special variables
def rewrite before, after, reg = /\#\{(\w+)\}/, reg2 = '\1'
File.open(after, 'w') do |a|
@@ -85,6 +94,11 @@ def copy_ext xdir, libdir
# `ruby extconf.rb; make`
# end
copy_files "#{xdir}/*.bundle", libdir
+ when /mingw/
+ Dir.chdir(xdir) do
+ sh 'ruby extconf.rb; make'
+ end
+ copy_files "#{xdir}/*.so", libdir
else
Dir.chdir(xdir) do
unless system "ruby", "extconf.rb" and system "make"
@@ -132,7 +146,7 @@ task :build => [:build_os, "dist/VERSION.txt"] do
rm_rf "dist/ruby/lib/#{libn}"
end
end
- %w[req/rubygems/* req/ftsearch/lib/*].each do |rdir|
+ %w[req/rubygems/* req/ftsearch/lib/* req/rake/lib/*].each do |rdir|
FileList[rdir].each { |rlib| cp_r rlib, "dist/ruby/lib" }
end
%w[req/binject/ext/binject_c req/ftsearch/ext/ftsearchrt req/bloopsaphone/ext/bloops].
@@ -166,6 +180,16 @@ task :build => [:build_os, "dist/VERSION.txt"] do
if ENV['VIDEO']
copy_files "deps/vlc/bin/*", "dist/"
end
+ when /mingw/
+ dlls = [ruby_so]
+ dlls += %w{libungif4 libjpeg libcairo-2 libpng12-0 libglib-2.0-0 libgobject-2.0-0 libpango-1.0-0
+ libgmodule-2.0-0 libpangocairo-1.0-0 libpangowin32-1.0-0 libportaudio-2 sqlite3 libssl32 libeay32}
+ dlls.each{|dll| cp "#{ext_ruby}/bin/#{dll}.dll", "dist/"}
+ if ENV['VIDEO']
+ cp "/usr/lib/libvlc.so", "dist"
+ ln_s "libvlc.so", "dist/libvlc.so.0"
+ end
+ sh "strip -x dist/*.dll" unless ENV['DEBUG']
when /darwin/
if ENV['SHOES_DEPS_PATH']
dylibs = %w[lib/libcairo.2.dylib lib/libpixman-1.0.dylib lib/libgmodule-2.0.0.dylib lib/libintl.8.dylib lib/libruby.dylib
@@ -375,24 +399,39 @@ else
require 'rbconfig'
CC = "gcc"
- SRC = FileList["shoes/*.c",
- RUBY_PLATFORM =~ /darwin/ ? "shoes/native/cocoa.m" : "shoes/native/gtk.c",
- RUBY_PLATFORM =~ /darwin/ ? "shoes/http/nsurl.m" : "shoes/http/curl.c"]
+ file_list = ["shoes/*.c"] + case RUBY_PLATFORM
+ when /mingw/
+ %w{shoes/native/windows.c shoes/http/winhttp.c shoes/http/windownload.c}
+ when /darwin/
+ %w{shoes/native/cocoa.m shoes/http/nsurl.m}
+ else
+ %w{shoes/native/gtk.c shoes/http/curl.c}
+ end
+ SRC = FileList[*file_list]
OBJ = SRC.map do |x|
x.gsub(/\.\w+$/, '.o')
end
# Linux build environment
- CAIRO_CFLAGS = ENV['CAIRO_CFLAGS'] || `pkg-config --cflags cairo`.strip
- CAIRO_LIB = ENV['CAIRO_LIB'] ? "-L#{ENV['CAIRO_LIB']}" : `pkg-config --libs cairo`.strip
- PANGO_CFLAGS = ENV['PANGO_CFLAGS'] || `pkg-config --cflags pango`.strip
- PANGO_LIB = ENV['PANGO_LIB'] ? "-L#{ENV['PANGO_LIB']}" : `pkg-config --libs pango`.strip
+ if RUBY_PLATFORM =~ /mingw/
+ CAIRO_CFLAGS = '-I/mingw/include/glib-2.0 -I/mingw/lib/glib-2.0/include -I/mingw/include/cairo'
+ CAIRO_LIB = '-lcairo'
+ PANGO_CFLAGS = '-I/mingw/include/pango-1.0'
+ PANGO_LIB = '-lpangocairo-1.0 -lpango-1.0'
+ png_lib = 'png12'
+ else
+ CAIRO_CFLAGS = ENV['CAIRO_CFLAGS'] || `pkg-config --cflags cairo`.strip
+ CAIRO_LIB = ENV['CAIRO_LIB'] ? "-L#{ENV['CAIRO_LIB']}" : `pkg-config --libs cairo`.strip
+ PANGO_CFLAGS = ENV['PANGO_CFLAGS'] || `pkg-config --cflags pango`.strip
+ PANGO_LIB = ENV['PANGO_LIB'] ? "-L#{ENV['PANGO_LIB']}" : `pkg-config --libs pango`.strip
+ png_lib = 'png'
+ end
LINUX_CFLAGS = %[-Wall -I#{ENV['SHOES_DEPS_PATH'] || "/usr"}/include #{CAIRO_CFLAGS} #{PANGO_CFLAGS} -I#{Config::CONFIG['archdir']}]
if Config::CONFIG['rubyhdrdir']
LINUX_CFLAGS << " -I#{Config::CONFIG['rubyhdrdir']} -I#{Config::CONFIG['rubyhdrdir']}/#{RUBY_PLATFORM}"
end
- LINUX_LIB_NAMES = %W[#{ruby_so} png cairo pangocairo-1.0 ungif]
+ LINUX_LIB_NAMES = %W[#{ruby_so} #{png_lib} cairo pangocairo-1.0 ungif]
FLAGS.each do |flag|
LINUX_CFLAGS << " -D#{flag}" if ENV[flag]
end
@@ -423,6 +462,12 @@ else
LINUX_LDFLAGS << " -arch ppc"
ENV['MACOSX_DEPLOYMENT_TARGET'] = '10.4'
end
+ when /mingw/
+ DLEXT = 'dll'
+ LINUX_CFLAGS << ' -I. -I/mingw/include -I/mingw/include/ruby-1.9.1/ruby'
+ LINUX_CFLAGS << " -DXMD_H -DHAVE_BOOLEAN -DSHOES_WIN32 -D_WIN32_IE=0x0500 -D_WIN32_WINNT=0x0500 -DWINVER=0x0500 -DCOBJMACROS"
+ LINUX_LDFLAGS =" -DBUILD_DLL -lungif -ljpeg -lglib-2.0 -lgobject-2.0 -fPIC -shared"
+ LINUX_LDFLAGS << ' -lshell32 -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lcomctl32 -lole32 -loleaut32 -ladvapi32 -loleacc -lwinhttp'
else
DLEXT = "so"
LINUX_CFLAGS << " -DSHOES_GTK -fPIC #{`pkg-config --cflags gtk+-2.0`.strip} #{`curl-config --cflags`.strip}"
View
@@ -38,9 +38,14 @@ main(argc, argv)
#ifdef SHOES_WIN32
path = SHOE_ALLOC_N(char, SHOES_BUFSIZE);
GetModuleFileName(NULL, (LPSTR)path, SHOES_BUFSIZE);
- code = shoes_init(inst, style);
+#ifdef RUBY_1_9
+ rb_w32_sysinit(&argc, &argv);
+#else
+ NtInitialize(&argc, &argv);
+#endif
#else
path = argv[0];
+#endif
if (argc > 1 && strcmp(argv[1], "--ruby") == 0)
{
char bootup[SHOES_BUFSIZE];
@@ -76,6 +81,9 @@ main(argc, argv)
}
}
+#ifdef SHOES_WIN32
+ code = shoes_init(inst, style);
+#else
code = shoes_init();
#endif
if (code != SHOES_OK)
View
@@ -34,7 +34,9 @@ def update
image "#{DIR}/static/icon-#{typ}.png"
end
stack :margin => 4, :width => -20 do
- para " #{msg}", :margin => 4, :margin_top => 0
+ s = msg.to_s
+ s << "\n#{msg.backtrace.join("\n")}" if msg.kind_of?(Exception)
+ para s, :margin => 4, :margin_top => 0
end
end
end
@@ -7,8 +7,10 @@
#endif
#ifdef HAVE_RUBY_IO_H
#include <ruby/io.h>
+#define OPEN_FILE rb_io_t
#else
#include <rubyio.h>
+#define OPEN_FILE OpenFile
#endif
#include <stdlib.h>
#include <zlib.h>
@@ -20,6 +22,10 @@
#include "abstractfile.h"
#include "pe.h"
+#if !defined(GetReadFile)
+#define GetReadFile(fptr) rb_io_stdio_file(fptr)
+#endif
+
char *pe_pad = "PADDINGXXPADDING";
char endianness;
@@ -258,7 +264,7 @@ unsigned int
binject_exe_file_size(VALUE obj)
{
struct stat st;
- rb_io_t *fptr;
+ OPEN_FILE *fptr;
FILE *fres;
GetOpenFile(obj, fptr);
rb_io_check_readable(fptr);
@@ -444,7 +450,7 @@ binject_exe_rewrite(binject_exe_t *binj, char *buf, char *out, int offset, int o
}
else
{
- rb_io_t *fptr;
+ OPEN_FILE *fptr;
rdat->Size = binject_exe_file_size(obj);
GetOpenFile(obj, fptr);
binject_exe_file_copy(GetReadFile(fptr), binj->out, rdat->Size, 0, binj->datapos, binj->proc);
@@ -7,8 +7,13 @@
#endif
#ifdef HAVE_RUBY_IO_H
#include <ruby/io.h>
+#define OPEN_FILE rb_io_t
#else
#include <rubyio.h>
+#define OPEN_FILE OpenFile
+#endif
+#ifndef RFLOAT_VALUE
+#define RFLOAT_VALUE(f) RFLOAT(f)->value
#endif
#include <stdlib.h>
@@ -190,7 +195,7 @@ static VALUE
dump_inline_suffixes(VALUE self, VALUE io, VALUE fulltext)
{
char *data;
- rb_io_t *fptr;
+ OPEN_FILE *fptr;
VALUE block_size, suffixes, new_suffixes, inline_suffix_size;
int i;
@@ -226,7 +231,7 @@ dump_suffix_array(VALUE self, VALUE io)
VALUE suffixes, new_suffixes;
int i;
VALUE *vptr;
- rb_io_t *fptr;
+ OPEN_FILE *fptr;
suffixes = rb_ivar_get(self, rb_intern("@suffixes"));
new_suffixes = rb_funcall(suffixes, rb_intern("to_a"), 0);
View
Binary file not shown.
Binary file not shown.
View
@@ -43,12 +43,14 @@ module Kernel
#
# GEM_SKIP=libA:libB ruby -I../libA -I../libB ./mycode.rb
- def gem(gem_name, *version_requirements)
+ def gem(gem_name, *version_requirements) # :doc:
skip_list = (ENV['GEM_SKIP'] || "").split(/:/)
raise Gem::LoadError, "skipping #{gem_name}" if skip_list.include? gem_name
Gem.activate(gem_name, *version_requirements)
end
+ private :gem
+
end
##
@@ -104,10 +106,10 @@ module Gem
@ruby = nil
@sources = []
- @post_install_hooks = []
- @post_uninstall_hooks = []
- @pre_uninstall_hooks = []
- @pre_install_hooks = []
+ @post_install_hooks ||= []
+ @post_uninstall_hooks ||= []
+ @pre_uninstall_hooks ||= []
+ @pre_install_hooks ||= []
##
# Activates an installed gem matching +gem+. The gem must satisfy
@@ -294,6 +296,7 @@ def self.datadir(gem_name)
# A Zlib::Deflate.deflate wrapper
def self.deflate(data)
+ require 'zlib'
Zlib::Deflate.deflate data
end
@@ -302,7 +305,7 @@ def self.deflate(data)
def self.dir
@gem_home ||= nil
- set_home(ENV['GEM_HOME'] || default_dir) unless @gem_home
+ set_home(ENV['GEM_HOME'] || Gem.configuration.home || default_dir) unless @gem_home
@gem_home
end
@@ -395,6 +398,8 @@ def self.find_home
# Zlib::GzipReader wrapper that unzips +data+.
def self.gunzip(data)
+ require 'stringio'
+ require 'zlib'
data = StringIO.new data
Zlib::GzipReader.new(data).read
@@ -404,6 +409,8 @@ def self.gunzip(data)
# Zlib::GzipWriter wrapper that zips +data+.
def self.gzip(data)
+ require 'stringio'
+ require 'zlib'
zipped = StringIO.new
Zlib::GzipWriter.wrap zipped do |io| io.write data end
@@ -415,6 +422,7 @@ def self.gzip(data)
# A Zlib::Inflate#inflate wrapper
def self.inflate(data)
+ require 'zlib'
Zlib::Inflate.inflate data
end
@@ -479,13 +487,13 @@ def self.load_path_insert_index
# The file name and line number of the caller of the caller of this method.
def self.location_of_caller
- file, lineno = caller[1].split(':')
- lineno = lineno.to_i
+ caller[1] =~ /(.*?):(\d+)$/i
+ file = $1
+ lineno = $2.to_i
+
[file, lineno]
end
- private_class_method :location_of_caller
-
##
# manage_gems is useless and deprecated. Don't call it anymore.
@@ -709,9 +717,11 @@ def self.set_paths(gpaths)
@gem_path.uniq!
@gem_path.each do |path|
- if 0 == File.expand_path(path).index(Gem.user_home) and
- Etc.getpwuid.uid != File::Stat.new(Gem.user_home).uid then
- next # only create by matching user
+ if 0 == File.expand_path(path).index(Gem.user_home)
+ unless win_platform? then
+ # only create by matching user
+ next if Etc.getpwuid.uid != File::Stat.new(Gem.user_home).uid
+ end
end
ensure_gem_subdirectories path
end
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -31,7 +31,8 @@ def initialize
def execute
if options[:test]
version = options[:version] || Gem::Requirement.default
- gem_spec = Gem::SourceIndex.from_installed_gems.search(get_one_gem_name, version).first
+ dep = Gem::Dependency.new get_one_gem_name, version
+ gem_spec = Gem::SourceIndex.from_installed_gems.search(dep).first
Gem::Validator.new.unit_test(gem_spec)
end
@@ -43,7 +43,7 @@ def execute
basename = File.basename(path).sub(/\.gem$/, '')
target_dir = File.expand_path File.join(options[:target], basename)
FileUtils.mkdir_p target_dir
- Gem::Installer.new(path).unpack target_dir
+ Gem::Installer.new(path, :unpack => true).unpack target_dir
say "Unpacked gem: '#{target_dir}'"
else
alert_error "Gem '#{gemname}' not installed."
@@ -54,11 +54,10 @@ def execute
fail "No gem names are allowed with the --system option"
end
- spec = Gem::Specification.new
- spec.name = 'rubygems-update'
- spec.version = Gem::Version.new Gem::RubyGemsVersion
- spec.version = Gem::Version.new '1.1.1'
- hig['rubygems-update'] = spec
+ rubygems_update = Gem::Specification.new
+ rubygems_update.name = 'rubygems-update'
+ rubygems_update.version = Gem::Version.new Gem::RubyGemsVersion
+ hig['rubygems-update'] = rubygems_update
options[:user_install] = false
else
@@ -52,6 +52,8 @@ class Gem::ConfigFile
# Where to look for gems
attr_accessor :path
+ attr_accessor :home
+
# True if we print backtraces on errors.
attr_writer :backtrace
@@ -129,7 +131,8 @@ def initialize(arg_list)
Gem.sources = @hash[:sources] if @hash.key? :sources
@verbose = @hash[:verbose] if @hash.key? :verbose
@update_sources = @hash[:update_sources] if @hash.key? :update_sources
- @path = @hash[:gempath]
+ @path = @hash[:gempath] if @hash.key? :gempath
+ @home = @hash[:gemhome] if @hash.key? :gemhome
handle_arguments arg_list
end
Oops, something went wrong.

0 comments on commit f870a09

Please sign in to comment.