126 lines
3.8 KiB
Ruby
126 lines
3.8 KiB
Ruby
class Gedit < Formula
|
|
desc "The GNOME text editor"
|
|
homepage "https://wiki.gnome.org/Apps/Gedit"
|
|
url "https://download.gnome.org/sources/gedit/3.20/gedit-3.20.2.tar.xz"
|
|
sha256 "32a1276a71a0d4a5af4e20a87bc273170ba8e075fc1ca7f51c8d3a6c150463f8"
|
|
|
|
bottle do
|
|
sha256 "f82d3eda571bfd09c0f25f35ecbfe5ec3f27495c698caa9a0f099a20055dcb73" => :el_capitan
|
|
sha256 "dfb0ecca21a09bf5ce5d2eadb9b619731a4cdd68e5caf4f274e2f58a8cfdebe7" => :yosemite
|
|
sha256 "421dd30ffd44155452dc99db471e9d92f38d67b99b5e83dfc98e3e121f7883b9" => :mavericks
|
|
end
|
|
|
|
depends_on "pkg-config" => :build
|
|
depends_on "intltool" => :build
|
|
depends_on "itstool" => :build
|
|
depends_on "gtk+3"
|
|
depends_on "gtk-mac-integration"
|
|
depends_on "gobject-introspection"
|
|
depends_on "enchant"
|
|
depends_on "iso-codes"
|
|
depends_on "libxml2"
|
|
depends_on "libpeas"
|
|
depends_on "gtksourceview3"
|
|
depends_on "gsettings-desktop-schemas"
|
|
depends_on "gnome-icon-theme"
|
|
|
|
def install
|
|
system "./configure", "--disable-dependency-tracking",
|
|
"--disable-silent-rules",
|
|
"--prefix=#{prefix}",
|
|
"--disable-updater",
|
|
"--disable-schemas-compile",
|
|
"--disable-python",
|
|
"--disable-spell" # Expects gspell < 1.0.
|
|
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
|
|
# main executable test
|
|
system bin/"gedit", "--version"
|
|
# API test
|
|
(testpath/"test.c").write <<-EOS.undent
|
|
#include <gedit/gedit-utils.h>
|
|
|
|
int main(int argc, char *argv[]) {
|
|
gchar *text = gedit_utils_make_valid_utf8("test text");
|
|
return 0;
|
|
}
|
|
EOS
|
|
ENV.libxml2
|
|
atk = Formula["atk"]
|
|
cairo = Formula["cairo"]
|
|
fontconfig = Formula["fontconfig"]
|
|
freetype = Formula["freetype"]
|
|
gdk_pixbuf = Formula["gdk-pixbuf"]
|
|
gettext = Formula["gettext"]
|
|
glib = Formula["glib"]
|
|
gobject_introspection = Formula["gobject-introspection"]
|
|
gtkx3 = Formula["gtk+3"]
|
|
gtksourceview3 = Formula["gtksourceview3"]
|
|
libepoxy = Formula["libepoxy"]
|
|
libffi = Formula["libffi"]
|
|
libpeas = Formula["libpeas"]
|
|
libpng = Formula["libpng"]
|
|
pango = Formula["pango"]
|
|
pixman = Formula["pixman"]
|
|
flags = %W[
|
|
-I#{atk.opt_include}/atk-1.0
|
|
-I#{cairo.opt_include}/cairo
|
|
-I#{fontconfig.opt_include}
|
|
-I#{freetype.opt_include}/freetype2
|
|
-I#{gdk_pixbuf.opt_include}/gdk-pixbuf-2.0
|
|
-I#{gettext.opt_include}
|
|
-I#{glib.opt_include}/gio-unix-2.0/
|
|
-I#{glib.opt_include}/glib-2.0
|
|
-I#{glib.opt_lib}/glib-2.0/include
|
|
-I#{gobject_introspection.opt_include}/gobject-introspection-1.0
|
|
-I#{gtksourceview3.opt_include}/gtksourceview-3.0
|
|
-I#{gtkx3.opt_include}/gtk-3.0
|
|
-I#{include}/gedit-3.14
|
|
-I#{libepoxy.opt_include}
|
|
-I#{libffi.opt_lib}/libffi-3.0.13/include
|
|
-I#{libpeas.opt_include}/libpeas-1.0
|
|
-I#{libpng.opt_include}/libpng16
|
|
-I#{pango.opt_include}/pango-1.0
|
|
-I#{pixman.opt_include}/pixman-1
|
|
-D_REENTRANT
|
|
-L#{atk.opt_lib}
|
|
-L#{cairo.opt_lib}
|
|
-L#{gdk_pixbuf.opt_lib}
|
|
-L#{lib}/gedit
|
|
-L#{gettext.opt_lib}
|
|
-L#{glib.opt_lib}
|
|
-L#{gobject_introspection.opt_lib}
|
|
-L#{gtksourceview3.opt_lib}
|
|
-L#{gtkx3.opt_lib}
|
|
-L#{libpeas.opt_lib}
|
|
-L#{lib}
|
|
-L#{pango.opt_lib}
|
|
-latk-1.0
|
|
-lcairo
|
|
-lcairo-gobject
|
|
-lgdk-3
|
|
-lgdk_pixbuf-2.0
|
|
-lgedit
|
|
-lgio-2.0
|
|
-lgirepository-1.0
|
|
-lglib-2.0
|
|
-lgmodule-2.0
|
|
-lgobject-2.0
|
|
-lgtk-3
|
|
-lgtksourceview-3.0
|
|
-lintl
|
|
-lpango-1.0
|
|
-lpangocairo-1.0
|
|
-lpeas-1.0
|
|
-lpeas-gtk-1.0
|
|
]
|
|
system ENV.cc, "test.c", "-o", "test", *flags
|
|
system "./test"
|
|
end
|
|
end
|