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.7.tar.xz" sha256 "0d66fe1fc4561b3e046ee281d7c5a703a9baac88a8c4fb42ebc739d31dabd487" bottle do sha256 "6e9eba382588ebbc0a4f92ab9de6d0d941b4f10d34834a08dc62fdee49a8954b" => :mojave sha256 "8c08c88184cf9283d8e79d97d0607eaf7f479f84bf5eaa23df3d28ecee8eb187" => :high_sierra sha256 "38153a44f8c3a530faa57287153a396b07738cd70dc10bb7ef53096d8d44d506" => :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 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