homebrew-core/Formula/libmspub.rb
2018-11-29 12:41:39 +01:00

48 lines
1.7 KiB
Ruby

class Libmspub < Formula
desc "Interpret and import Microsoft Publisher content"
homepage "https://wiki.documentfoundation.org/DLP/Libraries/libmspub"
url "https://dev-www.libreoffice.org/src/libmspub/libmspub-0.1.4.tar.xz"
sha256 "ef36c1a1aabb2ba3b0bedaaafe717bf4480be2ba8de6f3894be5fd3702b013ba"
revision 3
bottle do
cellar :any
sha256 "88fcaf08da9f11bedb81f2e5f7ce489325109e4481729cda57f168f2b7eaae75" => :mojave
sha256 "6d4a84da0d0cfc06f07e61043ff3f36310f06a3f2eff259c619b1c188f5113bd" => :high_sierra
sha256 "857c89b5a164acf971221125715acd419bccd092ca8ab2683f68b4174c6dd859" => :sierra
end
depends_on "boost" => :build
depends_on "libwpg" => :build
depends_on "pkg-config" => :build
depends_on "icu4c"
depends_on "librevenge"
depends_on "libwpd"
def install
system "./configure", "--without-docs",
"--disable-dependency-tracking",
"--enable-static=no",
"--disable-werror",
"--disable-tests",
"--prefix=#{prefix}"
system "make", "install"
end
test do
(testpath/"test.cpp").write <<~EOS
#include <librevenge-stream/librevenge-stream.h>
#include <libmspub/MSPUBDocument.h>
int main() {
librevenge::RVNGStringStream docStream(0, 0);
libmspub::MSPUBDocument::isSupported(&docStream);
return 0;
}
EOS
system ENV.cxx, "test.cpp", "-o", "test", "-lrevenge-stream-0.0",
"-I#{Formula["librevenge"].include}/librevenge-0.0",
"-lmspub-0.1", "-I#{include}/libmspub-0.1",
"-L#{lib}", "-L#{Formula["librevenge"].lib}"
system "./test"
end
end