Skip to content

Building Shoes on Pi2

Cecil Coupe edited this page Dec 26, 2015 · 8 revisions

This was almost too easy

My new Raspberry Pi 2, using Raspbian already has ruby 1.9.3 and git installed. Gcc is Debian 4.6.3-14+rpi1.

I mounted the Shoes directory with NFS but it you want to download it from git

  • git clone https://github.com/Shoes3/shoes3.git
  • cd shoes3

While 1.9.3 is usable with Shoes3.2, it doesn't have rake. Might as well install rvm and Ruby 2.1.5 and a recent Rubygems version.

Rvm gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 \curl -sSL https://get.rvm.io | bash -s stable

logout and log back in and make sure ~/.rvm is in your PATH. Then do rvm install 2.1.5 -C --enable-load-relative which will trundle off and download some ruby dependencies before starting the build.

Installing required packages: gawk, libreadline6-dev, libssl-dev, libyaml-dev, libsqlite3-dev, sqlite3, autoconf, libgdbm-dev, libncurses5-dev, automake, libtool, bison, libffi-dev

Thank you RVM!

It will then proceed to downloading the ruby source, configure it (a slow process), compiling it (slower process). That was plenty of time to get another terminal open and install the Shoes dependencies at the same time. sudo apt-get install libgtk2.0-dev libungif4-dev libjpeg8-dev When they both finish I can build Loose Shoes. Just cd into the Shoes source directory and 'rake'. That's it. ./dist/shoes and it its running.

Shoes you can distribute

The above instruction build a Loose Shoes which you can't distribute. Building a Tight Shoes is a little more work. For Shoes 3.3.0 I chose to stop cross compiling (a pi2 is about the same speed as as the qemu arm chroot but uses an older debian wheezy with a pretty old gcc cross compiler)

Note: the package names vary between distribution and versions so you have to figure that. Add libcroco3-dev and librsvg2-dev (which drags in libxml2-dev)

This particular sd card has raspbian 4.1.7-v7+ and doesn't have rvm but it does have ruby 2.1.5p273 in /usr/bin. You'll need it to build Ruby from source. I want the 2.1.8 ruby in /usr/local/bin and /usr/local/bin and I want to set some options so I download ruby-2.1.8.tar.gz, expanded it, cd into ruby-2.1.8 and run this script

#! /bin/bash
# copy this to the ruby dir or soft link it.
# execute it instead of ./configure
export dest="/usr/local"
export CPPFLAGS="-I${dest}/include"
export LDFLAGS="-L${dest}/lib"
./configure \
  --enable-shared \
  --enable-load-relative \
  --disable-install-doc \
  --without-tk --without-tcllib --without-tcltk \
  --prefix="${dest}"

then make and sudo make install if everything is configured properly in the ruby build. It will take you one or two times and each make can take quite some time - I'm using a class 10 SDHC chip for the raspbian and an external usb to hold the files. Still takes a long time.

We don't have to update bash files to include /usr/local/bin in the $PATH but it's in my PATH.

$ /usr/local/bin/ruby -v
ruby 2.1.8p440 (2015-12-16 revision 53160) [armv7l-linux-eabihf]

Not the most complete test but it's good enough for now. Now we need to update /usr/local/bin/gem which is horribly out of date. Before we do that, lets make sure we don't build gem doc (they'll end up bloating Shoes with stuff the user can't get to). Since gems are user local in this case, we can create ~/.gemrc and add this line:

gem: --no-document # skip installation of all documentation.

Update the gems and hope for the best with no-doc since it's a sudo operation.

sudo gem update --system 

Well that didn't work as well a I wanted. It installed gem doc for working with gems. Version 2.5.1 - we'll just have to proceed on.

 
Clone this wiki locally