[gentoo-commits] repo/gentoo:master commit in: dev-lua/lua-openssl/files/, dev-lua/lua-openssl/

2018-10-06 Thread Michał Górny
commit: 762dee6c53a540946e0c270d7d585464086782e5
Author: Matthias Hauber  fnordpipe  org>
AuthorDate: Mon Oct  1 21:31:27 2018 +
Commit: Michał Górny  gentoo  org>
CommitDate: Sat Oct  6 07:11:00 2018 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=762dee6c

dev-lua/lua-openssl: fix libressl build

backports libressl compat from master branch and disables
  cms, sm2 and srp.
Additionally set dependency to libressl < 2.7.0 because there
are changes in the libressl-2.7 api that raises
a lot of incompatible pointer types.

Closes: https://bugs.gentoo.org/667390
Signed-off-by: Matthias Hauber  fnordpipe.org>
Signed-off-by: Michał Górny  gentoo.org>
Closes: https://github.com/gentoo/gentoo/pull/10039

 .../files/0001-fix-libressl-compat.patch   | 433 +
 dev-lua/lua-openssl/lua-openssl-0.7.3.ebuild   |   4 +-
 2 files changed, 436 insertions(+), 1 deletion(-)

diff --git a/dev-lua/lua-openssl/files/0001-fix-libressl-compat.patch 
b/dev-lua/lua-openssl/files/0001-fix-libressl-compat.patch
new file mode 100644
index 000..19b0539c082
--- /dev/null
+++ b/dev-lua/lua-openssl/files/0001-fix-libressl-compat.patch
@@ -0,0 +1,433 @@
+From 44d5360d0caed1f4f364691f789fe825fcd17a3e Mon Sep 17 00:00:00 2001
+From: crito 
+Date: Mon, 1 Oct 2018 20:10:05 +0200
+Subject: [PATCH] fix libressl compat
+
+add conditions to build with libressl and add missing functions.
+backported from upstream repo.
+---
+ src/compat.c  | 11 ---
+ src/digest.c  |  2 +-
+ src/ec.c  |  2 +-
+ src/engine.c  | 10 +-
+ src/lhash.c   |  7 ---
+ src/openssl.c | 12 ++--
+ src/ots.c |  5 +
+ src/pkcs7.c   | 24 
+ src/private.h |  7 ---
+ src/sm2.c |  2 +-
+ src/srp.c |  3 ++-
+ src/x509.c|  2 +-
+ 12 files changed, 54 insertions(+), 33 deletions(-)
+
+diff --git a/src/compat.c b/src/compat.c
+index cc4cc21..cc45845 100644
+--- a/src/compat.c
 b/src/compat.c
