]> saetta.ns0.it Git - msys2/commitdiff
Aggiunto il pacchetto libsecret (mman).
authorAndrea Zagli <azagli@libero.it>
Sat, 6 Sep 2014 07:46:01 +0000 (09:46 +0200)
committerAndrea Zagli <azagli@libero.it>
Sat, 6 Sep 2014 07:46:01 +0000 (09:46 +0200)
packages/.gitignore [new file with mode: 0644]
packages/mingw-w64-libsecret/001-win.patch [new file with mode: 0644]
packages/mingw-w64-libsecret/PKGBUILD [new file with mode: 0644]

diff --git a/packages/.gitignore b/packages/.gitignore
new file mode 100644 (file)
index 0000000..466d839
--- /dev/null
@@ -0,0 +1,4 @@
+pkg
+src
+*.log*
+*.tar*
diff --git a/packages/mingw-w64-libsecret/001-win.patch b/packages/mingw-w64-libsecret/001-win.patch
new file mode 100644 (file)
index 0000000..10aa261
--- /dev/null
@@ -0,0 +1,195 @@
+--- libsecret-0.18-orig/configure.ac   2014-03-06 12:47:18.000000000 +0100
++++ libsecret-0.18/configure.ac        2014-09-04 15:44:52.791144000 +0200
+@@ -79,12 +79,21 @@
+ AC_CHECK_FUNCS(mlock)
+ # --------------------------------------------------------------------
++# Check for gio-unix
++#
++
++if test "$os_unix" = "yes"; then
++      GIO_PACKAGE=gio-2.0 gio-unix-2.0
++else
++      GIO_PACKAGE=gio-2.0
++fi
++
++# --------------------------------------------------------------------
+ # GLib
+ PKG_CHECK_MODULES(GLIB,
+       glib-2.0 >= $GLIB_REQ
+-      gio-2.0
+-      gio-unix-2.0)
++      $GIO_PACKAGE)
+ LIBS="$LIBS $GLIB_LIBS"
+ CFLAGS="$CFLAGS $GLIB_CFLAGS -DGLIB_VERSION_MIN_REQUIRED=$GLIB_MIN -DGLIB_VERSION_MAX_ALLOWED=$GLIB_MAX"
+--- libsecret-0.18-orig/Makefile.am    2014-03-06 12:47:17.000000000 +0100
++++ libsecret-0.18/Makefile.am 2014-09-05 17:44:29.308119200 +0200
+@@ -139,6 +139,7 @@
+ INTROSPECTION_SCANNER_ARGS = $(INTROSPECTION_FLAGS) --warn-all \
+       --add-include-path=$(srcdir) --add-include-path=$(builddir)
+ INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir) --includedir=$(builddir)
++INTROSPECTION_SCANNER_ENV = CC="$(CC)"
+ girdir = $(datadir)/gir-1.0
+ gir_DATA =
+--- libsecret-0.18-orig/egg/Makefile.am        2014-03-06 12:47:18.000000000 +0100
++++ libsecret-0.18/egg/Makefile.am     2014-09-04 18:06:38.909344200 +0200
+@@ -20,7 +20,8 @@
+ egg_LIBS =  \
+       libegg.la \
+       $(LIBGCRYPT_LIBS) \
+-      $(GLIB_LIBS)
++      $(GLIB_LIBS) \
++      -lmman
+ egg_TESTS = \
+       test-hex \
+--- libsecret-0.18-orig/egg/egg-secure-memory.c        2014-03-06 12:47:18.000000000 +0100
++++ libsecret-0.18/egg/egg-secure-memory.c     2014-09-04 17:14:43.197799300 +0200
+@@ -913,7 +913,7 @@
+       DEBUG_ALLOC ("gkr-secure-memory: freed block ", sz);
+ #else
+-      ASSERT (FALSE);
++      ASSERT (0);
+ #endif
+ }
+--- libsecret-0.18-orig/libsecret/Makefile.am  2014-03-06 12:47:19.000000000 +0100
++++ libsecret-0.18/libsecret/Makefile.am       2014-09-04 20:39:25.136346600 +0200
+@@ -68,7 +68,8 @@
+ libsecret_@SECRET_MAJOR@_la_LIBADD = \
+       libegg.la \
+       $(LIBGCRYPT_LIBS) \
+-      $(LIBS)
++      $(LIBS) \
++      -lmman
+ BUILT_SOURCES += $(libsecret_BUILT)
+@@ -76,11 +77,13 @@
+ libsecret_testable_la_SOURCES =
+ libsecret_testable_la_LIBADD = \
+       $(libsecret_@SECRET_MAJOR@_la_OBJECTS) \
+-      $(libsecret_@SECRET_MAJOR@_la_LIBADD)
++      $(libsecret_@SECRET_MAJOR@_la_LIBADD) \
++      -lmman
+ libsecret_testable_la_DEPENDENCIES = \
+       $(libsecret_@SECRET_MAJOR@_la_OBJECTS) \
+       $(libsecret_@SECRET_MAJOR@_la_DEPENDENCIES)
+-libsecret_testable_la_LDFLAGS = -rpath /force/shared
++libsecret_testable_la_LDFLAGS = -rpath /force/shared \
++      -no-undefined
+ DBUS_XML_DEFINITIONS = \
+       libsecret/org.freedesktop.Secrets.xml
+@@ -181,10 +184,12 @@
+       $(NULL)
+ libmock_service_la_LDFLAGS = \
+-      -rpath /force/shared
++      -rpath /force/shared \
++      -no-undefined
+ libmock_service_la_LIBADD = \
+-      $(LIBGCRYPT_LIBS)
++      $(LIBGCRYPT_LIBS) \
++      -lmman
+ libsecret_LIBS = \
+       libsecret-testable.la \
+--- libsecret-0.18-orig/libsecret/mock-service.c       2014-03-06 12:47:19.000000000 +0100
++++ libsecret-0.18/libsecret/mock-service.c    2014-09-04 15:47:43.018633100 +0200
+@@ -17,12 +17,27 @@
+ #include "mock-service.h"
++#ifdef G_OS_WIN32
++#define WINVER 0x0501
++#include <io.h>
++#include <fcntl.h>
++#include <stddef.h>
++#include <windows.h>
++#endif
++
+ #include "secret-private.h"
+ #include <errno.h>
+ #include <stdio.h>
+ #include <string.h>
++#ifndef G_OS_UNIX
++#define WIFEXITED(x) 1
++#define WEXITSTATUS(x) (x)
++#define WIFSIGNALED(x) 0
++#define WTERMSIG(x) (x)
++#endif
++
+ static GTestDBus *test_bus = NULL;
+ static GPid pid = 0;
+@@ -52,7 +67,11 @@
+       g_setenv ("SECRET_SERVICE_BUS_NAME", MOCK_SERVICE_NAME, TRUE);
++#if defined(G_OS_UNIX)
+       if (pipe (wait_pipe) < 0) {
++#elif defined(G_OS_WIN32)
++      if (_pipe (wait_pipe, 4096, _O_BINARY) < 0) {
++#endif
+               g_set_error_literal (error, G_IO_ERROR, g_io_error_from_errno (errno),
+                                    "Couldn't create pipe for mock service");
+               return FALSE;
+@@ -103,7 +122,11 @@
+       if (!pid)
+               return;
++#if defined(G_OS_UNIX)
+       if (kill (pid, SIGTERM) < 0) {
++#elif defined(G_OS_WIN32)
++      if (!TerminateProcess (pid, 0)) {
++#endif
+               if (errno != ESRCH)
+                       g_warning ("kill() failed: %s", g_strerror (errno));
+       }
+--- libsecret-0.18-orig/tool/secret-tool.c     2014-03-06 12:47:20.000000000 +0100
++++ libsecret-0.18/tool/secret-tool.c  2014-09-04 15:49:29.453198400 +0200
+@@ -19,6 +19,10 @@
+ #include "libsecret/secret-service.h"
+ #include "libsecret/secret-value.h"
++#ifdef G_OS_WIN32
++#include <conio.h>
++#endif
++
+ #include <glib/gi18n.h>
+ #include <errno.h>
+@@ -269,6 +273,25 @@
+                                     (GDestroyNotify)secret_password_free);
+ }
++#ifdef G_OS_WIN32
++char *getpass(const char *prompt)
++{
++        static char buf[128];
++        size_t i;
++        
++        fputs(prompt, stderr);
++        fflush(stderr);
++        for (i = 0; i < sizeof(buf) - 1; i++) {
++                buf[i] = _getch();
++                if (buf[i] == '\r')
++                        break;
++        }
++        buf[i] = 0;
++        fputs("\n", stderr);
++        return buf;
++}
++#endif
++
+ static SecretValue *
+ read_password_tty (void)
+ {
diff --git a/packages/mingw-w64-libsecret/PKGBUILD b/packages/mingw-w64-libsecret/PKGBUILD
new file mode 100644 (file)
index 0000000..2b207d5
--- /dev/null
@@ -0,0 +1,49 @@
+# Maintainer: Andrea Zagli <andrea.zagli.free@gmail.com>
+
+_realname=libsecret
+pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
+pkgver=0.18
+pkgrel=1
+arch=('any')
+pkgdesc="Secret store (mingw-w64)"
+depends=("${MINGW_PACKAGE_PREFIX}-glib2"
+         "${MINGW_PACKAGE_PREFIX}-libgcrypt"
+         "${MINGW_PACKAGE_PREFIX}-mman-win32")
+makedepends=("${MINGW_PACKAGE_PREFIX}-gcc"
+             "${MINGW_PACKAGE_PREFIX}-gtk-doc"
+             "${MINGW_PACKAGE_PREFIX}-vala"
+             "${MINGW_PACKAGE_PREFIX}-gobject-introspection")
+options=('strip' 'staticlibs')
+license=("LGPL 2.1")
+url="http://www.gnome.org/"
+source=(http://ftp.gnome.org/pub/gnome/sources/${_realname}/${pkgver:0:4}/${_realname}-$pkgver.tar.xz
+        001-win.patch)
+sha256sums=('0c73aa762dbd1e38ba7b03de350e23ce818cb810b0784375e95ef61e004b02e3'
+            'a356fa355abc17f2fb3cf5c8c25d370d03a8370838bf5ef429ddf420157f0def')
+
+prepare() {
+  cd ${_realname}-${pkgver}
+  patch -p1 -i ${srcdir}/001-win.patch
+
+  autoreconf -fi
+}
+
+build() {
+  mkdir -p build-${MINGW_CHOST}
+  cd build-${MINGW_CHOST}
+
+  ../${_realname}-${pkgver}/configure \
+    --host=${MINGW_CHOST} \
+    --target=${MINGW_CHOST} \
+    --build=${MINGW_CHOST} \
+    --prefix=${MINGW_PREFIX} \
+    --libexecdir=${MINGW_PREFIX}/lib \
+    --disable-manpages \
+    --enable-introspection
+  make
+}
+
+package() {
+  cd "$srcdir/build-${MINGW_CHOST}"
+  make DESTDIR=$pkgdir install
+}