Native cross-compiling (-packing) with GUI

  • Thread starter Meillo r e t u r n s
  • Start date
M

Meillo r e t u r n s

Hi community,

i'm brand new to Ruby, but i like what i've seen by now.


After some time with Lazarus ( http://lazarus.freepascal.org ) and gcj (
http://gcc.gnu.org/java ) i unfortunately haven't found what i am really
looking for. I hope i'll find it in Ruby.


I want:

1) coding on a GNU/Linux-machine
2) creating GUI-programs (if possible with the luxus of a GUI-designer)
3) compiling (or packing) against linux _and_ win32 (=cross-compiling)
( 4) the compiled executable should fit on one 1.44-floppy ... if
possible )

my aim:
I want to share my programs to friends of mine (mostly windows-user),
and i dont want any installation-routine - i just want one executable
(or a folder with exe, dll/so, textfiles, etc) - so that i can explain
them: "download [file] from , unzip, and double-click on
[name].exe"



i searched the web for the last 3 days, but couldn't find really
anything that matches point 3) from above - i tried exerb (of course)
but couldn't create a working fox-gui-program (perhaps that was just a
fault of some miss-matching versions :-? ) ... but fox could be good - i
think
Then i tried RubyScript2Exe, but it's not possible to cross-compile with
it (will it ever be??) (does it run through wine? - haven't tried yet).
Another problem with it: i can't use UPX with a
RubyScript2Exe-OutputFile ... dont know why.



so, if someone of you does have any hints, ideas, links, experiences,
etc for me - please tell me about them.


... and dont try to convince me to give up my goals - you wouldn't
succed ;-)


so far
Meillo r e t u r n s
 
F

Florian Groß

Meillo said:
I want:

1) coding on a GNU/Linux-machine

No trouble. You just need to find yourself a decent GUI. I've had good
experience with jEdit and its Ruby plug in on Win32. It might work for
you as well.
2) creating GUI-programs (if possible with the luxus of a GUI-designer)

I'd definitely go with GTK2 here. It's portable and native looking (not
100% to OS X, but there's work on that) on lots of platforms.

It's Ruby bindings are highly comfortable and will make you feel like
you are coding in Ruby.

And there's Glade which will let you drag&drop GUIs together and save
them to an XML file. It's then very easy to load those XML files from
Ruby and to actually make things happen when widgets are clicked etc.
3) compiling (or packing) against linux _and_ win32 (=cross-compiling)
( 4) the compiled executable should fit on one 1.44-floppy ... if
possible )

There's no compiling, but at least for Win32 and OS X there is
RubyScript2Exe. I'm not sure if it is also available for Linux, but if
everything else fails you will be able to pack all your files into a
single Ruby file for all platforms. And to binaries for others.

Ruby executables tend to be bigger than applications written in C and
Pascal, but the situation is still quite good.

A game I wrote used 385 KB after UPX packing it. That is without
additional SDL DLLs and data, however.

I'm not sure if a single floppy disk is possible when also including the
GTK2 libraries.

Also, GTK2 might need to be installed separately so that your
application works. This is a very simple procedure, however. Basically
you just have to click "Next" in the installer a few times.

X-Chat and Freeciv seem to include GTK2 itself in their installers,
lately. So that is probably easy to do as well.

TK will probably work without any setup, but it does less for you, the
programmer.
Then i tried RubyScript2Exe, but it's not possible to cross-compile with
it (will it ever be??)

It sounds very possible. I'm pretty sure the developer would be able to
make this work if you ask nicely.
(does it run through wine? - haven't tried yet).

I think so.
Another problem with it: i can't use UPX with a
RubyScript2Exe-OutputFile ... dont know why.

This worked fine for me. Tried contacting the developer yet?

Here's a few links:

* Ruby-GTK2 library: http://ruby-gnome2.sourceforge.jp/
* Glade: http://glade.gnome.org/
* JEdit: http://www.jedit.org/
* JEdit's Ruby Plug in: http://www.jedit.org/ruby/
* RubyScript2Exe: http://www.erikveen.dds.nl/rubyscript2exe/index.html
 
G

Guillaume Marcais

Le 23 d=E9c. 05, =E0 14:44, Meillo r e t u r n s a =E9crit :
Hi community,

i'm brand new to Ruby, but i like what i've seen by now.


After some time with Lazarus ( http://lazarus.freepascal.org ) and gcj=20=
(
http://gcc.gnu.org/java ) i unfortunately haven't found what i am=20
really
looking for. I hope i'll find it in Ruby.


I want:

1) coding on a GNU/Linux-machine
2) creating GUI-programs (if possible with the luxus of a = GUI-designer)
3) compiling (or packing) against linux _and_ win32 (=3Dcross-compiling)=
( 4) the compiled executable should fit on one 1.44-floppy ... if
possible )

my aim:
I want to share my programs to friends of mine (mostly windows-user),
and i dont want any installation-routine - i just want one executable
(or a folder with exe, dll/so, textfiles, etc) - so that i can explain
them: "download [file] from , unzip, and double-click on [name]...[1] http://rubyforge.org/projects/win32utils/
 
E

Erik Veenstra

I don't think it will be possible to cross-compile with
RubyScript2Exe.

Indeed, cross-compiling with RubyScript2Exe is not possible.
Because of the gathering of files from your own Ruby
installation, RubyScript2Exe creates an executable for the
platform it's being run on. In theory, you could trace the
application on Linux and gather the library files and gems it
uses from the Windows version of Ruby. I've investigated that
and it didn't make me happy. For me, personally, there was no
need for it either.
Maybe it is doable to use qemu or another hardware emulator
to test/package your script on windows without leaving your
linux machine.

I run Linux on my laptop. On top of that, I installed Windows
98 in a virtual machine, using QEMU, and Windows 2000 in
another. Such a virtual machine is just one big file on the
native machine. When I have to boot a (not *the*) instance of
Windows 98, I simply run "win98clone abc", which copies the
original win98.img to win98-abc.img (if it doesn't already
exist...) and starts the virtual machine. In my win98-dev.img
(created with "win98clone dev") I installed Ruby+GEMS+LIBS,
FPC, RubyScript2Exe, Tar2RubyScript and other tools I need to
build an application. When it's time to test the executable, I
run "win98clone test", which results in win98-test.img, another
copy of the original win98.img. No Ruby, no tools, just Windows
98. (Both Windows 98 machines run concurrently on top of
Linux!) Hopefully, this machine is able to boot the
application.exe I created on the development machine...

There's one directory (/scratch) on my native machine that's
available as S:-drives in all Windows machines. Transferring
data from one machine to another is no problem at all.

Conclusion:

* Develop the application on Linux.
* Build application.exe on Windows98-dev.
* Test application.exe on Windows98-test.

gegroet,
Erik V. - http://www.erikveen.dds.nl/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,739
Latest member
Clint8040

Latest Threads

Top