diff --git a/.travis.yml b/.travis.yml index a2a46544e98fde4696c03bf0a9c087cae70397a3..1310435052a483e62f579e6aac24cab81ed30aaa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,7 +27,9 @@ env: before_script: - if [ "$TRAVIS_OS_NAME" == "linux" ]; then ./_travis/prepare_linux.sh ; fi + - if [ "$TRAVIS_OS_NAME" == "osx" ]; then ./_travis/prepare_osx.sh ; fi script: - - ./build_on_travis.sh + - if [ "$TRAVIS_OS_NAME" == "linux" ]; then ./_travis/build_on_linux.sh ; fi + - if [ "$TRAVIS_OS_NAME" == "osx" ]; then ./_travis/build_on_osx.sh ; fi diff --git a/_travis/moose.rb b/_travis/moose.rb new file mode 100644 index 0000000000000000000000000000000000000000..2d86c84b4a348c25e966a02064d68be67f6e2853 --- /dev/null +++ b/_travis/moose.rb @@ -0,0 +1,52 @@ +class Moose < Formula + include Language::Python::Virtualenv + + desc "Multiscale Object Oriented Simulation Environment" + homepage "http://moose.ncbs.res.in" + url "https://github.com/BhallaLab/moose-core/archive/3.1.2.tar.gz" + sha256 "a542983e4903b2b51c79f25f4acc372555cbe31bc0b9827302a6430fad466ef7" + head "https://github.com/BhallaLab/moose-core.git" + + bottle do + cellar :any + sha256 "6077f886560480c956270f855cf9576a3e8261c5f2ea064117c3483f74a84462" => :sierra + sha256 "a637de34ce0b92f16afc120ecb2e0e4aff8f8a2e6a2ada5521ee01cf7ccdca9e" => :el_capitan + sha256 "1bb0712ef178577a3c44190be8f21f894cddc66ce03f742d768e44371425dce7" => :yosemite + sha256 "a62366e1e1de37c13dec6d2b7f91dc63f8b40ab460e35b31a4d94507a0df6219" => :x86_64_linux + end + + depends_on "cmake" => :build + depends_on "gsl" + depends_on "hdf5" + depends_on :python if MacOS.version <= :snow_leopard + depends_on "numpy" + + def install + (buildpath/"VERSION").write("#{version}\n") + # FindHDF5.cmake needs a little help + ENV.prepend "LDFLAGS", "-lhdf5 -lhdf5_hl" + + args = std_cmake_args + args << "-DCMAKE_SKIP_RPATH=ON" + mkdir "_build" do + system "cmake", "..", "-DPYTHON_EXECUTABLE:FILEPATH=#{which("python")}", *args + system "make" + system "ctest", "--output-on-failure" + end + + Dir.chdir("_build/python") do + system "python", *Language::Python.setup_install_args(prefix) + end + end + + def caveats; <<-EOS.undent + You need to install `networkx` and `python-libsbml` using python-pip. Open terminal + and execute following command: + $ pip install python-libsbml networkx + EOS + end + + test do + system "python", "-c", "import moose" + end +end diff --git a/_travis/prepare_linux.sh b/_travis/prepare_linux.sh old mode 100644 new mode 100755 diff --git a/_travis/prepare_osx.sh b/_travis/prepare_osx.sh new file mode 100755 index 0000000000000000000000000000000000000000..0d9bca89f93add37eae02bb4cde6dc251498f75f --- /dev/null +++ b/_travis/prepare_osx.sh @@ -0,0 +1,24 @@ +#!/bin/bash - +#=============================================================================== +# +# FILE: prepare_osx.sh +# +# USAGE: ./prepare_osx.sh +# +# DESCRIPTION: +# +# OPTIONS: --- +# REQUIREMENTS: --- +# BUGS: --- +# NOTES: --- +# AUTHOR: Dilawar Singh (), dilawars@ncbs.res.in +# ORGANIZATION: NCBS Bangalore +# CREATED: Wednesday 28 June 2017 10:23:28 IST +# REVISION: --- +#=============================================================================== + +set -o nounset # Treat unset variables as an error +brew install gsl +brew install cmake +brew install homebrew/science/hdf5 +brew install homebrew/science/matplotlib