changeset 1952:cbbc5b45f1f8

new package p11-kit
author Mark Brand <mabrand@mabrand.nl>
date Fri, 19 Aug 2011 14:14:58 +0200
parents d58e1dd10c0a
children fccf6239b8cd
files src/p11-kit-1-fixes.patch src/p11-kit.mk
diffstat 2 files changed, 116 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/p11-kit-1-fixes.patch	Fri Aug 19 14:14:58 2011 +0200
@@ -0,0 +1,88 @@
+This file is part of mingw-cross-env.
+See doc/index.html for further information.
+
+Contains ad hoc patches for cross building.
+
+From 3d4e0e4f8a2dda773cd264b113ac8a61e913a9d5 Mon Sep 17 00:00:00 2001
+From: mingw-cross-env
+Date: Wed, 17 Aug 2011 21:25:23 +0200
+Subject: [PATCH 1/3] no pwd.h for windows
+
+
+diff --git a/p11-kit/conf.c b/p11-kit/conf.c
+index 55e0268..d9aaf69 100644
+--- a/p11-kit/conf.c
++++ b/p11-kit/conf.c
+@@ -50,7 +50,9 @@
+ #include <ctype.h>
+ #include <dirent.h>
+ #include <errno.h>
++#ifndef _WIN32
+ #include <pwd.h>
++#endif
+ #include <stdarg.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+@@ -338,6 +340,7 @@ expand_user_path (const char *path)
+ 		env = getenv ("HOME");
+ 		if (env && env[0]) {
+ 			return strconcat (env, path + 1, NULL);
++#ifndef _WIN32
+ 		} else {
+ 			pwd = getpwuid (getuid ());
+ 			if (!pwd) {
+@@ -348,6 +351,7 @@ expand_user_path (const char *path)
+ 				return NULL;
+ 			}
+ 			return strconcat (pwd->pw_dir, path + 1, NULL);
++#endif
+ 		}
+ 	}
+ 
+-- 
+1.7.6
+
+
+From db04a7c8720f46f1e30a97033e1368245818ff8c Mon Sep 17 00:00:00 2001
+From: mingw-cross-env
+Date: Wed, 17 Aug 2011 21:43:11 +0200
+Subject: [PATCH 2/3] no pthread_atfork for windows
+
+
+diff --git a/p11-kit/modules.c b/p11-kit/modules.c
+index 97fb58f..0d22aa5 100644
+--- a/p11-kit/modules.c
++++ b/p11-kit/modules.c
+@@ -522,7 +522,9 @@ init_globals_unlocked (void)
+ 	if (once)
+ 		return CKR_OK;
+ 
++#ifndef _WIN32
+ 	pthread_atfork (NULL, NULL, reinitialize_after_fork);
++#endif
+ 	once = 1;
+ 
+ 	return CKR_OK;
+-- 
+1.7.6
+
+
+From 62cee086ce38db2a2570ae63e6ab4a2fa593aee2 Mon Sep 17 00:00:00 2001
+From: mingw-cross-env
+Date: Wed, 17 Aug 2011 21:41:45 +0200
+Subject: [PATCH 3/3] add Libs.private for static linking
+
+
+diff --git a/p11-kit/p11-kit-1.pc.in b/p11-kit/p11-kit-1.pc.in
+index 9ef67a3..1fcf860 100644
+--- a/p11-kit/p11-kit-1.pc.in
++++ b/p11-kit/p11-kit-1.pc.in
+@@ -15,4 +15,5 @@ Name: p11-kit
+ Description: Library and proxy module for properly loading and sharing PKCS#11 modules.
+ Version: @VERSION@
+ Libs: -L${libdir} -lp11-kit
++Libs.private: -ldl -lintl -liconv -lpthread
+ Cflags: -I${includedir}/p11-kit-1
+-- 
+1.7.6
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/p11-kit.mk	Fri Aug 19 14:14:58 2011 +0200
@@ -0,0 +1,28 @@
+# This file is part of mingw-cross-env.
+# See doc/index.html for further information.
+
+# p11-kit
+PKG             := p11-kit
+$(PKG)_IGNORE   :=
+$(PKG)_VERSION  := 0.3
+$(PKG)_CHECKSUM := 5568c659f11e9bf3f3d70d54778e4653ac998d22
+$(PKG)_SUBDIR   := $(PKG)-$($(PKG)_VERSION)
+$(PKG)_FILE     := $(PKG)-$($(PKG)_VERSION).tar.gz
+$(PKG)_WEBSITE  := http://p11-glue.freedesktop.org/
+$(PKG)_URL      := http://p11-glue.freedesktop.org/releases/$($(PKG)_FILE)
+$(PKG)_DEPS     := gcc dlfcn-win32
+
+define $(PKG)_UPDATE
+    wget -q -O- 'http://cgit.freedesktop.org/p11-glue/p11-kit/refs/tags' | \
+    $(SED) -n "s,.*<a href='[^']*/tag/?id=[^0-9]*\\([0-9][^']*\\)'.*,\\1,p" | \
+    head -1
+endef
+
+define $(PKG)_BUILD
+    cd '$(1)' && ./configure \
+        --host='$(TARGET)' \
+        --disable-shared \
+        --enable-static \
+        --prefix='$(PREFIX)/$(TARGET)'
+    $(MAKE) -C '$(1)/p11-kit' -j '$(JOBS)' install
+endef