homebrew-core/Formula/goffice.rb

89 lines
3.0 KiB
Ruby

class Goffice < Formula
desc "Gnumeric spreadsheet program"
homepage "https://gitlab.gnome.org/GNOME/goffice"
url "https://download.gnome.org/sources/goffice/0.10/goffice-0.10.55.tar.xz"
sha256 "16a221191855a6a6c0d06b1ef8e481cf3f52041a654ec96d35817045ba1a99af"
license any_of: ["GPL-3.0-only", "GPL-2.0-only"]
bottle do
sha256 arm64_ventura: "b4fba5dd3adb45ec2bbd704602870bebdb56498f8e32a0d9cc73695e56d70539"
sha256 arm64_monterey: "d65b7f9ed3f4f20f40db33f6a5e0524a7bb4eefbf7aa64cf2bd6d16ee36a10fe"
sha256 arm64_big_sur: "0aa63ad148cb4aae4c65266661a83918c908e20215370f370a83539b76013925"
sha256 ventura: "64237ea971207b9ed98c30df3fd174e43655c961e3fda8f477c694046906d6eb"
sha256 monterey: "e504938af2973d98cfed4e9a402ba7abafbfa9a1d93cb5deebda0af512bc70db"
sha256 big_sur: "b4b6abb961eb7cc3485f517d1ea196104b0bddfdaa6dee3f258f906584f6e434"
sha256 x86_64_linux: "8cde966d15d0204ea00adf282e606d026988617d25d5e2f139a623a8ce8f1b66"
end
head do
url "https://gitlab.gnome.org/GNOME/goffice.git", branch: "master"
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "gtk-doc" => :build
depends_on "libtool" => :build
end
depends_on "gettext" => :build
depends_on "intltool" => :build
depends_on "pkg-config" => :build
depends_on "atk"
depends_on "cairo"
depends_on "gdk-pixbuf"
depends_on "glib"
depends_on "gtk+3"
depends_on "libgsf"
depends_on "librsvg"
depends_on "pango"
uses_from_macos "libxml2"
uses_from_macos "libxslt"
on_macos do
depends_on "gettext"
end
def install
if OS.linux?
# Needed to find intltool (xml::parser)
ENV.prepend_path "PERL5LIB", Formula["intltool"].libexec/"lib/perl5"
ENV["INTLTOOL_PERL"] = Formula["perl"].bin/"perl"
end
configure = build.head? ? "./autogen.sh" : "./configure"
system configure, *std_configure_args, "--disable-silent-rules"
system "make", "install"
end
test do
(testpath/"test.c").write <<~EOS
#include <goffice/goffice.h>
int main()
{
void
libgoffice_init (void);
void
libgoffice_shutdown (void);
return 0;
}
EOS
libxml2 = if OS.mac?
"#{MacOS.sdk_path}/usr/include/libxml2"
else
Formula["libxml2"].opt_include/"libxml2"
end
system ENV.cc, "-I#{include}/libgoffice-0.10",
"-I#{Formula["glib"].opt_include}/glib-2.0",
"-I#{Formula["glib"].opt_lib}/glib-2.0/include",
"-I#{Formula["harfbuzz"].opt_include}/harfbuzz",
"-I#{Formula["libgsf"].opt_include}/libgsf-1",
"-I#{libxml2}",
"-I#{Formula["gtk+3"].opt_include}/gtk-3.0",
"-I#{Formula["pango"].opt_include}/pango-1.0",
"-I#{Formula["cairo"].opt_include}/cairo",
"-I#{Formula["gdk-pixbuf"].opt_include}/gdk-pixbuf-2.0",
"-I#{Formula["atk"].opt_include}/atk-1.0",
testpath/"test.c", "-o", testpath/"test"
system "./test"
end
end