Skip to content

Instantly share code, notes, and snippets.

@ties
Created July 3, 2013 11:14
Show Gist options
  • Save ties/5917096 to your computer and use it in GitHub Desktop.
Save ties/5917096 to your computer and use it in GitHub Desktop.
require 'formula'
class Bob < Formula
homepage ''
url 'https://www.idiap.ch/software/bob/packages/bob-1.1.4.zip'
sha1 'be4385daab4e11af3f91fb09d2d1d54629f1a59c'
# dependencies from <http://www.idiap.ch/software/bob/docs/nightlies/last/bob/sphinx/html/Dependencies.html>
# depends_on 'cmake' => :build
depends_on 'blitz'
# lapack: provided
depends_on :python
depends_on 'boost'
depends_on 'numpy'
depends_on 'scipy'
depends_on 'matplotlib'
depends_on 'fftw'
# libjpeg is always available
depends_on 'netpbm'
depends_on 'libpng'
depends_on 'libtiff'
depends_on 'giflib'
depends_on 'hdf5'
# OS X has python 2.7 => argparse is always available
depends_on 'nose' => :python
# "optional"
depends_on 'ffmpeg'
depends_on 'libmatio'
depends_on 'libsvm'
def install
args = std_cmake_args + %W[
-DCMAKE_BUILD_TYPE=Release
-DPYTHON_INCLUDE_DIR='#{python.incdir}'
-DPYTHON_LIBRARY='#{python.libdir}/lib#{python.xy}.dylib'
]
# ensure sqlalchemy and sphinx exist.
# since this is not a brew package, I call pip (_bad_ style)
system "pip", "install", "sphinx"
system "pip", "install", "sqlalchemy"
system "cmake", ".", *args
system "make", "install" # if this fails, try separate make/make install steps
end
test do
# `test do` will create, run in and delete a temporary directory.
#
# This test will fail and we won't accept that! It's enough to just replace
# "false" with the main program this formula installs, but it'd be nice if you
# were more thorough. Run the test with `brew test bob`.
system "python -c \"import bob\""
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment