homebrew-core/Formula/gnumeric.rb
2018-03-14 09:02:38 +01:00

71 lines
2.4 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.39.tar.xz"
sha256 "26cceb7fa97dc7eee7181a79a6251a85b1f1464dcaaaf7624829f7439c5f7d3f"
bottle do
sha256 "823f42cdf6443bebcdad346c03d11346f75d53b141cf1687f1db6763d4a2ca79" => :high_sierra
sha256 "e78184e3c8443ebbcc2b6efe44f6e3e9ac0998c4cb22a6f1cf11e35c3af73a6f" => :sierra
sha256 "e0c2530a8f2ecbb4f1b74891f27021af84ffa50a5ed0ac926168eebdd8f6af9c" => :el_capitan
end
option "with-python-scripting", "Enable Python scripting."
deprecated_option "python-scripting" => "with-python-scripting"
depends_on "pkg-config" => :build
depends_on "intltool" => :build
depends_on "gettext"
depends_on "goffice"
depends_on "rarian"
depends_on "adwaita-icon-theme"
depends_on "pygobject" if build.with? "python-scripting"
# Issue from 26 Nov 2017 "itstool-2.0.4: problem with gnumeric-1.12.35"
# See https://github.com/itstool/itstool/issues/22
resource "itstool" do
url "http://files.itstool.org/itstool/itstool-2.0.2.tar.bz2"
sha256 "bf909fb59b11a646681a8534d5700fec99be83bb2c57badf8c1844512227033a"
end
# For itstool
resource "py_libxml2" do
url "http://xmlsoft.org/sources/libxml2-2.9.7.tar.gz"
sha256 "f63c5e7d30362ed28b38bfa1ac6313f9a80230720b7fb6c80575eeab3ff5900c"
end
def install
resource("py_libxml2").stage do
cd "python" do
system "python", "setup.py", "install", "--prefix=#{buildpath}/vendor"
end
end
resource("itstool").stage do
ENV.append_path "PYTHONPATH", "#{buildpath}/vendor/lib/python2.7/site-packages"
system "./configure", "--prefix=#{buildpath}/vendor"
system "make", "install"
end
ENV.prepend_path "PATH", buildpath/"vendor/bin"
# 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