Skip to content

Instantly share code, notes, and snippets.

@sbesson
Forked from joshmoore/README.md
Created March 22, 2012 20:21
Show Gist options
  • Save sbesson/2163398 to your computer and use it in GitHub Desktop.
Save sbesson/2163398 to your computer and use it in GitHub Desktop.
Bootstrap script for creating and installing OMERO via Homebrew.

The instructions for installing OMERO on Mac OS X using Homebrew are available in the OMERO documentation.

#!/bin/bash
set -e
set -u
DIR=$1
shift
OMERO_GIT=${OMERO_URL:-git://github.com/joshmoore/homebrew.git}
OMERO_URL=${OMERO_URL:-https://github.com/joshmoore/homebrew/tarball/omero}
OMERO_BRANCH=${OMERO_BRANCH:-omero-only}
VENV_URL=${VENV_URL:-https://raw.github.com/pypa/virtualenv/master/virtualenv.py}
TABLES_GIT=${TABLES_GIT:-git+https://github.com/PyTables/PyTables.git@master}
###################################################################
# BREW & PIP BASE SYSTEMS
###################################################################
# Brew support ===================================================
if ("$DIR/bin/brew" --version)
then
echo "Using brew installed in $DIR"
cd "$DIR"
else
if (git --version)
then
git clone -b "$OMERO_BRANCH" "$OMERO_GIT" "$DIR"
cd "$DIR"
else
mkdir -p "$DIR"
cd "$DIR"
curl -L "$OMERO_URL" | /usr/bin/tar --strip-components=1 -xvf -
bin/brew install git
bin/git init
bin/git remote add omero "$OMERO_GIT"
bin/git fetch omero
bin/git checkout -b "$OMERO_BRANCH"
fi
fi
# Python virtualenv/pip support ===================================
if (bin/pip --version)
then
echo "Using existing pip"
else
rm -rf virtualenv.py
curl -O "$VENV_URL"
python virtualenv.py --no-site-packages .
fi
###################################################################
# BREW INSTALLS
###################################################################
installed(){
bin/brew list | grep -wq $1 && {
echo $1 installed.
} || {
return 1
}
}
# Setup PATH ======================================================
# ccache is optional but makes things faster for devs
installed ccache || bin/brew install ccache
export PATH=`bin/brew --prefix ccache`:`pwd`/bin/:$PATH
# Basic native requirements =======================================
installed pkg-config || bin/brew install pkg-config # for matplotlib
installed hdf5 || bin/brew install hdf5 # Used by pytables
installed berkeley-db46 || bin/brew install berkeley-db46 --without-java
installed zeroc-ice33 || bin/brew install zeroc-ice33
# Requirements for PIL ============================================
installed libjpeg || bin/brew install libjpeg
###################################################################
# PIP INSTALLS
###################################################################
installed(){
PKG=$1; shift
bin/pip freeze "$@" | grep -q "^$PKG==" && {
echo $PKG installed.
} || {
return 1
}
}
# Python requirements =============================================
installed numpy || bin/pip install numpy
installed PIL || bin/pip install PIL
#
# Various issues with matplotlib. See the following if you have problems:
# -----------------------------------------------------------------------
# http://superuser.com/questions/242190/how-to-install-matplotlib-on-os-x
# http://jholewinski.org/blog/installing-matplotlib-on-os-x-10-7-with-homebrew/
#
export LDFLAGS="-L/usr/X11/lib"
export CFLAGS="-I/usr/X11/include -I/usr/X11/include/freetype2 -I/usr/X11/include/libpng12"
installed matplotlib || bin/pip install matplotlib
# PyTables requirements ===========================================
export HDF5_DIR=`pwd`
installed Cython || bin/pip install Cython
installed numexpr || bin/pip install numexpr
bin/pip freeze | grep -q tables-dev || bin/pip install -e $TABLES_GIT#egg=tables
echo "Done."
echo "You can now install OMERO with: 'bin/brew install omero43 ...'"
@sbesson
Copy link
Author

sbesson commented Mar 23, 2012

Thanks @joshmoore, I rewrote part of the README to include some of the errors/warnings I faced.
I am still struggling with the zeroc-ice33 installation (same log as http://trac.openmicroscopy.org.uk/ome/attachment/ticket/8075/sebastien.txt).
The rest of the script ran just fine.

@joshmoore
Copy link

joshmoore commented Mar 23, 2012 via email

@joshmoore
Copy link

Also, @sbesson, looking at the log from 8075, I seem to remember Simon having something similar. Have you tried starting from a new brew directory?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment