summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2012-01-02 19:40:31 +0000
committerMike Frysinger <vapier@gentoo.org>2012-01-02 19:40:31 +0000
commit27e8048fe2944fec3c91bee383954a8ab02f407a (patch)
treeabf982024ef5bbe5696da98bac9ca64d9851cad5 /dev-libs/libp11
parentSplit out ChangeLog-2011, add ChangeLog entry :) (diff)
downloadgentoo-2-27e8048fe2944fec3c91bee383954a8ab02f407a.tar.gz
gentoo-2-27e8048fe2944fec3c91bee383954a8ab02f407a.tar.bz2
gentoo-2-27e8048fe2944fec3c91bee383954a8ab02f407a.zip
Add patch from upstream to drop libtool requirement #394717.
(Portage version: 2.2.0_alpha81/cvs/Linux x86_64)
Diffstat (limited to 'dev-libs/libp11')
-rw-r--r--dev-libs/libp11/ChangeLog8
-rw-r--r--dev-libs/libp11/files/libp11-0.2.8-no-ltdl.patch196
-rw-r--r--dev-libs/libp11/libp11-0.2.8-r1.ebuild51
3 files changed, 254 insertions, 1 deletions
diff --git a/dev-libs/libp11/ChangeLog b/dev-libs/libp11/ChangeLog
index db7a23c82ecb..ce83d3c96bd9 100644
--- a/dev-libs/libp11/ChangeLog
+++ b/dev-libs/libp11/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for dev-libs/libp11
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-libs/libp11/ChangeLog,v 1.59 2012/01/01 15:55:19 armin76 Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-libs/libp11/ChangeLog,v 1.60 2012/01/02 19:40:31 vapier Exp $
+
+*libp11-0.2.8-r1 (02 Jan 2012)
+
+ 02 Jan 2012; Mike Frysinger <vapier@gentoo.org> +libp11-0.2.8-r1.ebuild,
+ +files/libp11-0.2.8-no-ltdl.patch:
+ Add patch from upstream to drop libtool requirement #394717.
01 Jan 2012; Raúl Porcel <armin76@gentoo.org> libp11-0.2.8.ebuild:
alpha/ia64/sparc stable wrt #393865
diff --git a/dev-libs/libp11/files/libp11-0.2.8-no-ltdl.patch b/dev-libs/libp11/files/libp11-0.2.8-no-ltdl.patch
new file mode 100644
index 000000000000..f3997ba65ba1
--- /dev/null
+++ b/dev-libs/libp11/files/libp11-0.2.8-no-ltdl.patch
@@ -0,0 +1,196 @@
+patch from upstream
+
+From 1c872a3e9c4cbf3cbd485168a7e98b589bbad57a Mon Sep 17 00:00:00 2001
+From: alonbl <alonbl@6d86ddd8-19ff-0310-a323-aa2ba648d307>
+Date: Wed, 14 Dec 2011 10:46:45 +0000
+Subject: [PATCH] Remove ltdl usage
+
+Use native POSIX/Windows
+
+
+git-svn-id: http://www.opensc-project.org/svn/libp11/trunk@202 6d86ddd8-19ff-0310-a323-aa2ba648d307
+---
+ configure.ac | 23 +++++------------------
+ src/Makefile.am | 4 ++--
+ src/Makefile.mak | 7 ++-----
+ src/libpkcs11.c | 52 +++++++++++++++++++++++++++++++++++++++-------------
+ 4 files changed, 48 insertions(+), 38 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 679b8da..9fa96bf 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -180,25 +180,14 @@ if test "${svn_checkout}" = "yes"; then
+ fi
+ fi
+
+-AC_ARG_VAR([LTLIB_CFLAGS], [C compiler flags for libltdl])
+-AC_ARG_VAR([LTLIB_LIBS], [linker flags for libltdl])
+-if test -z "${LTLIB_LIBS}"; then
++if test "${WIN32}" != "yes"; then
+ AC_CHECK_LIB(
+- [ltdl],
+- [lt_dlopen],
+- [LTLIB_LIBS="-lltdl"],
+- [AC_MSG_ERROR([ltdl not found, please install libltdl and/or libtool])]
++ [dl],
++ [dlopen],
++ ,
++ [AC_MSG_ERROR([libdl required])]
+ )
+-
+ fi
+-saved_CFLAGS="${CFLAGS}"
+-CFLAGS="${CFLAGS} ${LTLIB_CFLAGS}"
+-AC_CHECK_HEADER(
+- [ltdl.h],
+- ,
+- [AC_MSG_ERROR([ltdl.h not found, please install libltdl and/or libtool])]
+-)
+-CFLAGS="${saved_CFLAGS}"
+
+ PKG_CHECK_MODULES(
+ [OPENSSL],
+@@ -273,8 +262,6 @@ Compiler flags: ${CFLAGS}
+ Linker flags: ${LDFLAGS}
+ Libraries: ${LIBS}
+
+-LTLIB_CFLAGS: ${LTLIB_CFLAGS}
+-LTLIB_LIBS: ${LTLIB_LIBS}
+ OPENSSL_CFLAGS: ${OPENSSL_CFLAGS}
+ OPENSSL_LIBS: ${OPENSSL_LIBS}
+
+diff --git a/src/Makefile.am b/src/Makefile.am
+index c66a8cd..0910f44 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -16,8 +16,8 @@ libp11_la_SOURCES += versioninfo.rc
+ else
+ dist_noinst_DATA = versioninfo.rc
+ endif
+-libp11_la_CFLAGS = $(AM_CFLAGS) $(OPENSSL_CFLAGS) $(LTLIB_CFLAGS)
+-libp11_la_LIBADD = $(OPENSSL_LIBS) $(LTLIB_LIBS)
++libp11_la_CFLAGS = $(AM_CFLAGS) $(OPENSSL_CFLAGS)
++libp11_la_LIBADD = $(OPENSSL_LIBS)
+ libp11_la_LDFLAGS = $(AM_LDFLAGS) \
+ -version-info @LIBP11_LT_CURRENT@:@LIBP11_LT_REVISION@:@LIBP11_LT_AGE@ \
+ -export-symbols "$(srcdir)/libp11.exports" \
+diff --git a/src/Makefile.mak b/src/Makefile.mak
+index 73b5428..fa0809c 100644
+--- a/src/Makefile.mak
++++ b/src/Makefile.mak
+@@ -1,10 +1,7 @@
+-LIBLTDL_INC = # E.g. /IC:\libtool-1.5.8-lib\include
+-LIBLTDL_LIB = # E.g. C:\libtool-1.5.8-lib\lib\libltdl.lib
+-
+ OPENSSL_INC = /IC:\openssl\include
+ OPENSSL_LIB = C:\openssl\out32dll\libeay32.lib
+
+-COPTS = /Zi /MD /nologo /I..\ /I. $(OPENSSL_INC) $(LIBLTDL_INC) /D_WIN32_WINNT=0x0400 /DWIN32 /DWIN32_LEAN_AND_MEAN
++COPTS = /Zi /MD /nologo /I..\ /I. $(OPENSSL_INC) /D_WIN32_WINNT=0x0400 /DWIN32 /DWIN32_LEAN_AND_MEAN
+ LINKFLAGS = /DEBUG /NOLOGO /INCREMENTAL:NO /MACHINE:IX86
+
+ TARGET = libp11.dll
+@@ -28,6 +25,6 @@ $(TARGET): $(OBJECTS) versioninfo.res
+ echo EXPORTS >> $*.def
+ type $*.exports >> $*.def
+ link $(LINKFLAGS) /dll /def:$*.def /implib:$*.lib /out:$(TARGET) \
+- $(OBJECTS) $(OPENSSL_LIB) $(LIBLTDL_LIB) versioninfo.res
++ $(OBJECTS) $(OPENSSL_LIB) versioninfo.res
+ if EXIST $*.dll.manifest mt -manifest $*.dll.manifest -outputresource:$*.dll;2
+
+diff --git a/src/libpkcs11.c b/src/libpkcs11.c
+index a146361..93584d9 100644
+--- a/src/libpkcs11.c
++++ b/src/libpkcs11.c
+@@ -27,14 +27,18 @@
+ #include <stdlib.h>
+ #include <stdio.h>
+ #include <string.h>
+-#include <ltdl.h>
++#ifdef WIN32
++#include <windows.h>
++#else
++#include <dlfcn.h>
++#endif
+ #include "libp11-int.h"
+
+ #define MAGIC 0xd00bed00
+
+ struct sc_pkcs11_module {
+ unsigned int _magic;
+- lt_dlhandle handle;
++ void *handle;
+ };
+ typedef struct sc_pkcs11_module sc_pkcs11_module_t;
+
+@@ -52,19 +56,40 @@ C_LoadModule(const char *mspec, CK_FUNCTION_LIST_PTR_PTR funcs)
+ if (mspec == NULL)
+ return NULL;
+
+- if (lt_dlinit() != 0)
+- return NULL;
+-
+ mod = (sc_pkcs11_module_t *) calloc(1, sizeof(*mod));
+ mod->_magic = MAGIC;
+
+- mod->handle = lt_dlopen(mspec);
++#ifdef WIN32
++ mod->handle = LoadLibraryA(mspec);
++#else
++ mod->handle = dlopen(mspec, RTLD_NOW);
++#endif
++
+ if (mod->handle == NULL)
+ goto failed;
+
+- /* Get the list of function pointers */
+- c_get_function_list = (CK_RV (*)(CK_FUNCTION_LIST_PTR_PTR))
+- lt_dlsym(mod->handle, "C_GetFunctionList");
++#ifdef WIN32
++ c_get_function_list = (CK_C_GetFunctionList)GetProcAddress (
++ mod->handle,
++ "C_GetFunctionList"
++ );
++#else
++ {
++ /*
++ * Make compiler happy!
++ */
++ void *p = dlsym(
++ mod->handle,
++ "C_GetFunctionList"
++ );
++ memmove(
++ &c_get_function_list,
++ &p,
++ sizeof(void *)
++ );
++ }
++#endif
++
+ if (!c_get_function_list)
+ goto failed;
+ rv = c_get_function_list(funcs);
+@@ -89,13 +114,14 @@ C_UnloadModule(void *module)
+ if (!mod || mod->_magic != MAGIC)
+ return CKR_ARGUMENTS_BAD;
+
+- if (lt_dlclose(mod->handle) < 0)
+- return CKR_FUNCTION_FAILED;
++#ifdef WIN32
++ FreeLibrary(mod->handle);
++#else
++ dlclose(mod->handle);
++#endif
+
+ memset(mod, 0, sizeof(*mod));
+ free(mod);
+
+- lt_dlexit();
+-
+ return CKR_OK;
+ }
+--
+1.7.6.1
+
diff --git a/dev-libs/libp11/libp11-0.2.8-r1.ebuild b/dev-libs/libp11/libp11-0.2.8-r1.ebuild
new file mode 100644
index 000000000000..578247f18ece
--- /dev/null
+++ b/dev-libs/libp11/libp11-0.2.8-r1.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-libs/libp11/libp11-0.2.8-r1.ebuild,v 1.1 2012/01/02 19:40:31 vapier Exp $
+
+EAPI="4"
+inherit eutils autotools
+
+DESCRIPTION="A library implementing a layer on top of PKCS#11 API to make using PKCS#11 implementations easier."
+HOMEPAGE="http://www.opensc-project.org/libp11/"
+
+if [[ "${PV}" = "9999" ]]; then
+ inherit autotools subversion
+ ESVN_REPO_URI="http://www.opensc-project.org/svn/${PN}/trunk"
+else
+ SRC_URI="http://www.opensc-project.org/files/${PN}/${P}.tar.gz"
+fi
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86"
+IUSE="doc"
+
+RDEPEND="dev-libs/openssl"
+DEPEND="${RDEPEND}
+ dev-util/pkgconfig
+ doc? ( app-doc/doxygen )"
+
+if [[ "${PV}" = "9999" ]]; then
+ DEPEND="${DEPEND}
+ app-text/docbook-xsl-stylesheets
+ dev-libs/libxslt"
+fi
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-no-ltdl.patch
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ --docdir="/usr/share/doc/${PF}" \
+ --htmldir="/usr/share/doc/${PF}/html" \
+ --enable-shared --disable-static \
+ --enable-doc \
+ $(use_enable doc api-doc)
+}
+
+src_install() {
+ emake install DESTDIR="${D}" || die "emake install failed"
+ find "${D}" -name '*.la' -delete
+}