85 lines
2.7 KiB
Ruby
85 lines
2.7 KiB
Ruby
class Libsecret < Formula
|
|
bottle do
|
|
root_url "https://homebrew.mirror.ygg/bottles"
|
|
sha256 cellar: :any, arm64_sequoia: "79874cb427ebe11a1e139f777e566d34c8be68ca97a25020f128c8052d7b2f7b"
|
|
sha256 cellar: :any, arm64_tahoe: "ee55da32af1c04e94e871fc0bc012524bf46c64adf3012991a6c0e2fae089135"
|
|
sha256 cellar: "/home/linuxbrew/.linuxbrew/Cellar", x86_64_linux: "223ea87975e39fd3bb9ef2d04ea31c1c13b7f797199db96d2d2796b7e7856bf5"
|
|
end
|
|
desc "Library for storing/retrieving passwords and other secrets"
|
|
homepage "https://wiki.gnome.org/Projects/Libsecret"
|
|
url "https://download.gnome.org/sources/libsecret/0.21/libsecret-0.21.7.tar.xz"
|
|
sha256 "6b452e4750590a2b5617adc40026f28d2f4903de15f1250e1d1c40bfd68ed55e"
|
|
# Excluding GPL-2.0-or-later and Apache-2.0 which are for tests
|
|
license "LGPL-2.1-or-later"
|
|
compatibility_version 1
|
|
|
|
# libsecret doesn't use GNOME's "even-numbered minor is stable" version
|
|
# scheme. This regex is the same as the one generated by the `Gnome` strategy
|
|
# but it's necessary to avoid the related version scheme logic.
|
|
livecheck do
|
|
url :stable
|
|
regex(/libsecret[._-]v?(\d+(?:\.\d+)+)\.t/i)
|
|
end
|
|
|
|
|
|
|
|
depends_on "docbook-xsl" => :build
|
|
depends_on "gettext" => :build
|
|
depends_on "gobject-introspection" => :build
|
|
depends_on "meson" => :build
|
|
depends_on "ninja" => :build
|
|
depends_on "pkgconf" => [:build, :test]
|
|
depends_on "vala" => :build
|
|
depends_on "glib"
|
|
depends_on "libgcrypt"
|
|
uses_from_macos "libxslt" => :build
|
|
uses_from_macos "expat"
|
|
|
|
on_macos do
|
|
depends_on "gettext"
|
|
end
|
|
|
|
def install
|
|
ENV["XML_CATALOG_FILES"] = "#{etc}/xml/catalog"
|
|
|
|
system "meson", "setup", "build", "-Dbashcompdir=#{bash_completion}",
|
|
"-Dgtk_doc=false",
|
|
*std_meson_args
|
|
system "meson", "compile", "-C", "build", "--verbose"
|
|
system "meson", "install", "-C", "build"
|
|
end
|
|
|
|
test do
|
|
(testpath/"test.c").write <<~C
|
|
#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;
|
|
}
|
|
C
|
|
|
|
flags = shell_output("pkgconf --cflags --libs libsecret-1").chomp.split
|
|
system ENV.cc, "test.c", "-o", "test", *flags
|
|
system "./test"
|
|
end
|
|
end
|