homebrew-core/Formula/libsbol.rb

53 lines
1.9 KiB
Ruby

class Libsbol < Formula
desc "Read and write files in the Synthetic Biology Open Language (SBOL)"
homepage "https://synbiodex.github.io/libSBOL"
url "https://github.com/SynBioDex/libSBOL/archive/v2.3.2.tar.gz"
sha256 "c85de13b35dec40c920ff8a848a91c86af6f7c7ee77ed3c750f414bbbbb53924"
license "Apache-2.0"
revision 1
bottle do
sha256 cellar: :any, catalina: "69d13417a5f365bda9b5da5097f0b253fc76a9c237ac733ef7b684db1a3e01d6"
sha256 cellar: :any, mojave: "2d81b55c1e379756aaf37667757273a6581ee98083ac6b87c0d2392020249b19"
sha256 cellar: :any, high_sierra: "cc6aca556487165bf44a40d159428652cae3b60e04f685281a5662b5ced42d2c"
end
depends_on "cmake" => :build
depends_on "pkg-config" => :build
depends_on "jsoncpp"
depends_on "raptor"
def install
# upstream issue: https://github.com/SynBioDex/libSBOL/issues/215
inreplace "source/CMakeLists.txt", "measure.h", "measurement.h"
system "cmake", ".", "-DCMAKE_CXX_FLAGS=-I/System/Library/Frameworks/Python.framework/Headers",
"-DSBOL_BUILD_SHARED=TRUE",
"-DSBOL_BUILD_STATIC=FALSE",
*std_cmake_args
system "make", "install"
end
test do
(testpath/"test.cpp").write <<~EOS
#include "sbol/sbol.h"
using namespace sbol;
int main() {
Document& doc = *new Document();
doc.write("test.xml");
return 0;
}
EOS
system ENV.cxx, "test.cpp", "-o", "test", "-std=c++11",
"-I/System/Library/Frameworks/Python.framework/Headers",
"-I#{Formula["raptor"].opt_include}/raptor2",
"-I#{include}", "-L#{lib}",
"-L#{Formula["jsoncpp"].opt_lib}",
"-L#{Formula["raptor"].opt_lib}",
"-ljsoncpp", "-lcurl", "-lraptor2", "-lsbol"
system "./test"
end
end