75 lines
2.1 KiB
Ruby
75 lines
2.1 KiB
Ruby
class Libsecret < Formula
|
|
desc "Library for storing/retrieving passwords and other secrets"
|
|
homepage "https://wiki.gnome.org/Projects/Libsecret"
|
|
url "https://download.gnome.org/sources/libsecret/0.18/libsecret-0.18.8.tar.xz"
|
|
sha256 "3bfa889d260e0dbabcf5b9967f2aae12edcd2ddc9adc365de7a5cc840c311d15"
|
|
revision 1
|
|
|
|
bottle do
|
|
sha256 "f02c03a067909f48cffe0cd83b61f967e2518db5500ab6c917aa88a209d129a9" => :mojave
|
|
sha256 "690a8c4095fcb4889fd42bda0b41b9fe90f6ae2321c1734b260a06be1739d973" => :high_sierra
|
|
sha256 "fd948d17fd859278100d5b5fbd4b843d7ea294e642ee3706f583ca32d4d2c8af" => :sierra
|
|
end
|
|
|
|
depends_on "docbook-xsl" => :build
|
|
depends_on "gettext" => :build
|
|
depends_on "gobject-introspection" => :build
|
|
depends_on "pkg-config" => :build
|
|
depends_on "vala" => :build
|
|
depends_on "glib"
|
|
depends_on "libgcrypt"
|
|
|
|
def install
|
|
ENV["XML_CATALOG_FILES"] = "#{etc}/xml/catalog"
|
|
|
|
args = %W[
|
|
--disable-debug
|
|
--disable-dependency-tracking
|
|
--disable-silent-rules
|
|
--prefix=#{prefix}
|
|
--enable-introspection
|
|
--enable-vala
|
|
]
|
|
|
|
system "./configure", *args
|
|
system "make", "install"
|
|
end
|
|
|
|
test do
|
|
(testpath/"test.c").write <<~EOS
|
|
#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();
|
|
return 0;
|
|
}
|
|
EOS
|
|
|
|
flags = [
|
|
"-I#{include}/libsecret-1",
|
|
"-I#{HOMEBREW_PREFIX}/include/glib-2.0",
|
|
"-I#{HOMEBREW_PREFIX}/lib/glib-2.0/include",
|
|
]
|
|
|
|
system ENV.cc, "test.c", "-o", "test", *flags
|
|
system "./test"
|
|
end
|
|
end
|