homebrew-core/Formula/gnome-autoar.rb

68 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.1/gnome-autoar-0.1.1.tar.xz"
sha256 "f65cb810b562dc038ced739fbf59739fd5df1a8e848636e21f363ded9f349ac9"
bottle do
sha256 "45812c9e3e758dd5d6e5fb4357a4e6b35b1de7aeb7a46b821dbc326a6506f440" => :sierra
sha256 "4df813bf0adedd8b079991de35e2efa8def78640c959b24840c12c06f9463298" => :el_capitan
sha256 "ce143626e83d030de0fae3d6257301c3ec0c7ff8230bce78422178fe8b97ff54" => :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