Skip to content

Instantly share code, notes, and snippets.

@lantiga
Created June 10, 2017 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lantiga/64b89fbb1f2ce5875bb21558d1599811 to your computer and use it in GitHub Desktop.
Save lantiga/64b89fbb1f2ce5875bb21558d1599811 to your computer and use it in GitHub Desktop.
Brew formula for vmtk 1.3.2
class Vmtk < Formula
desc "The Vascular Modeling Toolkit"
homepage "http://www.vmtk.org"
url "https://github.com/vmtk/vmtk/archive/v1.3.2.tar.gz"
version "1.3.2"
sha256 "2632a74341605bd3ddd97971fad70941329e77a112f9363bc5053a1e2ba7c30e"
head "https://github.com/vmtk/vmtk.git"
revision 1
# bottle do
# sha256 "" => :el_capitan
# end
depends_on "cmake" => :build
depends_on "vtk"
depends_on "insightToolkit"
depends_on :python
def install
args = std_cmake_args + %W[
-DBUILD_TESTING=OFF
-DBUILD_SHARED_LIBS=ON
-DCMAKE_INSTALL_RPATH:STRING=#{lib}
-DCMAKE_INSTALL_NAME_DIR:STRING=#{lib}
]
args << ".."
args << "-DUSE_SYSTEM_ITK=ON"
args << "-DITK_DIR=#{HOMEBREW_CELLAR}/insighttoolkit/4.9.0"
args << "-DUSE_SYSTEM_VTK=ON"
args << "-DVTK_DIR=#{HOMEBREW_CELLAR}/vtk/7.1.0"
args << "-DVMTK_USE_SUPERBUILD=OFF"
args << "-DUSE_VTK6_SUPERBUILD=OFF"
args << "-DVMTK_USE_RENDERING=ON"
args << "-DVTK_WRAP_PYTHON=ON"
args << "-DPYTHON_EXECUTABLE=#{`which python`}"
args << "-DPYTHON_LIBRARY='#{`python-config --prefix`.chomp}/lib/libpython2.7.dylib'"
args << "-DPYTHON_INCLUDE_DIR='#{`python-config --prefix`.chomp}/include/python2.7'"
args << ".."
mkdir "build" do
system "cmake", *args
system "make"
system "make", "install"
end
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 vmtk`. Options passed
# to `brew install` such as `--HEAD` also need to be provided to `brew test`.
#
# The installed folder is not in the path, so use the entire path to any
# executables being tested: `system "#{bin}/program", "do", "something"`.
system "false"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment