Skip to content

Commit

Permalink
Merge pull request #19 from ska-sa/casacore30
Browse files Browse the repository at this point in the history
Update casacore to 3.1.1 and make less version needy
  • Loading branch information
ludwigschwardt committed Jun 12, 2019
2 parents 0898111 + 4d13249 commit ca26a14
Showing 1 changed file with 11 additions and 38 deletions.
49 changes: 11 additions & 38 deletions casacore.rb
@@ -1,34 +1,24 @@
class Casacore < Formula
desc "Suite of C++ libraries for radio astronomy data processing"
homepage "https://github.com/casacore/casacore"
url "https://github.com/casacore/casacore/archive/v2.4.1.tar.gz"
sha256 "58eccc875053b2c6fe44fe53b6463030ef169597ec29926936f18d27b5087d63"
url "https://github.com/casacore/casacore/archive/v3.1.1.tar.gz"
sha256 "85d2b17d856592fb206b17e0a344a29330650a4269c80b87f8abb3eaf3dadad4"
head "https://github.com/casacore/casacore.git"

option "without-cxx11", "Build without C++11 support"

depends_on "cmake" => :build
depends_on "cfitsio"
depends_on "brewsci/science/wcslib"
depends_on "python@2" => :recommended
depends_on "python" => :optional
depends_on "wcslib"
depends_on "fftw"
depends_on "hdf5"
depends_on "readline"
depends_on "gcc" # for gfortran
depends_on "python" => :recommended
depends_on "boost-python"
depends_on "numpy"
depends_on "casacore-data"
depends_on "gcc"

if build.with?("python@2")
# Boost 1.67 changed the Python library name and cmake 3.11.3 doesn't like it
# Remove the version pin once cmake catches up
# See https://gitlab.kitware.com/cmake/cmake/merge_requests/1865
depends_on "boost-python@1.59"
depends_on "numpy"
end

if build.with?("python")
depends_on "boost-python@1.59" => "with-python"
depends_on "numpy"
depends_on "boost-python3"
end

def install
Expand All @@ -39,26 +29,9 @@ def install
cmake_args = std_cmake_args
cmake_args.delete "-DCMAKE_BUILD_TYPE=None"
cmake_args << "-DCMAKE_BUILD_TYPE=#{build_type}"
cmake_args << "-DCXX11=False" if build.without? "cxx11"

if build.with? "python@2"
cmake_args << "-DBUILD_PYTHON=ON"
cmake_args << "-DPYTHON2_EXECUTABLE=/usr/local/bin/python2"
cmake_args << "-DPYTHON2_LIBRARY=/usr/local/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib"
# XXX Remove once cmake handles Boost 1.67
cmake_args << "-DBOOST_ROOT=/usr/local/opt/boost@1.59;/usr/local/opt/boost-python@1.59"
else
cmake_args << "-DBUILD_PYTHON=OFF"
end

if build.with? "python"
cmake_args << "-DBUILD_PYTHON3=ON"
cmake_args << "-DPYTHON3_EXECUTABLE=/usr/local/bin/python3"
cmake_args << "-DPYTHON3_LIBRARY=/usr/local/Frameworks/Python.framework/Versions/3.6/lib/libpython3.6.dylib"
# XXX Remove once cmake handles Boost 1.67
cmake_args << "-DBOOST_ROOT=/usr/local/opt/boost@1.59;/usr/local/opt/boost-python@1.59"
end

cmake_args << "-DCMAKE_SHARED_LINKER_FLAGS='-undefined dynamic_lookup'"
cmake_args << "-DBUILD_PYTHON=ON"
cmake_args << "-DBUILD_PYTHON3=ON" if build.with? "python"
cmake_args << "-DUSE_FFTW3=ON" << "-DFFTW3_ROOT_DIR=#{HOMEBREW_PREFIX}"
cmake_args << "-DUSE_HDF5=ON" << "-DHDF5_ROOT_DIR=#{HOMEBREW_PREFIX}"
cmake_args << "-DUSE_THREADS=ON" << "-DDATA_DIR=#{HOMEBREW_PREFIX}/share/casacore/data"
Expand Down

0 comments on commit ca26a14

Please sign in to comment.