homebrew-core/Formula/libvisio.rb

60 lines
2.3 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"
license "MPL-2.0"
revision 5
livecheck do
url "https://dev-www.libreoffice.org/src/"
regex(/href=["']?libvisio[._-]v?(\d+(?:\.\d+)+)\.t/i)
end
bottle do
sha256 cellar: :any, arm64_monterey: "7e680fc261f5931963c064165e477f2f9db5be3671e35b702ad6bc2d4a476c95"
sha256 cellar: :any, arm64_big_sur: "ecbbbde8509b32ae1d382dc37676993561c7dfc1eac82502cd6a1aafac054059"
sha256 cellar: :any, monterey: "928901f88d373e8e0f45f59da46cdec7e44b0d22414203a1333986431a20dc4b"
sha256 cellar: :any, big_sur: "3c66b712f07830c60a548d529a67eebc443a8dc3ca655b59ce78ffd7020bc5cc"
sha256 cellar: :any, catalina: "4fd2ae7f2b825a64f2a246e1bff48440dff2b133745f0f4833cc72cdb30dce1a"
sha256 cellar: :any_skip_relocation, x86_64_linux: "ce944eadfcdd306e2d490035577631ba05cbb2dc8a63976e967033b4ceae06cb"
end
depends_on "cppunit" => :build
depends_on "pkg-config" => :build
depends_on "boost"
depends_on "icu4c"
depends_on "librevenge"
uses_from_macos "gperf" => :build
uses_from_macos "libxml2"
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