Skip to content

Instantly share code, notes, and snippets.

@asford
Last active January 1, 2016 04:39
Show Gist options
  • Save asford/8092922 to your computer and use it in GitHub Desktop.
Save asford/8092922 to your computer and use it in GitHub Desktop.
Boost.Numpy and ndarray homebrew formula.
require 'formula'
class BoostNumpy < Formula
homepage 'https://github.com/ndarray/'
url '[email protected]:asford/Boost.NumPy.git', :using => :git, :branch => 'master'
version "0.0.1"
depends_on 'scons' => :build
depends_on 'boost' => 'with-python'
depends_on 'numpy' => :python
def install
args = [
"--with-boost-include=#{HOMEBREW_PREFIX}/include",
"--with-boost-lib=#{HOMEBREW_PREFIX}/lib",
"--prefix=#{prefix}"
]
system "scons", *args
system "scons", "install", *args
end
end
require 'formula'
class Ndarray < Formula
homepage 'https://github.com/ndarray/'
url 'https://github.com/ndarray/ndarray.git', :using => :git, :branch => 'master'
version "0.0.1"
depends_on 'scons' => :build
depends_on 'eigen'
depends_on 'boost' => 'with-python'
depends_on 'numpy' => :python
def install
args = [
"--with-eigen-include=" + %x[pkg-config eigen3 --cflags-only-I][2..-1].strip,
"--with-boost-include=#{HOMEBREW_PREFIX}/include",
"--with-boost-lib=#{HOMEBREW_PREFIX}/lib",
"--prefix=#{prefix}"
]
system "scons", "include", "m4", "Boost.NumPy", *args
## Temporary workaround for test ordering
system "scons", "tests/.ndarray.cc.succeeded", *args
system "scons", "tests", *args
system "scons", *args
system "scons", "install", *args
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment