homebrew-core/Formula/gnumeric.rb

67 lines
2.1 KiB
Ruby

class Gnumeric < Formula
desc "GNOME Spreadsheet Application"
homepage "https://projects.gnome.org/gnumeric/"
url "https://download.gnome.org/sources/gnumeric/1.12/gnumeric-1.12.49.tar.xz"
sha256 "91c072ec95c32e00b156ffe8015c93b32b8edf368f9041436193cfa32e84ed57"
license any_of: ["GPL-3.0-only", "GPL-2.0-only"]
bottle do
sha256 arm64_big_sur: "65bb80be6de9cb9b6dc0ff3e0407a4725e0067ba2ab67a04f807464392abed15"
sha256 big_sur: "1354624f0425001c39de0774a707f381654e2e2c98959b9dc875e28050d9d247"
sha256 catalina: "606e6b30598f9ed49f38276e610da074409c36617c29a76d75c1df6f79107bee"
sha256 mojave: "ebbe3291c3252cf3b066d49fe7824af5bccae5e1498c27b42b59b18636cc68ce"
end
depends_on "intltool" => :build
depends_on "pkg-config" => :build
depends_on "adwaita-icon-theme"
depends_on "gettext"
depends_on "goffice"
depends_on "itstool"
depends_on "libxml2"
depends_on "rarian"
uses_from_macos "bison"
on_linux do
depends_on "perl"
resource "XML::Parser" do
url "https://cpan.metacpan.org/authors/id/T/TO/TODDR/XML-Parser-2.44.tar.gz"
sha256 "1ae9d07ee9c35326b3d9aad56eae71a6730a73a116b9fe9e8a4758b7cc033216"
end
end
def install
on_linux do
ENV.prepend_create_path "PERL5LIB", libexec/"lib/perl5"
resources.each do |res|
res.stage do
system "perl", "Makefile.PL", "INSTALL_BASE=#{libexec}"
system "make", "PERL5LIB=#{ENV["PERL5LIB"]}"
system "make", "install"
end
end
end
# ensures that the files remain within the keg
inreplace "component/Makefile.in",
"GOFFICE_PLUGINS_DIR = @GOFFICE_PLUGINS_DIR@",
"GOFFICE_PLUGINS_DIR = @libdir@/goffice/@GOFFICE_API_VER@/plugins/gnumeric"
system "./configure", "--disable-dependency-tracking",
"--prefix=#{prefix}",
"--disable-schemas-compile"
system "make", "install"
end
def post_install
system "#{Formula["glib"].opt_bin}/glib-compile-schemas", "#{HOMEBREW_PREFIX}/share/glib-2.0/schemas"
end
test do
system bin/"gnumeric", "--version"
end
end