nobody at rubyforge.org
2006-Oct-24 02:40 UTC
[Wxruby-development] [713] trunk/wxruby2: Patch for rake install, added rake uninstall
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!-- #msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; } #msg dt { float: left; width: 6em; font-weight: bold; } #msg dt:after { content:'':'';} #msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; } #msg dl a { font-weight: bold} #msg dl a:link { color:#fc3; } #msg dl a:active { color:#ff0; } #msg dl a:visited { color:#cc6; } h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; } #msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; } #msg ul, pre { overflow: auto; } #header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; } #patch { width: 100%; } #patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;} #patch .propset h4, #patch .binary h4 {margin:0;} #patch pre {padding:0;line-height:1.2em;margin:0;} #patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;} #patch .propset .diff, #patch .binary .diff {padding:10px 0;} #patch span {display:block;padding:0 10px;} #patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;} #patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;} #patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;} #patch .lines, .info {color:#888;background:#fff;} --></style> <title>[713] trunk/wxruby2: Patch for rake install, added rake uninstall</title> </head> <body> <div id="msg"> <dl> <dt>Revision</dt> <dd>713</dd> <dt>Author</dt> <dd>roys</dd> <dt>Date</dt> <dd>2006-10-23 22:40:31 -0400 (Mon, 23 Oct 2006)</dd> </dl> <h3>Log Message</h3> <pre>Patch for rake install, added rake uninstall</pre> <h3>Modified Paths</h3> <ul> <li><a href="#trunkwxruby2rakerakewxrb">trunk/wxruby2/rake/rakewx.rb</a></li> <li><a href="#trunkwxruby2rakefile">trunk/wxruby2/rakefile</a></li> </ul> </div> <div id="patch"> <h3>Diff</h3> <a id="trunkwxruby2rakerakewxrb"></a> <div class="modfile"><h4>Modified: trunk/wxruby2/rake/rakewx.rb (712 => 713)</h4> <pre class="diff"><span> <span class="info">--- trunk/wxruby2/rake/rakewx.rb        2006-10-23 20:55:30 UTC (rev 712) +++ trunk/wxruby2/rake/rakewx.rb        2006-10-24 02:40:31 UTC (rev 713) </span><span class="lines">@@ -174,8 +174,6 @@ </span><span class="cx"> </span><span class="cx"> end </span><span class="cx"> </span><del>- - </del><span class="cx"> def to_obj_files(bases) </span><span class="cx"> return bases.map do | b | obj_file(b) end </span><span class="cx"> end </span><span class="lines">@@ -188,6 +186,10 @@ </span><span class="cx"> return to_obj_files(all_obj_bases) </span><span class="cx"> end </span><span class="cx"> </span><ins>+def all_ruby_lib_files + FileList[ ''lib/**/*.rb'' ] +end + </ins><span class="cx"> def add_initializers(cpp_file) </span><span class="cx"> needs_init_list = get_classes </span><span class="cx"> needs_init_list += get_optional_classes </span><span class="lines">@@ -339,19 +341,27 @@ </span><span class="cx"> end </span><span class="cx"> end </span><span class="cx"> </span><del>-def install_lib(filename) -        if(!File.directory?($install_lib_dir)) -                mkdir($install_lib_dir) -        end -        sh "#{$install_prog} lib/#{filename} #{$install_lib_dir}" -end </del><span class="cx"> </span><span class="cx"> def create_install_task </span><span class="cx"> desc "Install the WxRuby library to Ruby''s lib directories" </span><del>- task :install => [:default] do |t| -         install_lib("wx.rb") -         install_lib($dl_lib) - end </del><ins>+ task :install => [ :default, *all_ruby_lib_files ] do | t | + dest_dir = Config::CONFIG[''sitelibdir''] + force_mkdir File.join(dest_dir, ''wx'') + force_mkdir File.join(dest_dir, ''wx'', ''classes'') + cp $target_lib, Config::CONFIG[''sitearchdir''] + all_ruby_lib_files.each do | lib_file | + dest = lib_file.sub(/^lib/, dest_dir) + cp lib_file, dest + chmod 0755, dest + end + end + + desc "Removes installed library files from site_ruby" + task :uninstall do | t | + rm_rf File.join(Config::CONFIG[''sitearchdir''], $dl_lib) + rm_rf File.join(Config::CONFIG[''sitelibdir''], ''wx.rb'') + rm_rf File.join(Config::CONFIG[''sitelibdir''], ''wx'') + end </ins><span class="cx"> end </span><span class="cx"> </span><span class="cx"> def create_internal_swig_tasks </span><span class="lines">@@ -400,4 +410,4 @@ </span><span class="cx"> </span><span class="cx"> def run_makefile(num_threads=1) </span><span class="cx"> system("make -j #{num_threads.to_i}") </span><del>-end </del><span class="cx">\ No newline at end of file </span><ins>+end </ins></span></pre></div> <a id="trunkwxruby2rakefile"></a> <div class="modfile"><h4>Modified: trunk/wxruby2/rakefile (712 => 713)</h4> <pre class="diff"><span> <span class="info">--- trunk/wxruby2/rakefile        2006-10-23 20:55:30 UTC (rev 712) +++ trunk/wxruby2/rakefile        2006-10-24 02:40:31 UTC (rev 713) </span><span class="lines">@@ -55,12 +55,6 @@ </span><span class="cx"> $extra_objs = $extra_objs </span><span class="cx"> $dl_lib = "wxruby2.#{$dl_ext}" </span><span class="cx"> </span><del>-#used for :install -$ruby = "#{Config::CONFIG[''bindir'']}/#{Config::CONFIG[''ruby_install_name'']}" -$install_prog = "#$ruby -run -e install -- -vpm 0755" -$install_site_dir = "#{Config::CONFIG[''sitedir'']}/#{Config::CONFIG[''MAJOR'']}.#{Config::CONFIG[''MINOR'']}" -$install_lib_dir = "#$install_site_dir/#{Config::CONFIG[''sitearch'']}" - </del><span class="cx"> ############################# </span><span class="cx"> # later, support static linking </span><span class="cx"> $target_lib = File.join($dest_dir, $dl_lib) </span></span></pre> </div> </div> </body> </html>