G
Guillaume Marcais
There was some discussion about packing Windows executable with
tar2rubyscript and rubyscript2exe from a Linux box. Wine was proposed
but I publicly dismissed with the claimed that it didn't support WinXP
calls (and thus not win32-utils). ruby-talk:172349
But I was wrong. wine DOES support WinXP calls, ruby and win32-utils. I
am right now building a cross-platform application with wine 0.9.5, ruby
1.8.2 (one click installer) and wxruby, all from my Linux machine.
tar2rubyscript and rubyscript2exe were installed from gems. Here is what
my rakefile looks like:
------------
DIST = "deviceproxy2"
task :default => [:run_windows]
task :run_linux do
ruby "init.rb"
end
task :run_windows do
sh 'wine ruby init.rb'
end
task re_build do
sh "rm -f #{DIST}.tar #{DIST}.tar.gz"
sh "darcs dist -d '#{DIST}'"
sh "gunzip #{DIST}.tar.gz"
end
task :build_linux => [re_build] do
sh "tar2rubyscript #{DIST}.tar"
sh "rubyscript2exe #{DIST}.rb"
end
task :build_windows => [re_build] do
sh <<EOF
unset TMPDIR
wine ruby 'C:\\ruby\\bin\\tar2rubyscript' --tar2rubyscript-preserve
#{DIST}.tar
wine ruby 'C:\\ruby\\bin\\rubyscript2exe' #{DIST}.rb
EOF
end
---------------
The only gotcha is --tar2rubyscript-preserve. For some reason, when
running tar2rubyscript with wine, it fails with an error:
--------------
c:\windows\temp\tar2rubyscript.d.66.1\tar2rubyscript\tar.exe: Cannot add
file *.*: No such file or directory
--------------
Using a tar ball and --tar2rubyscript-preserve skips this step and
everything is cool.
Maybe someone will find this information useful,
Guillaume.
tar2rubyscript and rubyscript2exe from a Linux box. Wine was proposed
but I publicly dismissed with the claimed that it didn't support WinXP
calls (and thus not win32-utils). ruby-talk:172349
But I was wrong. wine DOES support WinXP calls, ruby and win32-utils. I
am right now building a cross-platform application with wine 0.9.5, ruby
1.8.2 (one click installer) and wxruby, all from my Linux machine.
tar2rubyscript and rubyscript2exe were installed from gems. Here is what
my rakefile looks like:
------------
DIST = "deviceproxy2"
task :default => [:run_windows]
task :run_linux do
ruby "init.rb"
end
task :run_windows do
sh 'wine ruby init.rb'
end
task re_build do
sh "rm -f #{DIST}.tar #{DIST}.tar.gz"
sh "darcs dist -d '#{DIST}'"
sh "gunzip #{DIST}.tar.gz"
end
task :build_linux => [re_build] do
sh "tar2rubyscript #{DIST}.tar"
sh "rubyscript2exe #{DIST}.rb"
end
task :build_windows => [re_build] do
sh <<EOF
unset TMPDIR
wine ruby 'C:\\ruby\\bin\\tar2rubyscript' --tar2rubyscript-preserve
#{DIST}.tar
wine ruby 'C:\\ruby\\bin\\rubyscript2exe' #{DIST}.rb
EOF
end
---------------
The only gotcha is --tar2rubyscript-preserve. For some reason, when
running tar2rubyscript with wine, it fails with an error:
--------------
c:\windows\temp\tar2rubyscript.d.66.1\tar2rubyscript\tar.exe: Cannot add
file *.*: No such file or directory
--------------
Using a tar ball and --tar2rubyscript-preserve skips this step and
everything is cool.
Maybe someone will find this information useful,
Guillaume.