@@ -11,44 +11,55 @@ class Beagle < Formula
1111 end
1212
1313 bottle do
14- sha256 cellar : :any , arm64_sequoia : "68b15491189b2d39203b4675128f67e2757f7c32a61fd6771495ad634ec1b1f3"
15- sha256 cellar : :any , arm64_sonoma : "b6d8ccd22a1a3dd0fc66aa753d774382005e10a6c92102af898a8c48a249e2d6"
16- sha256 cellar : :any , arm64_ventura : "3d83a1652998bf200c2b1a7942fb3946d751a9d647f46b1275109e49c48be695"
17- sha256 cellar : :any , arm64_monterey : "8ec46e2c91cff30977deec35fc3e01707f11f81960075c16da25edb8a6f9ca8c"
18- sha256 cellar : :any , sonoma : "da4b28f050e38cfafa7cdcfaef9cec21e01f9335a609ea2e415357c8fe901da4"
19- sha256 cellar : :any , ventura : "b59a52ec3fac58ea5c9e1b9e9240befe1f3d81fb30803c8c1028047f3d192cdb"
20- sha256 cellar : :any , monterey : "ab9a7a95580ffe99fde279ce650f66a39fc3f1065c9cf767feb4b2bec6f71b3d"
21- sha256 cellar : :any_skip_relocation , x86_64_linux : "5a8fce3c841addff79fd9d784f923a29b7e5f3549ce75b91c2d895f83542411c"
14+ rebuild 1
15+ sha256 cellar : :any , arm64_sequoia : "fe362a0f25bf169bb507df13e17e4647a85b185383308fa2c6907bf57a0c3bc9"
16+ sha256 cellar : :any , arm64_sonoma : "a15730feb6101837d824ccc36397e4f777e450312e3e142b5e0a4752f44cfb4b"
17+ sha256 cellar : :any , arm64_ventura : "630068ff93debb8af7e06748abb07dc1637467795b01bbd04aca01212a23c683"
18+ sha256 cellar : :any , sonoma : "1a82a444e21aaf6ed87d13d100fe09bf5dada1f97794a349cb66e429d35ed7dd"
19+ sha256 cellar : :any , ventura : "a249e59ce098ccab24c15b794bcd148dca578ce4cb5aad253732c8e9466c7f89"
20+ sha256 cellar : :any_skip_relocation , x86_64_linux : "fc0660f81935172863061b141e4576bedc36db62b6b0c0b7f5bececc5ed40689"
2221 end
2322
2423 depends_on "cmake" => :build
25- depends_on "openjdk@11 " => [ :build , :test ]
24+ depends_on "openjdk" => [ :build , :test ]
2625
2726 def install
2827 # Avoid building Linux bottle with `-march=native`. Need to enable SSE4.1 for _mm_dp_pd
2928 # Issue ref: https://github.com/beagle-dev/beagle-lib/issues/189
3029 inreplace "CMakeLists.txt" , "-march=native" , "-msse4.1" if OS . linux? && build . bottle?
3130
32- ENV [ "JAVA_HOME" ] = Language ::Java . java_home ( "11" )
31+ ENV [ "JAVA_HOME" ] = Language ::Java . java_home
3332 system "cmake" , "-S" , "." , "-B" , "build" , *std_cmake_args
3433 system "cmake" , "--build" , "build"
3534 system "cmake" , "--install" , "build"
35+ pkgshare . install "examples/tinytest/tinytest.cpp"
3636 end
3737
3838 test do
39- ( testpath /"test.cpp" ) . write <<~CPP
40- #include "libhmsbeagle/platform.h"
41- int main() { return 0; }
42- CPP
39+ if OS . mac? && Hardware ::CPU . arm? && Hardware ::CPU . virtualized?
40+ # OpenCL is not supported on virtualized arm64 macOS which breaks all Beagle functionality
41+ ( testpath /"test.cpp" ) . write <<~CPP
42+ #include <iostream>
43+ #include "libhmsbeagle/beagle.h"
44+ int main() {
45+ std::cout << beagleGetVersion();
46+ return 0;
47+ }
48+ CPP
49+ system ENV . cxx , "test.cpp" , "-o" , "test" , "-I#{ include } /libhmsbeagle-1" , "-L#{ lib } " , "-lhmsbeagle"
50+ assert_match version . to_s , shell_output ( "./test" )
51+ else
52+ system ENV . cxx , pkgshare /"tinytest.cpp" , "-o" , "test" , "-I#{ include } /libhmsbeagle-1" , "-L#{ lib } " , "-lhmsbeagle"
53+ assert_match "sumLogL = -1498." , shell_output ( "./test" )
54+ end
55+
4356 ( testpath /"T.java" ) . write <<~JAVA
4457 class T {
4558 static { System.loadLibrary("hmsbeagle-jni"); }
4659 public static void main(String[] args) {}
4760 }
4861 JAVA
49- system ENV . cxx , "-I#{ include } /libhmsbeagle-1" , testpath /"test.cpp" , "-o" , "test"
50- system "./test"
51- system Formula [ "openjdk@11" ] . bin /"javac" , "T.java"
52- system Formula [ "openjdk@11" ] . bin /"java" , "-Djava.library.path=#{ lib } " , "T"
62+ system Formula [ "openjdk" ] . bin /"javac" , "T.java"
63+ system Formula [ "openjdk" ] . bin /"java" , "-Djava.library.path=#{ lib } " , "T"
5364 end
5465end
0 commit comments