--- lib/command_runner.rb.orig 2010-01-19 17:37:20.000000000 +0900 +++ lib/command_runner.rb 2010-01-19 17:36:53.000000000 +0900 @@ -56,6 +56,7 @@ Options: -s, --ssl-support Install the server with SSL support -d, --debug-build Compile the server as a debug build to output extremely verbose logs + -m, --macports Compile the server with MacPorts Ruby Summary: Install the server @@ -175,6 +176,10 @@ options[:report_dir] = dir end + opts.on( '-m', '--macports', 'Compile with MacPorts Ruby') do + options[:macports] = true + end + end begin --- lib/installer.rb.orig 2010-01-19 17:38:03.000000000 +0900 +++ lib/installer.rb 2010-01-19 18:11:26.000000000 +0900 @@ -165,7 +165,11 @@ ssl = true str = "ssl=yes " end - + + if options[:macports] + str += "macports=yes " + end + if CheckUser.new.check == 0 # if File.exist?(File.join(WEBROAR_BIN_DIR,"webroar-head")) && File.exist?(File.join(WEBROAR_BIN_DIR,"webroar-worker")) --- tasks/compile.rake.orig 2010-01-19 11:54:46.000000000 +0900 +++ tasks/compile.rake 2010-01-19 17:43:29.000000000 +0900 @@ -66,6 +66,9 @@ puts "Adding HAVE_GNUTLS flag." $flags << '-DHAVE_GNUTLS' end + if ENV['macports'].eql?("yes") + puts "Building for MacPorts Ruby build." + end $flags = $flags.join(" ") $webroar_config_called=true end @@ -128,12 +131,18 @@ TEST_OBJ_DIR = File.join(OBJ_DIR, 'test').freeze LOG_FILES = File.join('','var','log','webroar').freeze TMP_FILES = File.join('','tmp').freeze +MACPORTS_HEADER_DIR = File.join('', 'opt', 'local', 'include').freeze +MACPORTS_LIB_DIR = File.join('', 'opt', 'local', 'lib').freeze ## Create necessory directories #create_directories([OBJ_DIR, WORKER_OBJ_DIR, YAML_OBJ_DIR, TEST_OBJ_DIR, TMP_FILES, LOG_FILES]) include_dir = ["#{LIBEV_DIR}","#{EBB_DIR}","#{HEAD_DIR}","#{YAML_DIR}","#{HELPER_DIR}","#{UNIT_TEST_DIR}", "#{WORKER_DIR}"] +if ENV['macports'].eql?("yes") + include_dir << "#{MACPORTS_HEADER_DIR}" +end + include_dir.each do |dir| $inc_flags << " -I#{dir} " end @@ -244,6 +253,10 @@ $libs += $LIBS + ' ' + Config::expand($LIBRUBYARG_SHARED,CONFIG) #$libs += ' '+CONFIG["LIBRUBYARG"] $libs += ' -lpthread ' + if ENV['macports'].eql?("yes") + puts "Compiling with MacPorts Ruby." + $libs += " -L#{MACPORTS_LIB_DIR} " + end out_file=File.join(BIN_DIR,'webroar-worker') object_files=FileList[File.join(WORKER_OBJ_DIR,'*.o'), helper_obj.keys, File.join(YAML_OBJ_DIR,'*.o')] # -rdynamic option to get function name in stacktrace @@ -263,6 +276,10 @@ puts "Compiling with gnutls library." $libs += ' -lgnutls ' end + if ENV['macports'].eql?("yes") + puts "Compiling with MacPorts Ruby." + $libs += " -L#{MACPORTS_LIB_DIR} " + end out_file=File.join(BIN_DIR,'webroar-head') object_files=FileList[File.join(OBJ_DIR,'*.o'),File.join(YAML_OBJ_DIR,'*.o')] # -rdynamic option to get function name in stacktrace --- tasks/gem.rake.orig 2010-01-19 17:54:13.000000000 +0900 +++ tasks/gem.rake 2010-01-19 17:54:39.000000000 +0900 @@ -118,7 +118,11 @@ if ENV['debug_build'] == 'yes' opt_str += "-d " end - + + if ENV['macports'] == 'yes' + opt_str += "-m " + end + sh "webroar install #{opt_str}" end