2014-08-11 20:13:33 +00:00
|
|
|
class Libsecret < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Library for storing/retrieving passwords and other secrets"
|
2014-08-11 20:13:33 +00:00
|
|
|
homepage "https://wiki.gnome.org/Projects/Libsecret"
|
2016-01-19 10:35:08 +00:00
|
|
|
url "https://download.gnome.org/sources/libsecret/0.18/libsecret-0.18.4.tar.xz"
|
|
|
|
sha256 "0f29b51698198e6999c91f4adce3119c8c457f546b133a85baea5ea9010a19ed"
|
2014-08-11 20:13:33 +00:00
|
|
|
|
2014-08-11 21:36:08 +00:00
|
|
|
bottle do
|
2016-01-19 11:00:33 +00:00
|
|
|
sha256 "4d726f0a13c77ba0db1be9a8e6a033af5908e0dea0733ac20ec19bbf34d621b2" => :el_capitan
|
|
|
|
sha256 "9888c18e94b2e13588c5ff0d63890e2a9ae2ad3f301e92ca9a430da122d39a1b" => :yosemite
|
|
|
|
sha256 "73af85f9feaf25353d04347b047e9335bcdca4c165a19a001815213e27b68cb3" => :mavericks
|
2014-08-11 21:36:08 +00:00
|
|
|
end
|
|
|
|
|
2014-08-12 11:43:36 +00:00
|
|
|
depends_on "pkg-config" => :build
|
|
|
|
depends_on "gnu-sed" => :build
|
|
|
|
depends_on "intltool" => :build
|
|
|
|
depends_on "gettext" => :build
|
2015-10-19 16:31:50 +00:00
|
|
|
depends_on "docbook-xsl" => :build
|
2014-08-12 15:47:28 +00:00
|
|
|
depends_on "vala" => :optional
|
|
|
|
depends_on "gobject-introspection" => :recommended
|
2014-08-12 11:43:36 +00:00
|
|
|
depends_on "glib"
|
|
|
|
depends_on "libgcrypt"
|
2014-08-11 20:13:33 +00:00
|
|
|
|
|
|
|
def install
|
2015-10-19 16:31:50 +00:00
|
|
|
ENV["XML_CATALOG_FILES"] = "#{etc}/xml/catalog"
|
|
|
|
|
2014-08-12 15:47:28 +00:00
|
|
|
args = %W[
|
2015-08-03 12:55:31 +00:00
|
|
|
--disable-debug
|
|
|
|
--disable-dependency-tracking
|
|
|
|
--disable-silent-rules
|
|
|
|
--prefix=#{prefix}
|
2014-08-12 15:47:28 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
args << "--enable-gobject-introspection" if build.with? "gobject-introspection"
|
|
|
|
args << "--enable-vala" if build.with? "vala"
|
|
|
|
|
|
|
|
system "./configure", *args
|
2014-08-12 11:43:47 +00:00
|
|
|
|
|
|
|
# https://bugzilla.gnome.org/show_bug.cgi?id=734630
|
2014-08-12 11:43:36 +00:00
|
|
|
inreplace "Makefile", "sed", "gsed"
|
2014-08-12 11:43:47 +00:00
|
|
|
|
2014-08-11 20:13:33 +00:00
|
|
|
system "make", "install"
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
2014-08-12 11:43:36 +00:00
|
|
|
(testpath/"test.c").write <<-EOS.undent
|
2014-08-11 20:13:33 +00:00
|
|
|
#include <libsecret/secret.h>
|
|
|
|
|
|
|
|
const SecretSchema * example_get_schema (void) G_GNUC_CONST;
|
|
|
|
|
|
|
|
const SecretSchema *
|
|
|
|
example_get_schema (void)
|
|
|
|
{
|
|
|
|
static const SecretSchema the_schema = {
|
|
|
|
"org.example.Password", SECRET_SCHEMA_NONE,
|
|
|
|
{
|
|
|
|
{ "number", SECRET_SCHEMA_ATTRIBUTE_INTEGER },
|
|
|
|
{ "string", SECRET_SCHEMA_ATTRIBUTE_STRING },
|
|
|
|
{ "even", SECRET_SCHEMA_ATTRIBUTE_BOOLEAN },
|
|
|
|
{ "NULL", 0 },
|
|
|
|
}
|
|
|
|
};
|
|
|
|
return &the_schema;
|
|
|
|
}
|
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
example_get_schema();
|
|
|
|
}
|
|
|
|
EOS
|
|
|
|
|
|
|
|
flags = [
|
|
|
|
"-I#{include}/libsecret-1",
|
|
|
|
"-I#{HOMEBREW_PREFIX}/include/glib-2.0",
|
2015-10-19 16:31:50 +00:00
|
|
|
"-I#{HOMEBREW_PREFIX}/lib/glib-2.0/include",
|
2014-08-11 20:13:33 +00:00
|
|
|
]
|
|
|
|
|
2014-08-12 11:43:36 +00:00
|
|
|
system ENV.cc, "test.c", "-o", "test", *flags
|
|
|
|
system "./test"
|
2014-08-11 20:13:33 +00:00
|
|
|
end
|
|
|
|
end
|