2011-09-29 03:11:06 +00:00
|
|
|
class Clhep < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Class Library for High Energy Physics"
|
2015-08-10 20:36:18 +00:00
|
|
|
homepage "https://proj-clhep.web.cern.ch/proj-clhep/"
|
2015-12-06 20:59:53 +00:00
|
|
|
url "https://proj-clhep.web.cern.ch/proj-clhep/DISTRIBUTION/tarFiles/clhep-2.3.1.1.tgz"
|
|
|
|
sha256 "0e2b170df99176feb0aa4f20ea3b33463193c086682749790c5b9b79388d0ff4"
|
2011-09-29 03:11:06 +00:00
|
|
|
|
2014-07-25 02:07:42 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any
|
2015-12-06 23:02:32 +00:00
|
|
|
sha256 "2201b22072c449346bea78bbad4f46fccd968b11b342c83310c25e79c16f0997" => :el_capitan
|
|
|
|
sha256 "18e6581c3d9d83e9853283c4d00e021701135b502432bab291c8e4a7e8e9e6db" => :yosemite
|
|
|
|
sha256 "c17e92f408af3768b363ea226e158c5008371e383a2f963fcc565bd7ba28c899" => :mavericks
|
2014-07-25 02:07:42 +00:00
|
|
|
end
|
|
|
|
|
2015-08-10 05:21:39 +00:00
|
|
|
head do
|
|
|
|
url "http://git.cern.ch/pub/CLHEP", :using => :git
|
|
|
|
depends_on "automake" => :build
|
|
|
|
depends_on "autoconf" => :build
|
|
|
|
end
|
|
|
|
|
2014-04-19 18:55:57 +00:00
|
|
|
depends_on "cmake" => :build
|
|
|
|
|
2011-09-29 03:11:06 +00:00
|
|
|
def install
|
2015-08-10 05:21:39 +00:00
|
|
|
# CLHEP is super fussy and doesn't allow source tree builds
|
|
|
|
dir = Dir.mktmpdir
|
|
|
|
cd dir do
|
|
|
|
args = std_cmake_args
|
|
|
|
if build.stable?
|
|
|
|
args << "#{buildpath}/CLHEP"
|
|
|
|
else
|
|
|
|
args << "#{buildpath}"
|
|
|
|
end
|
|
|
|
system "cmake", *args
|
2014-12-18 19:33:03 +00:00
|
|
|
system "make", "install"
|
2011-09-29 03:11:06 +00:00
|
|
|
end
|
|
|
|
end
|
2015-08-10 05:21:39 +00:00
|
|
|
|
|
|
|
test do
|
|
|
|
(testpath/"test.cpp").write <<-EOS.undent
|
|
|
|
#include <iostream>
|
|
|
|
#include <Vector/ThreeVector.h>
|
|
|
|
|
|
|
|
int main() {
|
|
|
|
CLHEP::Hep3Vector aVec(1, 2, 3);
|
|
|
|
std::cout << "r: " << aVec.mag();
|
|
|
|
std::cout << " phi: " << aVec.phi();
|
|
|
|
std::cout << " cos(theta): " << aVec.cosTheta() << std::endl;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
EOS
|
|
|
|
system ENV.cxx, "-L#{lib}", "-lCLHEP", "-I#{include}/CLHEP",
|
|
|
|
testpath/"test.cpp", "-o", "test"
|
|
|
|
assert_equal "r: 3.74166 phi: 1.10715 cos(theta): 0.801784",
|
|
|
|
shell_output("./test").chomp
|
|
|
|
end
|
2011-09-29 03:11:06 +00:00
|
|
|
end
|