67 lines
2.1 KiB
Ruby
67 lines
2.1 KiB
Ruby
class GnomeAutoar < Formula
|
|
desc "GNOME library for archive handling"
|
|
homepage "https://github.com/GNOME/gnome-autoar"
|
|
url "https://download.gnome.org/sources/gnome-autoar/0.2/gnome-autoar-0.2.0.tar.xz"
|
|
sha256 "08afa3a3b86f16bfd23e7343feab854610de67af7675dac37be4e5507a20bc6c"
|
|
|
|
bottle do
|
|
sha256 "491fb56f2c6845b382768cfc708c416e0399fd442449886166f53d90e60f9c42" => :sierra
|
|
sha256 "64f833b3fcd9542136cb566a626acd27b0b639b299481d1956ba654289ae6ad9" => :el_capitan
|
|
sha256 "89ef58b548f67ac6955659a1c6470afdba44a76d1d6daf2e2c61af26b5fea310" => :yosemite
|
|
end
|
|
|
|
depends_on "pkg-config" => :build
|
|
depends_on "libarchive"
|
|
depends_on "gtk+3"
|
|
|
|
def install
|
|
system "./configure", "--disable-debug",
|
|
"--disable-dependency-tracking",
|
|
"--disable-silent-rules",
|
|
"--prefix=#{prefix}",
|
|
"--disable-glibtest",
|
|
"--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
|
|
(testpath/"test.c").write <<-EOS.undent
|
|
#include <gnome-autoar/gnome-autoar.h>
|
|
|
|
int main(int argc, char *argv[]) {
|
|
GType type = autoar_extractor_get_type();
|
|
return 0;
|
|
}
|
|
EOS
|
|
gettext = Formula["gettext"]
|
|
glib = Formula["glib"]
|
|
libarchive = Formula["libarchive"]
|
|
pcre = Formula["pcre"]
|
|
flags = (ENV.cflags || "").split + (ENV.cppflags || "").split + (ENV.ldflags || "").split
|
|
flags += %W[
|
|
-I#{gettext.opt_include}
|
|
-I#{glib.opt_include}/glib-2.0
|
|
-I#{glib.opt_lib}/glib-2.0/include
|
|
-I#{include}/gnome-autoar-0
|
|
-I#{libarchive.opt_include}
|
|
-I#{pcre.opt_include}
|
|
-D_REENTRANT
|
|
-L#{gettext.opt_lib}
|
|
-L#{glib.opt_lib}
|
|
-L#{libarchive.opt_lib}
|
|
-L#{lib}
|
|
-larchive
|
|
-lgio-2.0
|
|
-lglib-2.0
|
|
-lgnome-autoar-0
|
|
-lgobject-2.0
|
|
-lintl
|
|
]
|
|
system ENV.cc, "test.c", "-o", "test", *flags
|
|
system "./test"
|
|
end
|
|
end
|