Skip to content
Cecil Coupe edited this page Jan 1, 2019 · 16 revisions

Breaking news - there is vagrant support. You still need to know everything below.

Building Shoes from source

I'm going to apologize right up top. This is not as easy as you expect nor as easy as we would like. Here's an overview of how it works

dev-figure-1

Rake in action

Get a list of all targets for you platform. The not all targets are available for all platforms. Linux is more equal than others.

$ rake -T
rake build           # Build using your OS setup
rake clean           # remove objects and libshoes.dylib
rake clobber         # remove all build products
rake default         # Same as `rake build'
rake package         # Package Shoes for distribution
rake setup:darwin14  # Setup for OSX 10.10+ (osxcross tools)
rake setup:lin64     # Setup for Linux X86_64 (chroot)
rake setup:minlin    # Minimal Shoes for linux (default)
rake setup:mxe       # Setup for Windows 7+ (MXE tools - recommended)
rake setup:xlin64    # Setup for Linux x86_64
rake setup:xrpi      # Setup for Linux armeabihf (Pi) using X86_64-linux
rake setup:xwin7     # Setup for Win7+ using Linux (debian tools)
rake stubs           # Build stubs (MinGW cross compile only)

Pick one. Lets cross compile for Windows

$ rake setup:mxe
$ rake

The bare rake notes that you picked a setup so it does some setup things like copying gems and ruby and then proceeds to compile all the code, link it together and create the shoes.exe and cshoes.exe launchers. If you modify one of the source files and do 'rake' again, only that file and any dependent on it are recompiled.

rake clean deletes all of the compiled object files so the next 'rake' will compile everything. rake clobber deletes everything including your setup choice.

Rake files and custom.yaml

Custom.yaml files are something you have to create to describe where to find things on your system. There is no way to guess where things are for everyone. It also gives you, the developer, a lot of flexibility.

If you are new to Shoes and are running Linux, OSX, or BSD you should start with the 'minxxx' targets because they don't need custom.yaml files, the build with debug symbols and are very pleasant to work with. They have one limitation and it's important - You can't package them for distribution. They won't work on any system but yours.

See Custom Yaml for the details on custom.yaml files.

Dependencies

Here is where the bulk of ugly lives. Shoes uses lots of open source libraries which we call dependencies. Ruby is a dependency and the the libraries Ruby needs are also dependencies. We need to build A Ruby our way and it lib's and then the libs Shoes wants. It's not hard if you know how to read error messages (some folks do get confused - so it's a skill to learn). It may not be hard but it is a lengthy process - give your self a couple of full days OR you can download prebuild dependencies for OSX 10.10 and Windows.

Linux is not a free walk either because we setup chroots and install an older version of Linux in it before we build Ruby in it and apt-get all the easy stuff. It's even more interesting settup up chroot that runs QEMU before we install the armhf debian and use it to build dependencies (including Ruby). It takes time and some Linux knowledge to set things up for a Tight Shoes build.

Show me the stuff:

Shoes fit

Tight Shoes is one you can bundle up and send to someone else. It lives in its own sandbox and includes a copy of Ruby (the Ruby it was built with). Your Ruby is probably not built to do that successfully. It's called Tight because its a very controlled setup.

Loose Shoes doesn't have those restrictions it just uses whatever it can find for a Ruby and it links against that Ruby's libs. It doesn't have to carry around a copy of Ruby or bundle up dependencies and gems. That makes it small and quick to compile and you can install it (on your system) if you like it. It allows Shoes access to all the gems you've installed. What you can't do is distribute that Shoes.

In Windows, the tight/loose distinction is a little more subtle because you have to have all the DLL's in any Shoes but the distinction still exists (gems primarily), even on Windows.

In OSX there is no difference between tight and loose - it's always tight.

Clone this wiki locally