1 |
commit: 2b5021931af5a2e8eafa31dc0d503ba3ce50dfd2 |
2 |
Author: Jocelyn-MAYER <l_indien <AT> mailmagic <DOT> fr> |
3 |
AuthorDate: Thu Dec 29 17:28:00 2022 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Dec 29 18:21:30 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2b502193 |
7 |
|
8 |
media-libs/libquvi: support luajit and lua5.4 |
9 |
|
10 |
libquvi used to build only with lua version 5.1 |
11 |
- the configure.ac file is to be patched in order to be able to build with luajit |
12 |
- the second patch allow build with lua version 5.4 |
13 |
|
14 |
Closes: https://bugs.gentoo.org/504876 |
15 |
Signed-off-by: Jocelyn-MAYER <l_indien <AT> mailmagic.fr> |
16 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
17 |
|
18 |
.../files/libquvi-0.9.4-luaL_setfuncs_ver.patch | 70 ++++++++++++++++++++++ |
19 |
.../libquvi/files/libquvi-0.9.4-luajit.patch | 15 +++++ |
20 |
media-libs/libquvi/libquvi-0.9.4-r101.ebuild | 69 +++++++++++++++++++++ |
21 |
3 files changed, 154 insertions(+) |
22 |
|
23 |
diff --git a/media-libs/libquvi/files/libquvi-0.9.4-luaL_setfuncs_ver.patch b/media-libs/libquvi/files/libquvi-0.9.4-luaL_setfuncs_ver.patch |
24 |
new file mode 100644 |
25 |
index 000000000000..156468b0e7b1 |
26 |
--- /dev/null |
27 |
+++ b/media-libs/libquvi/files/libquvi-0.9.4-luaL_setfuncs_ver.patch |
28 |
@@ -0,0 +1,70 @@ |
29 |
+--- libquvi-0.9.4/src/lua/init.c 2013-11-04 13:55:26.000000000 +0100 |
30 |
++++ libquvi-0.9.4/src/lua/init.c 2022-12-29 09:25:41.579621070 +0100 |
31 |
+@@ -43,11 +43,19 @@ static const luaL_Reg quvi_reg_meth[] = |
32 |
+ |
33 |
+ static const luaL_Reg quvi_http_reg_meth[] = |
34 |
+ { |
35 |
++#if (LUA_VERSION_NUM == 501) |
36 |
+ {"metainfo", l_quvi_http_metainfo}, |
37 |
+ {"resolve", l_quvi_http_resolve}, |
38 |
+ {"cookie", l_quvi_http_cookie}, |
39 |
+ {"header", l_quvi_http_header}, |
40 |
+ {"fetch", l_quvi_http_fetch}, |
41 |
++#elif (LUA_VERSION_NUM >= 504) |
42 |
++ {"quvi.http.metainfo", l_quvi_http_metainfo}, |
43 |
++ {"quvi.http.resolve", l_quvi_http_resolve}, |
44 |
++ {"quvi.http.cookie", l_quvi_http_cookie}, |
45 |
++ {"quvi.http.header", l_quvi_http_header}, |
46 |
++ {"quvi.http.fetch", l_quvi_http_fetch}, |
47 |
++#endif |
48 |
+ {NULL, NULL} |
49 |
+ }; |
50 |
+ |
51 |
+@@ -57,9 +65,15 @@ extern gint l_quvi_crypto_hash(lua_State |
52 |
+ |
53 |
+ static const luaL_Reg quvi_crypto_reg_meth[] = |
54 |
+ { |
55 |
++#if (LUA_VERSION_NUM == 501) |
56 |
+ {"encrypt", l_quvi_crypto_encrypt}, |
57 |
+ {"decrypt", l_quvi_crypto_decrypt}, |
58 |
+ {"hash", l_quvi_crypto_hash}, |
59 |
++#elif (LUA_VERSION_NUM >= 504) |
60 |
++ {"quvi.crypto.encrypt", l_quvi_crypto_encrypt}, |
61 |
++ {"quvi.crypto.decrypt", l_quvi_crypto_decrypt}, |
62 |
++ {"quvi.crypto.hash", l_quvi_crypto_hash}, |
63 |
++#endif |
64 |
+ {NULL, NULL} |
65 |
+ }; |
66 |
+ |
67 |
+@@ -68,8 +82,13 @@ extern gint l_quvi_base64_decode(lua_Sta |
68 |
+ |
69 |
+ static const luaL_Reg quvi_base64_reg_meth[] = |
70 |
+ { |
71 |
++#if (LUA_VERSION_NUM == 501) |
72 |
+ {"encode", l_quvi_base64_encode}, |
73 |
+ {"decode", l_quvi_base64_decode}, |
74 |
++#elif (LUA_VERSION_NUM >= 504) |
75 |
++ {"quvi.base64.encode", l_quvi_base64_encode}, |
76 |
++ {"quvi.base64.decode", l_quvi_base64_decode}, |
77 |
++#endif |
78 |
+ {NULL, NULL} |
79 |
+ }; |
80 |
+ |
81 |
+@@ -80,10 +99,17 @@ QuviError l_init(_quvi_t q) |
82 |
+ return (QUVI_ERROR_LUA_INIT); |
83 |
+ |
84 |
+ luaL_openlibs(q->handle.lua); |
85 |
++#if (LUA_VERSION_NUM == 501) |
86 |
+ luaL_register(q->handle.lua, "quvi", quvi_reg_meth); |
87 |
+ luaL_register(q->handle.lua, "quvi.http", quvi_http_reg_meth); |
88 |
+ luaL_register(q->handle.lua, "quvi.crypto", quvi_crypto_reg_meth); |
89 |
+ luaL_register(q->handle.lua, "quvi.base64", quvi_base64_reg_meth); |
90 |
++#elif (LUA_VERSION_NUM >= 504) |
91 |
++ luaL_newlib(q->handle.lua, quvi_reg_meth); |
92 |
++ luaL_newlib(q->handle.lua, quvi_http_reg_meth); |
93 |
++ luaL_newlib(q->handle.lua, quvi_crypto_reg_meth); |
94 |
++ luaL_newlib(q->handle.lua, quvi_base64_reg_meth); |
95 |
++#endif |
96 |
+ |
97 |
+ return (QUVI_OK); |
98 |
+ } |
99 |
|
100 |
diff --git a/media-libs/libquvi/files/libquvi-0.9.4-luajit.patch b/media-libs/libquvi/files/libquvi-0.9.4-luajit.patch |
101 |
new file mode 100644 |
102 |
index 000000000000..dd4dc58238c9 |
103 |
--- /dev/null |
104 |
+++ b/media-libs/libquvi/files/libquvi-0.9.4-luajit.patch |
105 |
@@ -0,0 +1,15 @@ |
106 |
+--- libquvi-0.9.4/configure.ac 2021-10-20 13:44:09.834182117 +0200 |
107 |
++++ libquvi-0.9.4/configure.ac 2021-10-20 13:46:23.611188250 +0200 |
108 |
+@@ -85,7 +85,9 @@ AC_SUBST([VALGRIND]) |
109 |
+ PKG_CHECK_MODULES([liblua], [lua >= 5.1], [], [ |
110 |
+ PKG_CHECK_MODULES([liblua], [lua51 >= 5.1], [], [ |
111 |
+ PKG_CHECK_MODULES([liblua], [lua5.1 >= 5.1], [], [ |
112 |
+- PKG_CHECK_MODULES(liblua, [lua-5.1 >= 5.1])]) |
113 |
++ PKG_CHECK_MODULES([liblua], [lua-5.1 >= 5.1], [], [ |
114 |
++ PKG_CHECK_MODULES(liblua, [luajit])]) |
115 |
++ ]) |
116 |
+ ]) |
117 |
+ ]) |
118 |
+ PKG_CHECK_MODULES([libproxy], [libproxy-1.0 >= 0.3.1]) |
119 |
+ |
120 |
+ |
121 |
|
122 |
diff --git a/media-libs/libquvi/libquvi-0.9.4-r101.ebuild b/media-libs/libquvi/libquvi-0.9.4-r101.ebuild |
123 |
new file mode 100644 |
124 |
index 000000000000..e6500141edd7 |
125 |
--- /dev/null |
126 |
+++ b/media-libs/libquvi/libquvi-0.9.4-r101.ebuild |
127 |
@@ -0,0 +1,69 @@ |
128 |
+# Copyright 1999-2021 Gentoo Authors |
129 |
+# Distributed under the terms of the GNU General Public License v2 |
130 |
+ |
131 |
+EAPI=7 |
132 |
+ |
133 |
+LUA_COMPAT=( lua5-1 ) |
134 |
+LUA_REQ_USE="deprecated" |
135 |
+ |
136 |
+inherit autotools lua-single |
137 |
+ |
138 |
+DESCRIPTION="Library for parsing video download links" |
139 |
+HOMEPAGE="http://quvi.sourceforge.net/" |
140 |
+SRC_URI="mirror://sourceforge/quvi/${PV:0:3}/${P}.tar.xz" |
141 |
+ |
142 |
+LICENSE="AGPL-3" |
143 |
+SLOT="0/8" # subslot = libquvi soname version |
144 |
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~sparc ~x86" |
145 |
+IUSE="examples nls static-libs" |
146 |
+ |
147 |
+REQUIRED_USE="${LUA_REQUIRED_USE}" |
148 |
+ |
149 |
+RDEPEND=" |
150 |
+ ${LUA_DEPS} |
151 |
+ >=dev-libs/glib-2.34.3:2 |
152 |
+ >=dev-libs/libgcrypt-1.5.3:0= |
153 |
+ >=media-libs/libquvi-scripts-0.9.20130903[${LUA_SINGLE_USEDEP}] |
154 |
+ !<media-libs/quvi-0.4.0 |
155 |
+ >=net-libs/libproxy-0.4.11-r1 |
156 |
+ >=net-misc/curl-7.36.0 |
157 |
+ nls? ( >=virtual/libintl-0-r1 ) |
158 |
+" |
159 |
+ |
160 |
+DEPEND="${RDEPEND}" |
161 |
+ |
162 |
+BDEPEND=" |
163 |
+ app-arch/xz-utils |
164 |
+ virtual/pkgconfig |
165 |
+ nls? ( sys-devel/gettext ) |
166 |
+" |
167 |
+ |
168 |
+PATCHES=( |
169 |
+ "${FILESDIR}"/${PN}-0.9.1-headers-reinstall.patch |
170 |
+ "${FILESDIR}"/${PN}-0.9.4-autoconf-2.70.patch #749816 |
171 |
+ "${FILESDIR}"/${PN}-0.9.4-luajit.patch # 504876 |
172 |
+ "${FILESDIR}"/${PN}-0.9.4-luaL_setfuncs_ver.patch # 504876 |
173 |
+) |
174 |
+ |
175 |
+src_prepare() { |
176 |
+ default |
177 |
+ eautoreconf |
178 |
+} |
179 |
+ |
180 |
+src_configure() { |
181 |
+ local myeconfargs=( |
182 |
+ $(use_enable nls) |
183 |
+ --with-manual |
184 |
+ ) |
185 |
+ |
186 |
+ econf "${myeconfargs[@]}" |
187 |
+} |
188 |
+ |
189 |
+src_install() { |
190 |
+ default |
191 |
+ |
192 |
+ einstalldocs |
193 |
+ use examples && dodoc -r examples |
194 |
+ |
195 |
+ find "${ED}" -name '*.la' -delete || die |
196 |
+} |