1 |
commit: 6dc179438eec2c60cd8ba4e276741449d6e8caee |
2 |
Author: Jakub Jirutka <jakub <AT> jirutka <DOT> cz> |
3 |
AuthorDate: Sat Oct 3 14:36:35 2015 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Oct 6 21:16:11 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6dc17943 |
7 |
|
8 |
dev-lua/lua-openssl: new package |
9 |
|
10 |
dev-lua/lua-openssl/Manifest | 1 + |
11 |
.../files/lua-openssl-0.4.1-Makefile.patch | 86 ++++++++++++++++++++++ |
12 |
dev-lua/lua-openssl/lua-openssl-0.4.1.ebuild | 45 +++++++++++ |
13 |
dev-lua/lua-openssl/metadata.xml | 16 ++++ |
14 |
4 files changed, 148 insertions(+) |
15 |
|
16 |
diff --git a/dev-lua/lua-openssl/Manifest b/dev-lua/lua-openssl/Manifest |
17 |
new file mode 100644 |
18 |
index 0000000..1b7e99d |
19 |
--- /dev/null |
20 |
+++ b/dev-lua/lua-openssl/Manifest |
21 |
@@ -0,0 +1 @@ |
22 |
+DIST lua-openssl-0.4.1.tar.gz 363525 SHA256 cce51e33b07b6450854d2e57e129b5f369b749a780d58c44719c834f198ee340 SHA512 c6deda86f77f9d6de1863611db9eb82506ea9789ec0425cb40cdb7d142d53aa633d53e1446b7eeb464636261385822d9cedc841bd35163931cc3758e7c3a308d WHIRLPOOL cbb5367bc7b716bcde731340339e7dafc3b4c5a542e1cf30e4fcf1d6c720e4f49676afe33f77860ab1da0a55b6dde434d0c312ae42c96765512494c6e8bbeb49 |
23 |
|
24 |
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 |
25 |
new file mode 100644 |
26 |
index 0000000..bf5374e |
27 |
--- /dev/null |
28 |
+++ b/dev-lua/lua-openssl/files/lua-openssl-0.4.1-Makefile.patch |
29 |
@@ -0,0 +1,86 @@ |
30 |
+From: Jakub Jirutka <jakub@×××××××.cz> |
31 |
+ |
32 |
+Fix Makefile to respect system CFLAGS, LDFLAGS, and CC provided by environment. |
33 |
+Allow to specify pkg-config command using variable, to be friendly with |
34 |
+cross-compiling etc. |
35 |
+ |
36 |
+diff --git a/Makefile b/Makefile |
37 |
+index 195ef6b..375fb65 100644 |
38 |
+--- a/Makefile |
39 |
++++ b/Makefile |
40 |
+@@ -2,9 +2,10 @@ T=openssl |
41 |
+ |
42 |
+ PREFIX ?=/usr/local |
43 |
+ LIB_OPTION ?= -shared |
44 |
++PKG_CONFIG ?= pkg-config |
45 |
+ |
46 |
+ #Lua auto detect |
47 |
+-LUA_VERSION ?= $(shell pkg-config luajit --print-provides) |
48 |
++LUA_VERSION ?= $(shell $(PKG_CONFIG) luajit --print-provides) |
49 |
+ ifeq ($(LUA_VERSION),) ############ Not use luajit |
50 |
+ LUAV ?= $(shell lua -e "_,_,v=string.find(_VERSION,'Lua (.+)');print(v)") |
51 |
+ LUA_CFLAGS ?= -I$(PREFIX)/include/lua$(LUAV) |
52 |
+@@ -12,8 +13,8 @@ LUA_LIBS ?= -L$(PREFIX)/lib |
53 |
+ LUA_LIBDIR ?= $(PREFIX)/lib/lua/$(LUAV) |
54 |
+ else |
55 |
+ LUAV ?= $(shell lua -e "_,_,v=string.find(_VERSION,'Lua (.+)');print(v)") |
56 |
+-LUA_CFLAGS ?= $(shell pkg-config luajit --cflags) |
57 |
+-LUA_LIBS ?= $(shell pkg-config luajit --libs) |
58 |
++LUA_CFLAGS ?= $(shell $(PKG_CONFIG) luajit --cflags) |
59 |
++LUA_LIBS ?= $(shell $(PKG_CONFIG) luajit --libs) |
60 |
+ LUA_LIBDIR ?= $(PREFIX)/lib/lua/$(LUAV) |
61 |
+ endif |
62 |
+ |
63 |
+@@ -22,30 +23,30 @@ SYS := $(shell gcc -dumpmachine) |
64 |
+ |
65 |
+ ifneq (, $(findstring linux, $(SYS))) |
66 |
+ # Do linux things |
67 |
+-LDFLAGS = -fPIC -lrt -ldl |
68 |
+-OPENSSL_LIBS ?= $(shell pkg-config openssl --libs) |
69 |
+-OPENSSL_CFLAGS ?= $(shell pkg-config openssl --cflags) |
70 |
+-CFLAGS = -fPIC $(OPENSSL_CFLAGS) $(LUA_CFLAGS) |
71 |
++LDFLAGS += -fPIC -lrt -ldl |
72 |
++OPENSSL_LIBS ?= $(shell $(PKG_CONFIG) openssl --libs) |
73 |
++OPENSSL_CFLAGS ?= $(shell $(PKG_CONFIG) openssl --cflags) |
74 |
++CFLAGS += -fPIC $(OPENSSL_CFLAGS) $(LUA_CFLAGS) |
75 |
+ endif |
76 |
+ ifneq (, $(findstring apple, $(SYS))) |
77 |
+ # Do darwin things |
78 |
+-LDFLAGS = -fPIC -lrt -ldl |
79 |
+-OPENSSL_LIBS ?= $(shell pkg-config openssl --libs) |
80 |
+-OPENSSL_CFLAGS ?= $(shell pkg-config openssl --cflags) |
81 |
+-CFLAGS = -fPIC $(OPENSSL_CFLAGS) $(LUA_CFLAGS) |
82 |
++LDFLAGS += -fPIC -lrt -ldl |
83 |
++OPENSSL_LIBS ?= $(shell $(PKG_CONFIG) openssl --libs) |
84 |
++OPENSSL_CFLAGS ?= $(shell $(PKG_CONFIG) openssl --cflags) |
85 |
++CFLAGS += -fPIC $(OPENSSL_CFLAGS) $(LUA_CFLAGS) |
86 |
+ endif |
87 |
+ ifneq (, $(findstring mingw, $(SYS))) |
88 |
+ # Do mingw things |
89 |
+ V = $(shell lua -e "v=string.gsub('$(LUAV)','%.','');print(v)") |
90 |
+-LDFLAGS = -mwindows -lcrypt32 -lssl -lcrypto -lws2_32 $(PREFIX)/bin/lua$(V).dll |
91 |
++LDFLAGS += -mwindows -lcrypt32 -lssl -lcrypto -lws2_32 $(PREFIX)/bin/lua$(V).dll |
92 |
+ LUA_CFLAGS = -DLUA_LIB -DLUA_BUILD_AS_DLL -I$(PREFIX)/include/ |
93 |
+-CFLAGS = $(OPENSSL_CFLAGS) $(LUA_CFLAGS) |
94 |
++CFLAGS += $(OPENSSL_CFLAGS) $(LUA_CFLAGS) |
95 |
+ endif |
96 |
+ ifneq (, $(findstring cygwin, $(SYS))) |
97 |
+ # Do cygwin things |
98 |
+-OPENSSL_LIBS ?= $(shell pkg-config openssl --libs) |
99 |
+-OPENSSL_CFLAGS ?= $(shell pkg-config openssl --cflags) |
100 |
+-CFLAGS = -fPIC $(OPENSSL_CFLAGS) $(LUA_CFLAGS) |
101 |
++OPENSSL_LIBS ?= $(shell $(PKG_CONFIG) openssl --libs) |
102 |
++OPENSSL_CFLAGS ?= $(shell $(PKG_CONFIG) openssl --cflags) |
103 |
++CFLAGS += -fPIC $(OPENSSL_CFLAGS) $(LUA_CFLAGS) |
104 |
+ endif |
105 |
+ #custome config |
106 |
+ ifeq (.config, $(wildcard .config)) |
107 |
+@@ -61,7 +62,7 @@ WARN_MOST = -Wall -W -Waggregate-return -Wcast-align -Wmissing-prototypes -Wnest |
108 |
+ WARN = -Wall -Wno-unused-value |
109 |
+ WARN_MIN = |
110 |
+ CFLAGS += $(WARN_MIN) -DPTHREADS |
111 |
+-CC= gcc -g $(CFLAGS) -Ideps |
112 |
++CC ?= gcc -g $(CFLAGS) -Ideps |
113 |
+ |
114 |
+ |
115 |
+ OBJS=src/asn1.o src/auxiliar.o src/bio.o src/cipher.o src/cms.o src/compat.o src/crl.o src/csr.o src/dh.o src/digest.o src/dsa.o \ |
116 |
|
117 |
diff --git a/dev-lua/lua-openssl/lua-openssl-0.4.1.ebuild b/dev-lua/lua-openssl/lua-openssl-0.4.1.ebuild |
118 |
new file mode 100644 |
119 |
index 0000000..94b2ce6 |
120 |
--- /dev/null |
121 |
+++ b/dev-lua/lua-openssl/lua-openssl-0.4.1.ebuild |
122 |
@@ -0,0 +1,45 @@ |
123 |
+# Copyright 1999-2015 Gentoo Foundation |
124 |
+# Distributed under the terms of the GNU General Public License v2 |
125 |
+# $Id$ |
126 |
+ |
127 |
+EAPI=5 |
128 |
+ |
129 |
+inherit eutils toolchain-funcs |
130 |
+ |
131 |
+DESCRIPTION="OpenSSL binding for Lua" |
132 |
+HOMEPAGE="https://github.com/zhaozg/lua-openssl" |
133 |
+SRC_URI="https://github.com/zhaozg/lua-openssl/archive/${PV}.tar.gz -> ${P}.tar.gz" |
134 |
+ |
135 |
+LICENSE="MIT openssl PHP-3" |
136 |
+SLOT="0" |
137 |
+KEYWORDS="~amd64 ~x86" |
138 |
+IUSE="luajit" |
139 |
+ |
140 |
+RDEPEND=" |
141 |
+ luajit? ( dev-lang/luajit:2 ) |
142 |
+ !luajit? ( >=dev-lang/lua-5.1:0 ) |
143 |
+ dev-libs/openssl:0" |
144 |
+DEPEND="${RDEPEND} |
145 |
+ virtual/pkgconfig" |
146 |
+ |
147 |
+src_prepare() { |
148 |
+ epatch "${FILESDIR}/${P}-Makefile.patch" |
149 |
+ use luajit && LUAV=luajit || LUAV=lua |
150 |
+} |
151 |
+ |
152 |
+src_compile() { |
153 |
+ local pkgconfig=$(tc-getPKG_CONFIG) |
154 |
+ emake \ |
155 |
+ CC="$(tc-getCC) \$(CFLAGS) -Ideps" \ |
156 |
+ PKG_CONFIG="$pkgconfig" \ |
157 |
+ LUA_CFLAGS="$($pkgconfig --cflags $LUAV)" \ |
158 |
+ LUA_LIBS="$($pkgconfig --libs $LUAV)" \ |
159 |
+ LUA_LIBDIR="$($pkgconfig --variable INSTALL_CMOD $LUAV)" |
160 |
+} |
161 |
+ |
162 |
+src_install() { |
163 |
+ emake \ |
164 |
+ LUA_LIBDIR="${D}$($(tc-getPKG_CONFIG) --variable INSTALL_CMOD $LUAV)" \ |
165 |
+ install |
166 |
+ einstalldocs |
167 |
+} |
168 |
|
169 |
diff --git a/dev-lua/lua-openssl/metadata.xml b/dev-lua/lua-openssl/metadata.xml |
170 |
new file mode 100644 |
171 |
index 0000000..ea45693 |
172 |
--- /dev/null |
173 |
+++ b/dev-lua/lua-openssl/metadata.xml |
174 |
@@ -0,0 +1,16 @@ |
175 |
+<?xml version="1.0" encoding="UTF-8"?> |
176 |
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
177 |
+<pkgmetadata> |
178 |
+ <herd>proxy-maintainers</herd> |
179 |
+ <maintainer> |
180 |
+ <email>jakub@×××××××.cz</email> |
181 |
+ <name>Jakub Jirutka</name> |
182 |
+ </maintainer> |
183 |
+ <use> |
184 |
+ <flag name="luajit">Use <pkg>dev-lang/luajit</pkg> instead of |
185 |
+ <pkg>dev-lang/lua</pkg></flag> |
186 |
+ </use> |
187 |
+ <upstream> |
188 |
+ <remote-id type="github">zhaozg/lua-openssl</remote-id> |
189 |
+ </upstream> |
190 |
+</pkgmetadata> |