homebrew-core/Formula/goffice.rb

95 lines
3.1 KiB
Ruby

class Goffice < Formula
desc "Gnumeric spreadsheet program"
homepage "https://gitlab.gnome.org/GNOME/goffice"
license any_of: ["GPL-3.0-only", "GPL-2.0-only"]
stable do
url "https://download.gnome.org/sources/goffice/0.10/goffice-0.10.51.tar.xz"
sha256 "2e8410884d6a51ae00c9420928abfa73f7a552c1aa222371df4f2dc5acc3cd23"
# Fix -flat_namespace being used on Big Sur and later.
patch do
url "https://raw.githubusercontent.com/Homebrew/formula-patches/03cf8088210822aa2c1ab544ed58ea04c897d9c4/libtool/configure-big_sur.diff"
sha256 "35acd6aebc19843f1a2b3a63e880baceb0f5278ab1ace661e57a502d9d78c93c"
end
end
bottle do
sha256 arm64_monterey: "4bd91bb6772e9a0c438fc796025882804158fb198ab9d1f0500cba7df9330990"
sha256 arm64_big_sur: "ed4cd906f248ebaeaad00e58a298afc6bbcc477d01d1703126f53ee3444762ba"
sha256 monterey: "5e3be444eb259ea914e953577d80b7bf9dd06bc7ed915df1a638f85f24ca57c9"
sha256 big_sur: "9da50f6e68939438a4b3f84f75bfe91f3c15d14a3f219424508c927dfa74a958"
sha256 catalina: "08cd477b474f2b49f89ffc71fa0a34c98bcad85945ec20af6b5bcddde861e6f8"
sha256 x86_64_linux: "0f646a8bd02282f81999c17ede399588c76125f703714a770928c5017826eb9b"
end
head do
url "https://github.com/GNOME/goffice.git"
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "gtk-doc" => :build
depends_on "libtool" => :build
end
depends_on "intltool" => :build
depends_on "pkg-config" => :build
depends_on "atk"
depends_on "cairo"
depends_on "gdk-pixbuf"
depends_on "gettext"
depends_on "gtk+3"
depends_on "libgsf"
depends_on "librsvg"
depends_on "pango"
depends_on "pcre"
uses_from_macos "libxslt"
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
args = %W[--disable-dependency-tracking --prefix=#{prefix}]
if build.head?
system "./autogen.sh", *args
else
system "./configure", *args
end
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 = "#{MacOS.sdk_path}/usr/include/libxml2"
on_linux do
libxml2 = 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