Gentoo Archives: gentoo-commits

From: James Le Cuirot <chewi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lua/luasocket/, dev-lua/luasocket/files/
Date: Sat, 01 Sep 2018 12:34:07
Message-Id: 1535805233.44350e8fd19acc4020b7524768ffdb4dfcd06f38.chewi@gentoo
1 commit: 44350e8fd19acc4020b7524768ffdb4dfcd06f38
2 Author: James Le Cuirot <chewi <AT> gentoo <DOT> org>
3 AuthorDate: Sat Sep 1 12:33:09 2018 +0000
4 Commit: James Le Cuirot <chewi <AT> gentoo <DOT> org>
5 CommitDate: Sat Sep 1 12:33:53 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=44350e8f
7
8 dev-lua/luasocket: Patch to fix proxy variable issue, EAPI 7
9
10 This is needed for games-simulation/corsix-th, which I will add back
11 into the repository.
12
13 Closes: https://bugs.gentoo.org/585962
14 Package-Manager: Portage-2.3.48, Repoman-2.3.10
15
16 dev-lua/luasocket/files/proxy-fix.patch | 31 +++++++++++++++
17 dev-lua/luasocket/luasocket-3.0_rc1-r4.ebuild | 55 +++++++++++++++++++++++++++
18 2 files changed, 86 insertions(+)
19
20 diff --git a/dev-lua/luasocket/files/proxy-fix.patch b/dev-lua/luasocket/files/proxy-fix.patch
21 new file mode 100644
22 index 00000000000..302e63663ff
23 --- /dev/null
24 +++ b/dev-lua/luasocket/files/proxy-fix.patch
25 @@ -0,0 +1,31 @@
26 +From 1f9ccb2b586c3a7e29db3c99a23ac1cee6907cf2 Mon Sep 17 00:00:00 2001
27 +From: Pierre Chapuis <catwell@×××××××××.us>
28 +Date: Fri, 5 Jul 2013 18:00:29 +0200
29 +Subject: [PATCH] http: look for PROXY in _M, not as a global
30 +
31 +---
32 + src/http.lua | 4 ++--
33 + 1 file changed, 2 insertions(+), 2 deletions(-)
34 +
35 +diff --git a/src/http.lua b/src/http.lua
36 +index 5f70a374..f83dcc55 100644
37 +--- a/src/http.lua
38 ++++ b/src/http.lua
39 +@@ -186,7 +186,7 @@ end
40 + local function adjusturi(reqt)
41 + local u = reqt
42 + -- if there is a proxy, we need the full url. otherwise, just a part.
43 +- if not reqt.proxy and not PROXY then
44 ++ if not reqt.proxy and not _M.PROXY then
45 + u = {
46 + path = socket.try(reqt.path, "invalid path 'nil'"),
47 + params = reqt.params,
48 +@@ -198,7 +198,7 @@ local function adjusturi(reqt)
49 + end
50 +
51 + local function adjustproxy(reqt)
52 +- local proxy = reqt.proxy or PROXY
53 ++ local proxy = reqt.proxy or _M.PROXY
54 + if proxy then
55 + proxy = url.parse(proxy)
56 + return proxy.host, proxy.port or 3128
57
58 diff --git a/dev-lua/luasocket/luasocket-3.0_rc1-r4.ebuild b/dev-lua/luasocket/luasocket-3.0_rc1-r4.ebuild
59 new file mode 100644
60 index 00000000000..9789a03154f
61 --- /dev/null
62 +++ b/dev-lua/luasocket/luasocket-3.0_rc1-r4.ebuild
63 @@ -0,0 +1,55 @@
64 +# Copyright 1999-2018 Gentoo Foundation
65 +# Distributed under the terms of the GNU General Public License v2
66 +
67 +EAPI=7
68 +
69 +inherit multilib multilib-minimal flag-o-matic
70 +
71 +DESCRIPTION="Networking support library for the Lua language"
72 +HOMEPAGE="http://www.tecgraf.puc-rio.br/~diego/professional/luasocket/"
73 +SRC_URI="https://github.com/diegonehab/${PN}/archive/v${PV/_/-}.tar.gz -> ${P}.tar.gz"
74 +
75 +LICENSE="MIT"
76 +SLOT="0"
77 +KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~mips ~ppc ~ppc64 ~sparc ~x86"
78 +IUSE="debug"
79 +
80 +RDEPEND=">=dev-lang/lua-5.1.5-r2[deprecated,${MULTILIB_USEDEP}]"
81 +DEPEND="${RDEPEND}
82 + >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}]"
83 +
84 +S=${WORKDIR}/${PN}-${PV/_/-}
85 +
86 +RESTRICT="test"
87 +
88 +PATCHES=(
89 + "${FILESDIR}"/proxy-fix.patch
90 +)
91 +
92 +src_prepare() {
93 + default
94 + multilib_copy_sources
95 +}
96 +
97 +multilib_src_compile() {
98 + emake \
99 + CC="$(tc-getCC) ${CFLAGS}" \
100 + LD="$(tc-getCC) ${LDFLAGS}"\
101 + $(usex debug DEBUG="DEBUG" "")
102 +}
103 +
104 +multilib_src_install() {
105 + local luav=$($(tc-getPKG_CONFIG) --variable V lua)
106 + emake \
107 + DESTDIR="${D}" \
108 + LUAPREFIX_linux=/usr \
109 + LUAV=${luav} \
110 + CDIR_linux=$(get_libdir)/lua/${luav} \
111 + install-unix
112 +}
113 +
114 +multilib_src_install_all() {
115 + dodoc NEW README
116 + docinto html
117 + dodoc -r doc/.
118 +}