+@@ -5,7 +5,7 @@
+ #include "openssl.h"
+ #include "private.h"
+ 
+-#if OPENSSL_VERSION_NUMBER < 0x1010L
++#if OPENSSL_VERSION_NUMBER < 0x1010L || defined(LIBRESSL_VERSION_NUMBER)
+ int BIO_up_ref(BIO *b)
+ {
+   CRYPTO_add(>references, 1, CRYPTO_LOCK_BIO);
+@@ -16,6 +16,11 @@ int X509_up_ref(X509 *x)
+   CRYPTO_add(>references, 1, CRYPTO_LOCK_X509);
+   return 1;
+ }
++int X509_CRL_up_ref(X509_CRL *x)
++{
++  int refs = CRYPTO_add(>references, 1, CRYPTO_LOCK_X509_CRL);
++  return (refs > 1) ? 1 : 0;
++}
+ int X509_STORE_up_ref(X509_STORE *s)
+ {
+   CRYPTO_add(>references, 1, CRYPTO_LOCK_X509_STORE);
+@@ -464,7 +469,7 @@ const ASN1_BIT_STRING 
*TS_STATUS_INFO_get0_failure_info(const TS_STATUS_INFO *a)
+   return a->failure_info;
+ }
+ 
+-#if OPENSSL_VERSION_NUMBER < 0x10002000L
++#if OPENSSL_VERSION_NUMBER < 0x10002000L || defined(LIBRESSL_VERSION_NUMBER)
+ int i2d_re_X509_tbs(X509 *x, unsigned char **pp)
+ {
+   x->cert_info->enc.modified = 1;
+@@ -527,4 +532,4 @@ unsigned char *TS_VERIFY_CTX_set_imprint(TS_VERIFY_CTX 
*ctx,
+   return ctx->imprint;
+ }
+ 
+-#endif /* < 1.1.0 */
+\ No newline at end of file
++#endif /* < 1.1.0 */
+diff --git a/src/digest.c b/src/digest.c
+index 02e8fe1..0dcf65b 100644
+--- a/src/digest.c
 b/src/digest.c
+@@ -468,7 +468,7 @@ restore md data
+ static LUA_FUNCTION(openssl_digest_ctx_data)
+ {
+   EVP_MD_CTX *ctx = CHECK_OBJECT(1, EVP_MD_CTX, "openssl.evp_digest_ctx");
+-#if OPENSSL_VERSION_NUMBER < 0x1010L
++#if OPENSSL_VERSION_NUMBER < 0x1010L || defined(LIBRESSL_VERSION_NUMBER)
+   if (lua_isnone(L, 2))
+   {
+ lua_pushlstring(L, ctx->md_data, ctx->digest->ctx_size);
+diff --git a/src/ec.c b/src/ec.c
+index f0d2b6b..5db32db 100644
+--- a/src/ec.c
 b/src/ec.c
+@@ -611,7 +611,7 @@ static int openssl_ecdsa_set_method(lua_State *L)
+ {
+   EC_KEY *ec = CHECK_OBJECT(1, EC_KEY, "openssl.ec_key");
+   ENGINE *e = CHECK_OBJECT(2, ENGINE, "openssl.engine");
+-#if OPENSSL_VERSION_NUMBER < 0x1010L
++#if OPENSSL_VERSION_NUMBER < 0x1010L || defined(LIBRESSL_VERSION_NUMBER)
+   const ECDSA_METHOD *m = ENGINE_get_ECDSA(e);
+   if (m) {
+ int r = ECDSA_set_method(ec, m);
+diff --git a/src/engine.c b/src/engine.c
+index 1a26d8b..f12ca53 100644
+--- a/src/engine.c
 b/src/engine.c
+@@ -14,7 +14,7 @@ enum
+ {
+   TYPE_RSA,
+   TYPE_DSA,
+-#if OPENSSL_VERSION_NUMBER < 0x1010L
++#if OPENSSL_VERSION_NUMBER < 0x1010L || defined(LIBRESSL_VERSION_NUMBER)
+   TYPE_ECDH,
+   TYPE_ECDSA,
+ #else
+@@ -24,7 +24,7 @@ enum
+   TYPE_RAND,
+   TYPE_CIPHERS,
+   TYPE_DIGESTS,
+-#if OPENSSL_VERSION_NUMBER < 0x1010L
++#if OPENSSL_VERSION_NUMBER < 0x1010L || defined(LIBRESSL_VERSION_NUMBER)
+   TYPE_STORE,
+ #else
+   TYPE_PKEY_METHODS,
+@@ -150,7 +150,7 @@ static int openssl_engine_register(lua_State*L)
+   else
+ ENGINE_register_DSA(eng);
+   break;
+-#if OPENSSL_VERSION_NUMBER < 0x1010L
++#if OPENSSL_VERSION_NUMBER < 0x1010L || defined(LIBRESSL_VERSION_NUMBER)

[gentoo-commits] repo/gentoo:master commit in: dev-lua/lua-openssl/files/, dev-lua/lua-openssl/

2015-10-06 Thread Michał Górny
commit: 6dc179438eec2c60cd8ba4e276741449d6e8caee
Author: Jakub Jirutka  jirutka  cz>
AuthorDate: Sat Oct  3 14:36:35 2015 +
Commit: Michał Górny  gentoo  org>
CommitDate: Tue Oct  6 21:16:11 2015 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6dc17943

dev-lua/lua-openssl: new package

 dev-lua/lua-openssl/Manifest   |  1 +
 .../files/lua-openssl-0.4.1-Makefile.patch | 86 ++
 dev-lua/lua-openssl/lua-openssl-0.4.1.ebuild   | 45 +++
 dev-lua/lua-openssl/metadata.xml   | 16 
 4 files changed, 148 insertions(+)

diff --git a/dev-lua/lua-openssl/Manifest b/dev-lua/lua-openssl/Manifest
new file mode 100644
index 000..1b7e99d
--- /dev/null
+++ b/dev-lua/lua-openssl/Manifest
@@ -0,0 +1 @@
+DIST lua-openssl-0.4.1.tar.gz 363525 SHA256 
cce51e33b07b6450854d2e57e129b5f369b749a780d58c44719c834f198ee340 SHA512 
c6deda86f77f9d6de1863611db9eb82506ea9789ec0425cb40cdb7d142d53aa633d53e1446b7eeb464636261385822d9cedc841bd35163931cc3758e7c3a308d
 WHIRLPOOL 
cbb5367bc7b716bcde731340339e7dafc3b4c5a542e1cf30e4fcf1d6c720e4f49676afe33f77860ab1da0a55b6dde434d0c312ae42c96765512494c6e8bbeb49

diff --git a/dev-lua/lua-openssl/files/lua-openssl-0.4.1-Makefile.patch 
b/dev-lua/lua-openssl/files/lua-openssl-0.4.1-Makefile.patch
new file mode 100644
index 000..bf5374e
--- /dev/null
+++ b/dev-lua/lua-openssl/files/lua-openssl-0.4.1-Makefile.patch
@@ -0,0 +1,86 @@
+From: Jakub Jirutka 
+
+Fix Makefile to respect system CFLAGS, LDFLAGS, and CC provided by environment.
+Allow to specify pkg-config command using variable, to be friendly with
+cross-compiling etc.
+
+diff --git a/Makefile b/Makefile
+index 195ef6b..375fb65 100644
+--- a/Makefile
 b/Makefile
+@@ -2,9 +2,10 @@ T=openssl
+ 
+ PREFIX?=/usr/local
+ LIB_OPTION?= -shared 
++PKG_CONFIG?= pkg-config
+ 
+ #Lua auto detect
+-LUA_VERSION ?= $(shell pkg-config luajit --print-provides)
++LUA_VERSION ?= $(shell $(PKG_CONFIG) luajit --print-provides)
+ ifeq ($(LUA_VERSION),)  Not use luajit
+ LUAV  ?= $(shell lua -e "_,_,v=string.find(_VERSION,'Lua 
(.+)');print(v)")
+ LUA_CFLAGS?= -I$(PREFIX)/include/lua$(LUAV)
+@@ -12,8 +13,8 @@ LUA_LIBS ?= -L$(PREFIX)/lib
+ LUA_LIBDIR?= $(PREFIX)/lib/lua/$(LUAV)
+ else
+ LUAV  ?= $(shell lua -e "_,_,v=string.find(_VERSION,'Lua 
(.+)');print(v)")
+-LUA_CFLAGS?= $(shell pkg-config luajit --cflags)
+-LUA_LIBS  ?= $(shell pkg-config luajit --libs)
++LUA_CFLAGS?= $(shell $(PKG_CONFIG) luajit --cflags)
++LUA_LIBS  ?= $(shell $(PKG_CONFIG) luajit --libs)
+ LUA_LIBDIR?= $(PREFIX)/lib/lua/$(LUAV)
+ endif
+ 
+@@ -22,30 +23,30 @@ SYS := $(shell gcc -dumpmachine)
+ 
+ ifneq (, $(findstring linux, $(SYS)))
+ # Do linux things
+-LDFLAGS   = -fPIC -lrt -ldl
+-OPENSSL_LIBS  ?= $(shell pkg-config openssl --libs) 
+-OPENSSL_CFLAGS?= $(shell pkg-config openssl --cflags)
+-CFLAGS= -fPIC $(OPENSSL_CFLAGS) $(LUA_CFLAGS)
++LDFLAGS   += -fPIC -lrt -ldl
++OPENSSL_LIBS  ?= $(shell $(PKG_CONFIG) openssl --libs) 
++OPENSSL_CFLAGS?= $(shell $(PKG_CONFIG) openssl --cflags)
++CFLAGS+= -fPIC $(OPENSSL_CFLAGS) $(LUA_CFLAGS)
+ endif
+ ifneq (, $(findstring apple, $(SYS)))
+ # Do darwin things
+-LDFLAGS   = -fPIC -lrt -ldl
+-OPENSSL_LIBS  ?= $(shell pkg-config openssl --libs) 
+-OPENSSL_CFLAGS?= $(shell pkg-config openssl --cflags)
+-CFLAGS= -fPIC $(OPENSSL_CFLAGS) $(LUA_CFLAGS)
++LDFLAGS   += -fPIC -lrt -ldl
++OPENSSL_LIBS  ?= $(shell $(PKG_CONFIG) openssl --libs) 
++OPENSSL_CFLAGS?= $(shell $(PKG_CONFIG) openssl --cflags)
++CFLAGS+= -fPIC $(OPENSSL_CFLAGS) $(LUA_CFLAGS)
+ endif
+ ifneq (, $(findstring mingw, $(SYS)))
+ # Do mingw things
+ V = $(shell lua -e 
"v=string.gsub('$(LUAV)','%.','');print(v)")
+-LDFLAGS   = -mwindows -lcrypt32 -lssl -lcrypto -lws2_32 
$(PREFIX)/bin/lua$(V).dll 
++LDFLAGS   += -mwindows -lcrypt32 -lssl -lcrypto -lws2_32 
$(PREFIX)/bin/lua$(V).dll
+ LUA_CFLAGS= -DLUA_LIB -DLUA_BUILD_AS_DLL -I$(PREFIX)/include/
+-CFLAGS= $(OPENSSL_CFLAGS) $(LUA_CFLAGS)
++CFLAGS+= $(OPENSSL_CFLAGS) $(LUA_CFLAGS)
+ endif
+ ifneq (, $(findstring cygwin, $(SYS)))
+ # Do cygwin things
+-OPENSSL_LIBS  ?= $(shell pkg-config openssl --libs) 
+-OPENSSL_CFLAGS  ?= $(shell pkg-config openssl --cflags)
+-CFLAGS= -fPIC $(OPENSSL_CFLAGS) $(LUA_CFLAGS)
++OPENSSL_LIBS  ?= $(shell $(PKG_CONFIG) openssl --libs) 
++OPENSSL_CFLAGS  ?= $(shell $(PKG_CONFIG) openssl --cflags)
++CFLAGS+= -fPIC $(OPENSSL_CFLAGS) $(LUA_CFLAGS)
+ endif
+ #custome config
+ ifeq (.config, $(wildcard .config))
+@@ -61,7 +62,7 @@ WARN_MOST= -Wall -W -Waggregate-return -Wcast-align