-
Notifications
You must be signed in to change notification settings - Fork 19
Developers Tools
Please read to whole thing to get a feel for what to do and then re-read it again and then some of the Advanced documetation
You could find your way here for several reasons. Maybe a downloaded Gem failed to build and the error message said to install the development tools. Or step up your game and build build your private copy of Shoes from a github clone. Or maybe you'd like to be a Shoes 3.2 maintainer (be still my beatingheart).
For Windows, you have some work to do - I cross compile from Linux so I haven't tested this advice and probably won't. Be bold! You need to install the latest (RubyInstaller)[http://rubyinstaller.org/downloads] that's closest to Shoes (Ruby 2.1.0 at this time) and you need to install the proper devkit. Please read their instructions twice, thrice would be better. You wouldn't believe how many people manage to install the wrong dev kit for the wrong version of Ruby and then ask for help on their mailing list. Don't be one of those folks. FLASHING BOLD - Shoes 3.2 is 32 bit END FLASHING BOLD. It runs fine on 64 bit Windows. You want 32 and if you can find where Luis is keeping the 2.1.x version, use that.
You need xcode command development tools, which is a separate package that XCode can install. So you need to install XCode. Which is free for known developers which requires a free developer registration. Odd's are you're half way there with you App Store account. Complain about their rules to your drinking buddies. I've found it a spam free and marketing free experience.
You need gcc (4.6 or better, depending on your Linux). You need 'make' and 'autoconf'. You'll have to google and use whatever package manager (apt-get, yum, yast ...) is on your Linux. If there is recommended gcc offered, use it. Don't go bold here. You won't see any benefits from the newest shiny ornament on the gcc tree and can find a lot of downside if you step out of the lines. You've been warned. Not my problem.
Don't do multi-arch unless you know how to see and fix problems that it might cause - I still worry about my setup.
Do the above. Get a text editor that doesn't suck. Learn how to read error messages when the loader can't find a library. Seriously, there is a difference between compiler warnings and compiler errors. Do you know what this is? You're not going to break anything but you'll waste a lot time, not all of it yours, by typing w/o thinking about what the writer said and meant. They could be different and it's your problem to sort it out.
If it was me, I'd install MinGW MSys first and then ruby installer and then devkit. You'll have to figure that out because I don't want to get that intimate with Windows. You'll want the gtk2 libraries and headers. (google) Unzip them and point mingw and cmd.exe paths to them. I have a blog posts or two about these libraries in a cross compiler arrangement.
I suggest you install rvm. Jewelbox works OK.
Shoes is written assuming you use Homebrew to manage packages. There is left over, unmaintained code that might work with Macports or fink. Swim aginst the tide and the Jewelbox if you like. Your a stud.
There is a rake task osx:brew:install or something like that. It probably doesn't do everything.
You'll need to install the dependecies (apt-get install ). See this outdated page [https://github.com/shoes/shoes/wiki/Building-Shoes-on-Linux]
DO NOT install portaudio. DO NOT install portaudio. Shoes 3.2 won't use it and there's a decent chance it might break your gstreamer/pulseaudio setup. The Portaudio 1.9 to 2.0 transistion was horribly mismanged. I won't touch it again. Then again, it's your Loose Shoes you're building, not mine.
Ruby 1.9.3 introduced a 'feature' that really changed how Shoes 3.2 is build much differently than 3.1, 3.0 and 2.x. You can find my blog posts about it if you care to learn the details. Short version, Ruby has to be built with the --enable-load-relative flag in order for it to be copied into Shoes and packaged and sent across the network. Most 'Rubies' in Linux or even rvm are not built that way. They could be, but they aren't.
So, we have to build a Ruby we can copy. One ruby for each architecture. Every tight shoes is cross compiled. That's the rule. I cross compile on Ubuntu 14.04 all the Linux(x86_64, i686, armhf) and Windows variants of Shoes. The rake files are simply gruesome until you get the gentler angst of it. Want a mips version? It could be done if their linux is full enough.
The magic is named Chroot. If you can install schroot even better. I'm running a debian derivitive and it is relatively easy to install another debian OS in a (s)chroot where you can install ruby (any ruby at this point), the build tools, install the Ruby dependencies like gdbm and openssl and build ruby --enable-load-relative (of course).
A schroot for the Raspberry Pi (armhf) was surprisingly easy with the help of Quemu. (google for instructions). Granted, it takes a while to compile an ARM Ruby with an ARM emulator but it's less clock time that building on the Pi. I choose to not build the Pi Shoes code inside the chroot. I could have but chose not to- I only build ruby (slowly) once a blue moon. I build Shoes often so compile speed is important. I installed an ARM cross compiler in Ubuntu and a set of rakefiles that knows that distinction. GminGW is also setup to look like its a chroot from the rake file perspective, but it's not a chroot, it's just a directory and a cross compiler. (hint gcc --sysroot)
For OSX, I did run a Hackintosh in a Virtualbox VM and it worked almost well enough. I decided to buy a mac mini which nfs mounts the directory with Shoes source code. NFS writes are painful so the rakes for OSX crosss compile build to the local (OSX) disk and then copy Shoes.app to the NFS mount.
The Shoes 3.2 rake files are written for that setup. You may (should) have to modfiy them to match your setup if you choose to build a Shoes for distribution. Beware - there hints and comments, unused code and code that does nothing usefull but is called in those rakefiles.
It's really ugly in the Shoes extconf.rb for the Shoes extensions and gems. I don't like it either but Ruby has its way and embedded ruby with ext and gems is not something the Ruby folk think about. I'm not pointing a finger at them or anyone else. Work with what you have.
Don't let me discourge you from trying, it's not that hard now that you've seen the hints. Perhaps you see a better way that I missed. Good. Try it and let us know.