Matt Connolly's Blog

my brain dumps here…

Monthly Archives: April 2013

Building Ruby 2 in SmartOS

Installing Ruby 2 in SmartOS!

Ruby 2 has been out for a while, so let’s get it going in SmartOS!!

I’m working with the SmartMachine (base64 1.9.0).

Part 1: Requirements.

The SmartMachine has a whole bunch of useful packages already installed. Here are the additional packages needed to build Ruby 2.0.0 in SmartOS:

# pkgin install build-essential gcc47 gcc47-libs libyaml 

Part 2: Configure hacks

There are a few issues with Ruby 2.0.0, but fortunately all of them have a command line workaround.

1. Ruby bug #5384 https://bugs.ruby-lang.org/issues/5384

Actually an upstream bug in (Open)Solaris/Illumos/OpenIndiana/SmartOS. Workaround is to add `ac_cv_func_dl_iterate_phdr=no` to the configure line.

See also: https://www.illumos.org/issues/1587

2. Ruby bug #8071 https://bugs.ruby-lang.org/issues/8071

Non-portable code in ruby’s configure scipt. Easy workaround, prepend the configure command with a shell that can handle the current state of the configure script, ie: `bash`. (A fix has already been submitted, ans should be in the next ruby patch.)

3. Ruby bug #8268 https://bugs.ruby-lang.org/issues/8268

“-ggdb3″ C flags issue (logged with Ruby, but not necessarily actually a bug in ruby. Please help if you can on this one!)

Workaround 1: Add `debugflags=”-ggdb”` to the configure line. Caveat: It appears this will add gdb debug info to built ruby binaries, which may not be desired.

Workaround 2: Add `CFLAGS=”-R -fPIC”`. This introduces a make error. Missing function ‘signbit’. Boo.

Workaround 3: Add `CFLAGS=”-R -fPIC” rb_cv_have_signbit=no`. Works!

So with these three taken care of, the following command line will configure ruby-2.0.0-p0 to compile on SmartOS (in 64 bit):

$ bash ./configure --prefix=$PREFIX --with-opt-dir=/opt/local --enable-shared ac_cv_func_dl_iterate_phdr=no CFLAGS="-R -fPIC" rb_cv_have_signbit=no
$ make && make install

And there we have it. Ruby 2.0.0-p0 building in SmartOS. Next challenge, making use of those built in DTrace probes…

How to get “Getting Things Done” eBook in Australia

A few friends / colleagues have told me about David Allen’s book “Getting Things Done”. So I thought I’d check it out.

Turns out, it’s hard to get in Australia:

The Australian title of Getting Things Done is “How to Get Things Done”
see: http://www.davidco.com/getting-things-done/international-editions

Amazon now sell the kindle version of that name for 50% more than the price of the US version.
US Kindle Edition $12.99 USD
AUS Kindle Edition $19.29 AUD (~20.23USD)
http://www.amazon.com/How-Get-Things-Done-ebook/dp/B00B5KPVQM/ref=tmm_kin_title_0?ie=UTF8&qid=1365542478&sr=1-1

It isn’t available through Apples iBook store.

You can purchase the ebook directly through penguin Australia for AUD $17.99 (~18.89 USD)
http://www.penguin.com.au/products/9781742538709/how-get-things-done

I bought this one (not wanting to pay the highest price). The DRM protected version is hard to get going. You need to register with Adobe digital editions and find a computer or ipad app that can log in to Adobe’s service so that you can then read it.
http://www.adobe.com/au/products/digital-editions.html

You need to install the Adobe Editions software on Mac / Windows PC, then register the purchase and convert the downloaded file into a DRM signed eBook. (Penguin Books don’t tell you any of this.) Then you need to find a reader that will open the eBook:

List of devices:
http://blogs.adobe.com/digitalpublishing/supported-devices

I already had the “Readmill” reader app on my iPad, and even though it isn’t listed in the supported devices, it could open the eBook after signing in to Adobe’s servers with my new Adobe account.

I’m very technically proficient and I found this a very difficult process to go through. It’s a shame that a legitimate purchase is **so hard**.

I would not recommend going down the Penguin books eBook path. It is painful.

If the publishers just made it available on Amazon for less than ridiculous price conversion and iBook store, it would be much easier. While trying to figure out how to do all this, I found several sites in Russia where I could download a pirated PDF of the book.

My preferred option would the Apple iBook store at a reasonable price. (ie: parity pricing with US product + 10% GST would be ideal). But I guess that’s in the hands of the Australian publisher isn’t it?