Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: www-client/luakit/files/, www-client/luakit/
Date: Sat, 02 Sep 2017 08:45:33
Message-Id: 1504341923.80113224e3c130c63a5ec2189e1f4f4868c1ae3b.mgorny@gentoo
1 commit: 80113224e3c130c63a5ec2189e1f4f4868c1ae3b
2 Author: Aric Belsito <lluixhi <AT> gmail <DOT> com>
3 AuthorDate: Fri Aug 25 18:35:24 2017 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Sat Sep 2 08:45:23 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=80113224
7
8 www-client/luakit: new package
9
10 Closes: https://github.com/gentoo/gentoo/pull/5228
11
12 www-client/luakit/Manifest | 1 +
13 www-client/luakit/files/luakit-cflags.patch | 11 +++
14 www-client/luakit/files/luakit-fix_tests.patch | 108 +++++++++++++++++++++++++
15 www-client/luakit/luakit-2017.08.10.ebuild | 74 +++++++++++++++++
16 www-client/luakit/luakit-9999.ebuild | 70 ++++++++++++++++
17 www-client/luakit/metadata.xml | 16 ++++
18 6 files changed, 280 insertions(+)
19
20 diff --git a/www-client/luakit/Manifest b/www-client/luakit/Manifest
21 new file mode 100644
22 index 00000000000..856440f312f
23 --- /dev/null
24 +++ b/www-client/luakit/Manifest
25 @@ -0,0 +1 @@
26 +DIST luakit-2017.08.10.tar.gz 399564 SHA256 23d98b6b51b66c85b6823cd287e161e1093b80639f06f1da9b0a7290b0859d37 SHA512 6cceb241ca5a7ad7dfbb3964888318b5f2c5f734175ea7ecd5178419d037d58dc5e0aba00a7ed8ca3dd811cc5af953c353b0cd203be95a15c6a78c396f9230c8 WHIRLPOOL 701dc6fbe0d0e974fd613af5a50fb53e9dc9d53b506fbcf46a3a5ee217518ab355ed34d49e2285ef5b8121bf67780a9d9588189e8594bdbd1f2f13c78f1c8d78
27
28 diff --git a/www-client/luakit/files/luakit-cflags.patch b/www-client/luakit/files/luakit-cflags.patch
29 new file mode 100644
30 index 00000000000..dd8d51c391f
31 --- /dev/null
32 +++ b/www-client/luakit/files/luakit-cflags.patch
33 @@ -0,0 +1,11 @@
34 +--- a/config.mk
35 ++++ b/config.mk
36 +@@ -2,7 +2,7 @@
37 +
38 + # Compile/link options.
39 + CC ?= gcc
40 +-CFLAGS += -std=gnu99 -ggdb -W -Wall -Wextra -Werror=unused-result
41 ++CFLAGS += -std=gnu99 -W -Wall -Wextra
42 + LDFLAGS +=
43 + CPPFLAGS +=
44 +
45
46 diff --git a/www-client/luakit/files/luakit-fix_tests.patch b/www-client/luakit/files/luakit-fix_tests.patch
47 new file mode 100644
48 index 00000000000..f379fa85f6c
49 --- /dev/null
50 +++ b/www-client/luakit/files/luakit-fix_tests.patch
51 @@ -0,0 +1,108 @@
52 +From 1d5ae1d56da688c3ac95301f4ae07eb7721dd20e Mon Sep 17 00:00:00 2001
53 +From: Aidan Holm <aidanholm@×××××.com>
54 +Date: Fri, 11 Aug 2017 11:32:47 +0800
55 +Subject: [PATCH] Add support for tests with DEVELOPMENT_PATHS=0
56 +
57 +---
58 + ipc.c | 36 ++++++++++++++++--------------------
59 + tests/async/run_test.lua | 4 ++++
60 + tests/async/wrangle_paths.lua | 20 ++++++++++++++++++++
61 + 3 files changed, 40 insertions(+), 20 deletions(-)
62 + create mode 100644 tests/async/wrangle_paths.lua
63 +
64 +diff --git a/ipc.c b/ipc.c
65 +index e0e8bfde..bd871209 100644
66 +--- a/ipc.c
67 ++++ b/ipc.c
68 +@@ -158,23 +158,20 @@ web_extension_connect_thread(gpointer UNUSED(data))
69 + static void
70 + initialize_web_extensions_cb(WebKitWebContext *context, gpointer UNUSED(data))
71 + {
72 +-#if DEVELOPMENT_PATHS
73 +- gchar *extension_dir = g_get_current_dir();
74 +-#else
75 +- const gchar *extension_dir = LUAKIT_INSTALL_PATH;
76 +-#endif
77 +-
78 +- char *extension_file = g_build_filename(extension_dir, "luakit.so", NULL);
79 +- if (access(extension_file, R_OK)) {
80 +-#if DEVELOPMENT_PATHS
81 +-# define DEVPATHS "\nLuakit was built with DEVELOPMENT_PATHS=1; are you running luakit correctly?"
82 +-#else
83 +-# define DEVPATHS ""
84 +-#endif
85 +- fatal("Cannot access luakit extension '%s': %s" DEVPATHS, extension_file, strerror(errno));
86 +-#undef DEVPATHS
87 ++ char *dirs[] = { g_get_current_dir(), LUAKIT_INSTALL_PATH }, *dir = NULL;
88 ++
89 ++ for (unsigned i = 0; !dir && i < LENGTH(dirs); ++i) {
90 ++ char *extension_file = g_build_filename(dirs[i], "luakit.so", NULL);
91 ++ verbose("checking for luakit extension at '%s'", dirs[i]);
92 ++ if (!access(extension_file, R_OK))
93 ++ dir = dirs[i];
94 ++ g_free(extension_file);
95 + }
96 +- g_free(extension_file);
97 ++
98 ++ if (dir)
99 ++ verbose("found luakit extension at '%s'", dir);
100 ++ else
101 ++ fatal("cannot find luakit extension 'luakit.so'");
102 +
103 + const char *path;
104 + g_mutex_lock (&socket_path_lock);
105 +@@ -185,10 +182,9 @@ initialize_web_extensions_cb(WebKitWebContext *context, gpointer UNUSED(data))
106 +
107 + GVariant *payload = g_variant_new_string(path);
108 + webkit_web_context_set_web_extensions_initialization_user_data(context, payload);
109 +- webkit_web_context_set_web_extensions_directory(context, extension_dir);
110 +-#if DEVELOPMENT_PATHS
111 +- g_free(extension_dir);
112 +-#endif
113 ++ webkit_web_context_set_web_extensions_directory(context, dir);
114 ++
115 ++ g_free(dirs[0]);
116 + }
117 +
118 + static void
119 +diff --git a/tests/async/run_test.lua b/tests/async/run_test.lua
120 +index d281265b..2a55f225 100644
121 +--- a/tests/async/run_test.lua
122 ++++ b/tests/async/run_test.lua
123 +@@ -3,6 +3,10 @@
124 + -- @script async.run_test
125 + -- @copyright 2017 Aidan Holm
126 +
127 ++-- Adjust paths to work when running with DEVELOPMENT_PATHS=0
128 ++dofile("tests/async/wrangle_paths.lua")
129 ++require_web_module("tests/async/wrangle_paths")
130 ++
131 + local shared_lib = {}
132 + local priv = require "tests.priv"
133 + local test = require("tests.lib")
134 +diff --git a/tests/async/wrangle_paths.lua b/tests/async/wrangle_paths.lua
135 +new file mode 100644
136 +index 00000000..66efe929
137 +--- /dev/null
138 ++++ b/tests/async/wrangle_paths.lua
139 +@@ -0,0 +1,20 @@
140 ++--- Test runner path wrangler.
141 ++--
142 ++-- @script async.wrangle_paths
143 ++-- @copyright 2017 Aidan Holm
144 ++
145 ++local system_paths, luakit_paths = {}, {}
146 ++for path in string.gmatch(package.path, "[^;]+") do
147 ++ if not path:match("^%./") and not path:find("luakit") then
148 ++ table.insert(system_paths, path)
149 ++ elseif not path:match("^%./") and path:find("luakit_test_") then
150 ++ table.insert(luakit_paths, path)
151 ++ end
152 ++end
153 ++local rel_paths = { "./lib/?.lua", "./lib/?/init.lua", "./config/?.lua", "./config/?/init.lua", }
154 ++system_paths = table.concat(system_paths, ";")
155 ++rel_paths = table.concat(rel_paths, ";")
156 ++luakit_paths = table.concat(luakit_paths, ";")
157 ++package.path = string.format("./?.lua;%s;%s;%s", system_paths, rel_paths, luakit_paths)
158 ++
159 ++-- vim: et:sw=4:ts=8:sts=4:tw=80
160
161 diff --git a/www-client/luakit/luakit-2017.08.10.ebuild b/www-client/luakit/luakit-2017.08.10.ebuild
162 new file mode 100644
163 index 00000000000..58974d97427
164 --- /dev/null
165 +++ b/www-client/luakit/luakit-2017.08.10.ebuild
166 @@ -0,0 +1,74 @@
167 +# Copyright 1999-2017 Gentoo Foundation
168 +# Distributed under the terms of the GNU General Public License v2
169 +
170 +EAPI=6
171 +
172 +inherit toolchain-funcs
173 +
174 +DESCRIPTION="A fast, light, simple to use micro-browser using WebKit and Lua"
175 +HOMEPAGE="https://luakit.github.io/luakit"
176 +
177 +if [[ ${PV} == 9999 ]]; then
178 + inherit git-r3
179 + EGIT_REPO_URI="git://github.com/luakit/luakit.git"
180 +else
181 + SRC_URI="https://github.com/luakit/luakit/archive/${PV}.tar.gz -> ${P}.tar.gz"
182 + KEYWORDS="~amd64"
183 +fi
184 +
185 +LICENSE="GPL-3"
186 +SLOT="0"
187 +IUSE="doc luajit test"
188 +
189 +RDEPEND="
190 + dev-db/sqlite:3
191 + dev-libs/glib:2
192 + dev-lua/luafilesystem[luajit=]
193 + net-libs/webkit-gtk:4=
194 + x11-libs/gtk+:3
195 + luajit? ( dev-lang/luajit:2 )
196 + !luajit? ( dev-lang/lua:0 )"
197 +DEPEND="${RDEPEND}
198 + virtual/pkgconfig
199 + doc? ( app-doc/doxygen )
200 + test? (
201 + dev-lua/luassert[luajit=]
202 + dev-lua/luacheck[luajit=]
203 + x11-base/xorg-server[xvfb]
204 + )"
205 +
206 +PATCHES=(
207 + "${FILESDIR}"/${PN}-cflags.patch
208 + "${FILESDIR}"/${PN}-fix_tests.patch
209 +)
210 +
211 +src_compile() {
212 + emake \
213 + CC=$(tc-getCC) \
214 + PREFIX="${EPREFIX}/usr" \
215 + XDGPREFIX="${EPREFIX}/etc/xdg" \
216 + LUA_PKG_NAME=$(usex luajit 'luajit' 'lua') \
217 + LUA_BIN_NAME=$(usex luajit 'luajit' 'lua') \
218 + all
219 +
220 + use doc && emake doc
221 +}
222 +
223 +src_test() {
224 + emake \
225 + LUA_BIN_NAME=$(usex luajit 'luajit' 'lua') \
226 + run-tests
227 +}
228 +
229 +src_install() {
230 + emake \
231 + DESTDIR="${D}" \
232 + PREFIX="${EPREFIX}/usr" \
233 + DOCDIR="${ED}/usr/share/doc/${PF}" \
234 + XDGPREFIX="${ED}/etc/xdg" \
235 + install
236 +
237 + rm "${ED}/usr/share/doc/${PF}/COPYING.GPLv3" || die
238 +
239 + use doc && dodoc -r doc/html
240 +}
241
242 diff --git a/www-client/luakit/luakit-9999.ebuild b/www-client/luakit/luakit-9999.ebuild
243 new file mode 100644
244 index 00000000000..136f8177f30
245 --- /dev/null
246 +++ b/www-client/luakit/luakit-9999.ebuild
247 @@ -0,0 +1,70 @@
248 +# Copyright 1999-2017 Gentoo Foundation
249 +# Distributed under the terms of the GNU General Public License v2
250 +
251 +EAPI=6
252 +
253 +inherit toolchain-funcs
254 +
255 +DESCRIPTION="A fast, light, simple to use micro-browser using WebKit and Lua"
256 +HOMEPAGE="https://luakit.github.io/luakit"
257 +
258 +if [[ ${PV} == 9999 ]]; then
259 + inherit git-r3
260 + EGIT_REPO_URI="git://github.com/luakit/luakit.git"
261 +else
262 + SRC_URI="https://github.com/luakit/luakit/archive/${PV}.tar.gz -> ${P}.tar.gz"
263 + KEYWORDS="~amd64"
264 +fi
265 +
266 +LICENSE="GPL-3"
267 +SLOT="0"
268 +IUSE="doc luajit test"
269 +
270 +RDEPEND="
271 + dev-db/sqlite:3
272 + dev-libs/glib:2
273 + dev-lua/luafilesystem[luajit=]
274 + net-libs/webkit-gtk:4=
275 + x11-libs/gtk+:3
276 + luajit? ( dev-lang/luajit:2 )
277 + !luajit? ( dev-lang/lua:0 )"
278 +DEPEND="${RDEPEND}
279 + virtual/pkgconfig
280 + doc? ( app-doc/doxygen )
281 + test? (
282 + dev-lua/luassert[luajit=]
283 + dev-lua/luacheck[luajit=]
284 + x11-base/xorg-server[xvfb]
285 + )"
286 +
287 +src_compile() {
288 + emake \
289 + CC=$(tc-getCC) \
290 + PREFIX="${EPREFIX}/usr" \
291 + DOCDIR="${EPREFIX}/usr/share/doc/${PF}" \
292 + XDGPREFIX="${EPREFIX}/etc/xdg" \
293 + LUA_PKG_NAME=$(usex luajit 'luajit' 'lua') \
294 + LUA_BIN_NAME=$(usex luajit 'luajit' 'lua') \
295 + all
296 +
297 + use doc && emake doc
298 +}
299 +
300 +src_test() {
301 + emake \
302 + LUA_BIN_NAME=$(usex luajit 'luajit' 'lua') \
303 + run-tests
304 +}
305 +
306 +src_install() {
307 + emake \
308 + DESTDIR="${D}" \
309 + PREFIX="${EPREFIX}/usr" \
310 + DOCDIR="${ED}/usr/share/doc/${PF}" \
311 + XDGPREFIX="${ED}/etc/xdg" \
312 + install
313 +
314 + rm "${ED}/usr/share/doc/${PF}/COPYING.GPLv3" || die
315 +
316 + use doc && dodoc -r doc/html
317 +}
318
319 diff --git a/www-client/luakit/metadata.xml b/www-client/luakit/metadata.xml
320 new file mode 100644
321 index 00000000000..0d7490811c7
322 --- /dev/null
323 +++ b/www-client/luakit/metadata.xml
324 @@ -0,0 +1,16 @@
325 +<?xml version="1.0" encoding="UTF-8"?>
326 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
327 +<pkgmetadata>
328 + <maintainer type="person" >
329 + <email>lluixhi@×××××.com</email>
330 + <name>Aric Belsito</name>
331 + </maintainer>
332 + <maintainer type="project">
333 + <email>proxy-maint@g.o</email>
334 + <name>Proxy Maintainers</name>
335 + </maintainer>
336 + <use>
337 + <flag name="luajit">Use <pkg>dev-lang/luajit</pkg> instead of
338 + <pkg>dev-lang/lua</pkg></flag>
339 + </use>
340 +</pkgmetadata>