homebrew-core/Formula/libvisio.rb

54 lines
1.9 KiB
Ruby

class Libvisio < Formula
desc "Interpret and import Visio diagrams"
homepage "https://wiki.documentfoundation.org/DLP/Libraries/libvisio"
url "https://dev-www.libreoffice.org/src/libvisio/libvisio-0.1.7.tar.xz"
sha256 "8faf8df870cb27b09a787a1959d6c646faa44d0d8ab151883df408b7166bea4c"
revision 3
livecheck do
url "https://dev-www.libreoffice.org/src/"
regex(/href=["']?libvisio[._-]v?(\d+(?:\.\d+)+)\.t/i)
end
bottle do
sha256 cellar: :any, arm64_big_sur: "acad0df1dc6b2c642e3de22fa7081cc636f61adfb672399bdcf7488ce6347c94"
sha256 cellar: :any, big_sur: "a21f9f794732dc80cdb1b2bdc20a45239df014b2ca90eb39c88dd3f2c03dd873"
sha256 cellar: :any, catalina: "4ce15c2036192d7a558935d1722775b7f5e1949fb923096584ce76e78cdb77d6"
sha256 cellar: :any, mojave: "b0528215e9046a6e83e9763343ad7311667cfbc7c8852a6ddc2edaf977f7099e"
end
depends_on "cppunit" => :build
depends_on "pkg-config" => :build
depends_on "boost"
depends_on "icu4c"
depends_on "librevenge"
def install
# Needed for Boost 1.59.0 compatibility.
ENV["LDFLAGS"] = "-lboost_system-mt"
system "./configure", "--without-docs",
"-disable-dependency-tracking",
"--enable-static=no",
"--prefix=#{prefix}"
system "make", "install"
end
test do
(testpath/"test.cpp").write <<~EOS
#include <librevenge-stream/librevenge-stream.h>
#include <libvisio/VisioDocument.h>
int main() {
librevenge::RVNGStringStream docStream(0, 0);
libvisio::VisioDocument::isSupported(&docStream);
return 0;
}
EOS
system ENV.cxx, "test.cpp", "-o", "test",
"-lrevenge-stream-0.0",
"-I#{Formula["librevenge"].include}/librevenge-0.0",
"-L#{Formula["librevenge"].lib}",
"-lvisio-0.1", "-I#{include}/libvisio-0.1", "-L#{lib}"
system "./test"
end
end