From: Rupert B. <rup...@fr...> - 2007-07-15 20:24:08
|
Tim, Le 15 juil. 07 =C3=A0 15:55, = rub...@li... =20 a =C3=A9crit : > Further to what we have been talking about on this list we could take > a universial ruby distribution and put that inside our application > couldn't we? Having said that, how would RC know to use the ruby > within the application? I should think : just change the '#! /usr/bin/env ruby' in rb_main.rb =20= to point to the packaged ruby in your app, no ? Rup |
From: Tim P. <he...@ti...> - 2007-07-15 22:05:26
|
rb_main.rb doesnt have a shebang line so I dont think that would work? Having said that if it doesnt have a shebang line how does RC know where the ruby bin is? Or is that somehow embedded inside the framework when it is built? Tim On 15 Jul 2007, at 21:21, Rupert BARROW wrote: > I should think : just change the '#! /usr/bin/env ruby' in > rb_main.rb to point to the packaged ruby in your app, no ? > > Rup |
From: Fujimoto H. <hi...@fo...> - 2007-07-15 23:41:33
|
YOURAPP/Contents/MacOS/YOURAPP is almost same as the ruby command. e.g. $ /Applications/TMPresents.app/Contents/MacOS/TMPresents --version ruby 1.8.2 (2004-12-25) [universal-darwin8.0] TMPresents.app is a RubyCocoa app. main.m of a typical RubyCocoa app is: int main(int argc, const char *argv[]) { return RBApplicationMain("rb_main.rb", argc, argv); } RBApplicationMain is a traditional API. And RBApplicationInit is an alternative modern API: int main(int argc, const char *argv[]) { RBApplicationInit("rb_main.rb", argc, argv, nil); return NSApplicationMain(argc, argv); } rb_main.rb: require 'osx/cocoa' OSX.init_for_bundle do |bdl, param, log| # param - the 4th argument of RBApplicationInit as optional data # log - nslog wrapper for this block # initialize/loadin your ruby programs here. log.info("bdl=%p, param=%p", bdl, param) require 'your_ruby_programs' ... end end -- hisa On 7/16/07, Tim Perrett <he...@ti...> wrote: > rb_main.rb doesnt have a shebang line so I dont think that would > work? Having said that if it doesnt have a shebang line how does RC > know where the ruby bin is? Or is that somehow embedded inside the > framework when it is built? > > Tim > > > > On 15 Jul 2007, at 21:21, Rupert BARROW wrote: > > > I should think : just change the '#! /usr/bin/env ruby' in > > rb_main.rb to point to the packaged ruby in your app, no ? > > > > Rup > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Rubycocoa-talk mailing list > Rub...@li... > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk > -- hisa |
From: Jon B. <jo...@gm...> - 2007-07-16 02:50:23
|
I just "rubycocoa new TestApp", build + get this: [MacBook-Pro:~/TestApp/build/Release/TestApp.app/Contents/MacOS]$ ./ TestApp --version ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-darwin8.9.4] [MacBook-Pro:~/TestApp/build/Release/TestApp.app/Contents/MacOS]$ I think (?) the point behind a bundled Ruby w/ your RC app is to not have to need the end user to touch any files or need to set anything and use a shipping Ruby capable of running on both PPC/Intel. I just downloaded the one-click (http://rubyosx.rubyforge.org/) and extract using Pacifist to a /VM directory under my project, how can I get it to use that ruby instead of system ruby? - Jon On Jul 15, 2007, at 7:41 PM, Fujimoto Hisa wrote: > YOURAPP/Contents/MacOS/YOURAPP is almost same as the ruby command. > > e.g. > $ /Applications/TMPresents.app/Contents/MacOS/TMPresents --version > ruby 1.8.2 (2004-12-25) [universal-darwin8.0] > > TMPresents.app is a RubyCocoa app. > > main.m of a typical RubyCocoa app is: > int main(int argc, const char *argv[]) { > return RBApplicationMain("rb_main.rb", argc, argv); > } > > RBApplicationMain is a traditional API. And RBApplicationInit is an > alternative modern API: > > int main(int argc, const char *argv[]) { > RBApplicationInit("rb_main.rb", argc, argv, nil); > return NSApplicationMain(argc, argv); > } > > rb_main.rb: > require 'osx/cocoa' > OSX.init_for_bundle do |bdl, param, log| > # param - the 4th argument of RBApplicationInit as optional data > # log - nslog wrapper for this block > > # initialize/loadin your ruby programs here. > log.info("bdl=%p, param=%p", bdl, param) > require 'your_ruby_programs' > ... > end > end > > -- > hisa > > On 7/16/07, Tim Perrett <he...@ti...> wrote: >> rb_main.rb doesnt have a shebang line so I dont think that would >> work? Having said that if it doesnt have a shebang line how does RC >> know where the ruby bin is? Or is that somehow embedded inside the >> framework when it is built? >> >> Tim >> >> >> >> On 15 Jul 2007, at 21:21, Rupert BARROW wrote: >> >>> I should think : just change the '#! /usr/bin/env ruby' in >>> rb_main.rb to point to the packaged ruby in your app, no ? >>> >>> Rup >> >> >> --------------------------------------------------------------------- >> ---- >> This SF.net email is sponsored by DB2 Express >> Download DB2 Express C - the FREE version of DB2 express and take >> control of your XML. No limits. Just data. Click to get it now. >> http://sourceforge.net/powerbar/db2/ >> _______________________________________________ >> Rubycocoa-talk mailing list >> Rub...@li... >> https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk >> > > > -- > hisa > > ---------------------------------------------------------------------- > --- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Rubycocoa-talk mailing list > Rub...@li... > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk |
From: Tim P. <he...@ti...> - 2007-07-16 15:04:40
|
Could someone on the dev team be able to tell us how RC knows what ruby binary to use and where it looks for it? It must have to look at something in the first instance to know where ruby is located wouldnt it? Also, with Fujimoto Hisa and Jons post, Jon says he got ruby 1.8.6 after installing rubyosx package, and Fujimoto got 1.8.2 when passing the --version flag from a terminal window, this sounds to me like it is concurrent with looking for ruby on the path; what do people think? I wonder if the sources for Locomotive / Slingshot can shed any light on things? Cheers Tim On 16 Jul 2007, at 03:50, Jon Baer wrote: > I just downloaded the one-click (http://rubyosx.rubyforge.org/) and > extract using Pacifist to a /VM directory under my project, how can I > get it to use that ruby instead of system ruby? |
From: Laurent S. <lsa...@ap...> - 2007-07-16 15:22:33
|
I will write an article in the Wiki about this, since this is a recurrent question. Cheers, Laurent On Jul 16, 2007, at 5:04 PM, Tim Perrett wrote: > Could someone on the dev team be able to tell us how RC knows what > ruby binary to use and where it looks for it? It must have to look at > something in the first instance to know where ruby is located wouldnt > it? Also, with Fujimoto Hisa and Jons post, Jon says he got ruby > 1.8.6 after installing rubyosx package, and Fujimoto got 1.8.2 when > passing the --version flag from a terminal window, this sounds to me > like it is concurrent with looking for ruby on the path; what do > people think? > > I wonder if the sources for Locomotive / Slingshot can shed any light > on things? > > Cheers > > Tim > > > On 16 Jul 2007, at 03:50, Jon Baer wrote: > >> I just downloaded the one-click (http://rubyosx.rubyforge.org/) and >> extract using Pacifist to a /VM directory under my project, how can I >> get it to use that ruby instead of system ruby? > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Rubycocoa-talk mailing list > Rub...@li... > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk |
From: Tim P. <he...@ti...> - 2007-07-17 11:13:09
|
That would be great Laurent :) Cheers Tim On 16 Jul 2007, at 16:22, Laurent Sansonetti wrote: > I will write an article in the Wiki about this, since this is a > recurrent question. > > Cheers, > Laurent > |
From: Eloy D. <elo...@gm...> - 2007-07-17 11:44:11
|
Hello all, Well it took a bit longer than I'd hoped, but I'm actually too busy atm to play with these things :) Another problem came to my attention when discussing some things with the guy that made the rubyosx package (thanks Jon for finding that one). Which is an endian issue. Anyways, this has also been fixed now after studying Apple's patches to ruby 1.8.2. So please try this from source, because I'm indeed doing this al with macports. Obviously you might want to also pass a --prefix option to configure. Patches: http://superalloy.nl/misc_files/rubycocoa/ruby-1.8.6-thread_hooks-universal-patches.zip $ patch -p0 < patch-thread-hooks $ patch -p0 < patch-universal $ CFLAGS="-arch ppc -arch i386" LDFLAGS="-arch ppc -arch i386" ./configure --enable-shared --enable-pthread --without-tk --disable-dependency-tracking $ make all Check the output of: $ file ruby And also of: $ file .ext/universal-darwin8.0/openssl.bundle They should both give something like: openssl.bundle: Mach-O universal binary with 2 architectures openssl.bundle (for architecture ppc): Mach-O bundle ppc openssl.bundle (for architecture i386): Mach-O bundle i386 Once Laurent has written how to include ruby in a application bundle, I think it might be a good option to add a patch-and-compile-ruby option or something like that to standalonify.... Any ideas on this? Cheers, Eloy On 7/17/07, Tim Perrett <he...@ti...> wrote: > That would be great Laurent :) > > Cheers > > Tim > > > On 16 Jul 2007, at 16:22, Laurent Sansonetti wrote: > > > I will write an article in the Wiki about this, since this is a > > recurrent question. > > > > Cheers, > > Laurent > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Rubycocoa-talk mailing list > Rub...@li... > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk > |
From: Eloy D. <elo...@gm...> - 2007-07-17 11:47:24
|
Oh and also please try to build some gems that have C extensions and check if they also build as universal, like: hpricot & libxml Eloy On 7/17/07, Eloy Duran <elo...@gm...> wrote: > Hello all, > > Well it took a bit longer than I'd hoped, but I'm actually too busy > atm to play with these things :) > > Another problem came to my attention when discussing some things with > the guy that made the rubyosx package (thanks Jon for finding that > one). Which is an endian issue. > Anyways, this has also been fixed now after studying Apple's patches > to ruby 1.8.2. > > So please try this from source, because I'm indeed doing this al with macports. > Obviously you might want to also pass a --prefix option to configure. > > Patches: http://superalloy.nl/misc_files/rubycocoa/ruby-1.8.6-thread_hooks-universal-patches.zip > > $ patch -p0 < patch-thread-hooks > $ patch -p0 < patch-universal > $ CFLAGS="-arch ppc -arch i386" LDFLAGS="-arch ppc -arch i386" > ./configure --enable-shared --enable-pthread --without-tk > --disable-dependency-tracking > $ make all > > Check the output of: > $ file ruby > And also of: > $ file .ext/universal-darwin8.0/openssl.bundle > > They should both give something like: > openssl.bundle: Mach-O universal binary with 2 architectures > openssl.bundle (for architecture ppc): Mach-O bundle ppc > openssl.bundle (for architecture i386): Mach-O bundle i386 > > Once Laurent has written how to include ruby in a application bundle, > I think it might be a good option to add a patch-and-compile-ruby > option or something like that to standalonify.... Any ideas on this? > > Cheers, > Eloy > > On 7/17/07, Tim Perrett <he...@ti...> wrote: > > That would be great Laurent :) > > > > Cheers > > > > Tim > > > > > > On 16 Jul 2007, at 16:22, Laurent Sansonetti wrote: > > > > > I will write an article in the Wiki about this, since this is a > > > recurrent question. > > > > > > Cheers, > > > Laurent > > > > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by DB2 Express > > Download DB2 Express C - the FREE version of DB2 express and take > > control of your XML. No limits. Just data. Click to get it now. > > http://sourceforge.net/powerbar/db2/ > > _______________________________________________ > > Rubycocoa-talk mailing list > > Rub...@li... > > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk > > > |
From: Tim P. <he...@ti...> - 2007-07-17 20:01:31
|
Hey Eloy I gave compiling the UB a go and here were the results... timmo:~/Desktop/ruby-1.8.6 tpfgperrett$ file ruby ruby: Mach-O universal binary with 2 architectures ruby (for architecture ppc): Mach-O executable ppc ruby (for architecture i386): Mach-O executable i386 timmo:~/Desktop/ruby-1.8.6 tpfgperrett$ file .ext/universal-darwin8.0/ openssl.bundle .ext/universal-darwin8.0/openssl.bundle: Mach-O universal binary with 2 architectures .ext/universal-darwin8.0/openssl.bundle (for architecture ppc): Mach- O bundle ppc .ext/universal-darwin8.0/openssl.bundle (for architecture i386): Mach-O bundle i386 Hooray! Looks as though it has worked :) great stuff Eloy, well done! So either way, using a bespoke compile, or the rubyosx packages, we now have UB versions of ruby and gems etc that we could incudle into applications for a totally self contained RC app. I know Laurent said he was going to post onto the wikki, but I know there are people on this list who are trying to deploy apps in this manner at the moment and wondered if anyone has has any success completing the packaging yet? Cheers Tim On 17 Jul 2007, at 12:43, Eloy Duran wrote: > Check the output of: > $ file ruby > And also of: > $ file .ext/universal-darwin8.0/openssl.bundle > > They should both give something like: > openssl.bundle: Mach-O universal binary with 2 architectures > openssl.bundle (for architecture ppc): Mach-O bundle ppc > openssl.bundle (for architecture i386): Mach-O bundle i386 |
From: Eloy D. <elo...@gm...> - 2007-07-17 20:42:49
|
Hey Tim, Nice! Thanks for your test. Of course it would also be a god thing to really test it with the included tests.... :) Cheers, Eloy On 7/17/07, Tim Perrett <he...@ti...> wrote: > Hey Eloy > > I gave compiling the UB a go and here were the results... > > timmo:~/Desktop/ruby-1.8.6 tpfgperrett$ file ruby > ruby: Mach-O universal binary with 2 architectures > ruby (for architecture ppc): Mach-O executable ppc > ruby (for architecture i386): Mach-O executable i386 > timmo:~/Desktop/ruby-1.8.6 tpfgperrett$ file .ext/universal-darwin8.0/ > openssl.bundle > .ext/universal-darwin8.0/openssl.bundle: Mach-O universal binary with > 2 architectures > .ext/universal-darwin8.0/openssl.bundle (for architecture ppc): Mach- > O bundle ppc > .ext/universal-darwin8.0/openssl.bundle (for architecture > i386): Mach-O bundle i386 > > Hooray! Looks as though it has worked :) great stuff Eloy, well done! > > So either way, using a bespoke compile, or the rubyosx packages, we > now have UB versions of ruby and gems etc that we could incudle into > applications for a totally self contained RC app. > > I know Laurent said he was going to post onto the wikki, but I know > there are people on this list who are trying to deploy apps in this > manner at the moment and wondered if anyone has has any success > completing the packaging yet? > > Cheers > > Tim > > > On 17 Jul 2007, at 12:43, Eloy Duran wrote: > > > Check the output of: > > $ file ruby > > And also of: > > $ file .ext/universal-darwin8.0/openssl.bundle > > > > They should both give something like: > > openssl.bundle: Mach-O universal binary with 2 architectures > > openssl.bundle (for architecture ppc): Mach-O bundle ppc > > openssl.bundle (for architecture i386): Mach-O bundle i386 > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Rubycocoa-talk mailing list > Rub...@li... > https://lists.sourceforge.net/lists/listinfo/rubycocoa-talk > |
From: Tim P. <he...@ti...> - 2007-07-24 10:33:47
|
Just bringing this thread back for a moment... I know we were discussing natively compiled gems such as hpricot and libxml-ruby, but then I got to thinking that these are two very different propositions. hpricot just has C extensions that need to be compiled, where as libxml ruby actually needs to find compiled libxml2 libraries on the path in order to work. Would I then be wrong in thinking that it needs those libraries (libxml2, iconv etc) to operate rather than just compile? If so, they would also need to be packaged would they not? As a universal binary also? I found this nice link too... http://www.complex-computer.de/ albumshaper/wiki/index.php/Compiling_on_OSX#Compiling_libxml2 Cheers Tim |