dev-libs/cryptlib: fixups
authorAlon Bar-Lev <alonbl@gentoo.org>
Sun, 5 Feb 2017 19:02:42 +0000 (21:02 +0200)
committerAlon Bar-Lev <alonbl@gentoo.org>
Sun, 5 Feb 2017 19:03:10 +0000 (21:03 +0200)
Remove cflags translations based on upstream recommendation
we should interact with upstream if there are issues.

Remove the test patch as it was not helpful, tests were
accessing network anyway. Added restrict tests.

Add static-libs USE for pleasure

Package-Manager: portage-2.3.3

dev-libs/cryptlib/cryptlib-3.4.3.1-r2.ebuild [moved from dev-libs/cryptlib/cryptlib-3.4.3.1-r1.ebuild with 87% similarity]
dev-libs/cryptlib/files/cryptlib-3.4.3.1-tests.patch [deleted file]

similarity index 87%
rename from dev-libs/cryptlib/cryptlib-3.4.3.1-r1.ebuild
rename to dev-libs/cryptlib/cryptlib-3.4.3.1-r2.ebuild
index d63a9590a4edd4c01d3b4ec3131153173f5ac5a9..b9161e529325298b48ed8ce3f40cf0aaa4591a2e 100644 (file)
@@ -20,7 +20,7 @@ SRC_URI="ftp://ftp.franken.de/pub/crypt/cryptlib/cl${MY_PV}.zip
 LICENSE="Sleepycat"
 KEYWORDS="~amd64 ~x86"
 SLOT="0"
-IUSE="doc ldap odbc python test"
+IUSE="doc ldap odbc python static-libs test"
 
 S="${WORKDIR}"
 
@@ -34,9 +34,11 @@ DEPEND="${RDEPEND}
 PATCHES=(
        "${FILESDIR}/${P}-build.patch"
        "${FILESDIR}/${P}-zlib.patch"
-       "${FILESDIR}/${P}-tests.patch"
 )
 
+# test access the network
+RESTRICT="test"
+
 src_unpack() {
        # we need the -a option, so we can not use 'unpack'
        unzip -qoa "${DISTDIR}/cl${MY_PV}.zip" || die
@@ -68,19 +70,12 @@ src_prepare() {
 }
 
 src_compile() {
-       # At least -O2 is needed.
-       replace-flags -O  -O2
-       replace-flags -O0 -O2
-       replace-flags -O1 -O2
-       replace-flags -Os -O2
-       is-flagq -O* || append-flags -O2
-
        use ldap && append-cppflags -DHAS_LDAP
        use odbc && append-cppflags -DHAS_ODBC
 
        export DISABLE_AUTODETECT=1
-       emake EXTRA_CFLAGS="${CPPFLAGS} ${CFLAGS}" default
        emake EXTRA_CFLAGS="${CPPFLAGS} ${CFLAGS}" shared
+       use static-libs && emake EXTRA_CFLAGS="${CPPFLAGS} ${CFLAGS}" default
        use test && emake EXTRA_CFLAGS="${CPPFLAGS} ${CFLAGS}" stestlib
 
        #
@@ -94,10 +89,6 @@ src_compile() {
        ln -s "${solibname}" libcl.so || die
 
        if use python; then
-
-               # Python bindings don't work with -O2 and higher.
-               replace-flags -O* -O1
-
                wrap_python ${FUNCNAME}
        fi
 }
@@ -112,7 +103,7 @@ src_install() {
        doheader cryptlib.h
 
        dolib.so libcl.so*
-       dolib.a libcl.a
+       use static-libs && dolib.a libcl.a
 
        if use doc; then
                newdoc "${DOC_PREFIX}-manual.pdf" "manual.pdf"
diff --git a/dev-libs/cryptlib/files/cryptlib-3.4.3.1-tests.patch b/dev-libs/cryptlib/files/cryptlib-3.4.3.1-tests.patch
deleted file mode 100644 (file)
index f18bc96..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-From c25dad21f5b1db106e4fe42f38a0dac6290b8a41 Mon Sep 17 00:00:00 2001
-From: Alon Bar-Lev <alon.barlev@gmail.com>
-Date: Sat, 4 Feb 2017 05:48:54 +0200
-Subject: [PATCH] tests: disable online tests
-
-Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
----
- test/testfunc.c | 6 ++++++
- 1 file changed, 6 insertions(+)
-
-diff --git a/test/testfunc.c b/test/testfunc.c
-index 79d7148..017a4a8 100644
---- a/test/testfunc.c
-+++ b/test/testfunc.c
-@@ -1119,6 +1119,7 @@ BOOLEAN testSessions( void )
-               }
-       if( !testSessionAttributes() )
-               return( FALSE );
-+#if 0
-       if( !testSessionSSH() )
-               return( FALSE );
-       if( !testSessionSSHPubkeyAuth() )
-@@ -1127,6 +1128,7 @@ BOOLEAN testSessions( void )
-               return( FALSE );
-       if( !testSessionSSHExec() )
-               return( FALSE );
-+#endif
-       if( !testSessionSSL() )
-               return( FALSE );
-       if( !testSessionSSLLocalSocket() )
-@@ -1147,14 +1149,18 @@ BOOLEAN testSessions( void )
-       if( !testSessionTLS12ClientCert() )
-               return( FALSE );
- #endif /* 0 */
-+#if 0
-       if( !testSessionOCSP() )
-               return( FALSE );
-+#endif
-+#if 0
-       if( !testSessionTSP() )
-               return( FALSE );
-       if( !testSessionEnvTSP() )
-               return( FALSE );
-       if( !testSessionCMP() )
-               return( FALSE );
-+#endif
-       return( TRUE );
-       }
--- 
-2.10.2
-