Posts Tagged ‘os x’

Compiling Golden Cheetah with Twitter+OAuth

Thursday, August 12th, 2010

Screen shot 2010-08-12 at 22.01.08Justin added a Twitter posting feature to Golden Cheetah a couple weeks ago. However, it used basic authentication, which Twitter has announced is going away in favor of OAuth only. So, after several more days of coding he did a bang up job of rolling in support using liboauth.

Now, getting liboauth and it’s prerequisites configured to play nicely with my Golden Cheetah dev environment has been another struggle. I have been making the OS X releases of Golden Cheetah for a while – and we package them as a universal binary (i386/ppc) with 10.4 support. I’ve had to custom compile Qt, QWT, srmio and all that stuff to enable this.

In brief, liboauth needed to be compiled against the same arch that GC and co. have been, and it really wanted to go native, eg x86_64 on my MacBook Pro. After a night and day of tinkering…here’s what worked. Thanks to Justin for getting this going.

Export config flags (just makes life easier on the command line):

export CFLAGS=-mmacosx-version-min=10.4
export CPPFLAGS=-mmacosx-version-min=10.4

openssl 1.0.0a:

./config -m32

liboauth 0.8.8 / curl 7.21.1:

./configure CC="gcc -arch i386" CXX="g++ -arch i386" -host i386

Golden Cheetah:

After getting linker errors for a while, I realized that I had to directly link to the static version of libcrypto that was installed alongside libssl in /usr/local/ssl.

Undefined symbols:
  "_EVP_MD_size", referenced from:
      _oauth_body_hash_file in liboauth.a(liboauth_la-hash.o)
      _oauth_body_hash_data in liboauth.a(liboauth_la-hash.o)
ld: symbol(s) not found

Here’s the relevant bit of src.pro:

!isEmpty( LIBOAUTH_INSTALL ) {
INCLUDEPATH += $${LIBOAUTH_INSTALL}/include
LIBS += /usr/local/ssl/lib/libcrypto.a
LIBS +=  $${LIBOAUTH_INSTALL}/lib/liboauth.a
LIBS += -lz
LIBS += -lcurl
DEFINES += GC_HAVE_LIBOAUTH
SOURCES += TwitterDialog.cpp
HEADERS += TwitterDialog.h
}

git outta here…

Friday, July 3rd, 2009

I’m switching my Source Control Management  software to git. Performance has been great, I’m learning to branch and merge with wild abandon and philosophically it’s right on (what with the distributed model and all).

Creating a new remote repository on my private server was *almost* too easy. The one snafu was getting sshd to include the git binary path for non-interactive login. To save me the trouble of having to look this up again later, add a .bashrc file to your user dir:

export PATH=/usr/local/git/bin:$PATH

Other steps, again for reference.

  • Download the git installer
  • Create a new bare repo on the remote machine:
mkdir -p /path/to/remote/repo.git
cd /path/to/remote/repo.git
git --bare init
exit
  • Add the remote repository to the local machine:
git remote add origin ssh://server/path/to/remote/repo.git
git push origin master
  • Done!

(Unless, of course you get the following message try the .bashrc workaround above)

bash: git-receive-pack: command not found

OS X Leopard’s Alex text-to-speech…breathing?

Wednesday, September 24th, 2008

Maybe this is old news…but it was a surprise to me when I thought I heard the (relatively) new Alex voice inhaling when speaking some text. Try it out yourself, using TextEdit (spelled to aid pronunciation):

This is a test. Didd I juhst take a breath? (Yes, I will). I hope so, I really need too breathe at some point.

Weird – and awesome at the same time. The breath sound really does something to put me at ease when listening to the speech. I found myself unconsciously holding my breath until I heard him breathe.