aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/libsecret.rb
diff options
context:
space:
mode:
authorRichard Dowinton2014-08-11 21:13:33 +0100
committerMike McQuaid2014-08-12 12:45:01 +0100
commit71f44febfcdefb03aa04ed12bf9be9c41e841fb2 (patch)
tree3779d466bbd8f98af42f3a1bbbd695bf373e4969 /Library/Formula/libsecret.rb
parent8bb139b3afbf821067085cb88a44e4a2a6d446f7 (diff)
downloadhomebrew-71f44febfcdefb03aa04ed12bf9be9c41e841fb2.tar.bz2
libsecret 0.18 (new formula)
Diffstat (limited to 'Library/Formula/libsecret.rb')
-rw-r--r--Library/Formula/libsecret.rb61
1 files changed, 61 insertions, 0 deletions
diff --git a/Library/Formula/libsecret.rb b/Library/Formula/libsecret.rb
new file mode 100644
index 000000000..4f8aacac9
--- /dev/null
+++ b/Library/Formula/libsecret.rb
@@ -0,0 +1,61 @@
+require "formula"
+
+class Libsecret < Formula
+ homepage "https://wiki.gnome.org/Projects/Libsecret"
+ url "http://ftp.gnome.org/pub/gnome/sources/libsecret/0.18/libsecret-0.18.tar.xz"
+ sha1 "af62de3958bbe0ccf59a02101a6704e036378a6f"
+
+ depends_on 'pkg-config' => :build
+ depends_on 'gnu-sed' => :build
+ depends_on 'intltool' => :build
+ depends_on 'gettext' => :build
+ depends_on 'glib'
+ depends_on 'libgcrypt'
+
+ def install
+ system "./configure", "--disable-debug",
+ "--disable-dependency-tracking",
+ "--disable-silent-rules",
+ "--prefix=#{prefix}"
+ inreplace "Makefile", 'sed', 'gsed'
+ inreplace "Makefile", '--nonet', ''
+ system "make", "install"
+ end
+
+ test do
+ (testpath/'test.c').write <<-EOS.undent
+ #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",
+ "-I#{HOMEBREW_PREFIX}/lib/glib-2.0/include"
+ ]
+
+ system ENV.cc, 'test.c', '-o', 'test', *flags
+ system './test'
+ end
+end