diff options
author | Aric Belsito <lluixhi@gmail.com> | 2017-08-25 11:35:24 -0700 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2017-09-02 10:45:23 +0200 |
commit | 80113224e3c130c63a5ec2189e1f4f4868c1ae3b (patch) | |
tree | 1b3d98191b13ed3ee4163bdd756e71c3377e738d /www-client | |
parent | dev-lua/luacheck: new package (diff) | |
download | gentoo-80113224e3c130c63a5ec2189e1f4f4868c1ae3b.tar.gz gentoo-80113224e3c130c63a5ec2189e1f4f4868c1ae3b.tar.bz2 gentoo-80113224e3c130c63a5ec2189e1f4f4868c1ae3b.zip |
www-client/luakit: new package
Closes: https://github.com/gentoo/gentoo/pull/5228
Diffstat (limited to 'www-client')
-rw-r--r-- | www-client/luakit/Manifest | 1 | ||||
-rw-r--r-- | www-client/luakit/files/luakit-cflags.patch | 11 | ||||
-rw-r--r-- | www-client/luakit/files/luakit-fix_tests.patch | 108 | ||||
-rw-r--r-- | www-client/luakit/luakit-2017.08.10.ebuild | 74 | ||||
-rw-r--r-- | www-client/luakit/luakit-9999.ebuild | 70 | ||||
-rw-r--r-- | www-client/luakit/metadata.xml | 16 |
6 files changed, 280 insertions, 0 deletions
diff --git a/www-client/luakit/Manifest b/www-client/luakit/Manifest new file mode 100644 index 000000000000..856440f312f3 --- /dev/null +++ b/www-client/luakit/Manifest @@ -0,0 +1 @@ +DIST luakit-2017.08.10.tar.gz 399564 SHA256 23d98b6b51b66c85b6823cd287e161e1093b80639f06f1da9b0a7290b0859d37 SHA512 6cceb241ca5a7ad7dfbb3964888318b5f2c5f734175ea7ecd5178419d037d58dc5e0aba00a7ed8ca3dd811cc5af953c353b0cd203be95a15c6a78c396f9230c8 WHIRLPOOL 701dc6fbe0d0e974fd613af5a50fb53e9dc9d53b506fbcf46a3a5ee217518ab355ed34d49e2285ef5b8121bf67780a9d9588189e8594bdbd1f2f13c78f1c8d78 diff --git a/www-client/luakit/files/luakit-cflags.patch b/www-client/luakit/files/luakit-cflags.patch new file mode 100644 index 000000000000..dd8d51c391f1 --- /dev/null +++ b/www-client/luakit/files/luakit-cflags.patch @@ -0,0 +1,11 @@ +--- a/config.mk ++++ b/config.mk +@@ -2,7 +2,7 @@ + + # Compile/link options. + CC ?= gcc +-CFLAGS += -std=gnu99 -ggdb -W -Wall -Wextra -Werror=unused-result ++CFLAGS += -std=gnu99 -W -Wall -Wextra + LDFLAGS += + CPPFLAGS += + diff --git a/www-client/luakit/files/luakit-fix_tests.patch b/www-client/luakit/files/luakit-fix_tests.patch new file mode 100644 index 000000000000..f379fa85f6c8 --- /dev/null +++ b/www-client/luakit/files/luakit-fix_tests.patch @@ -0,0 +1,108 @@ +From 1d5ae1d56da688c3ac95301f4ae07eb7721dd20e Mon Sep 17 00:00:00 2001 +From: Aidan Holm <aidanholm@gmail.com> +Date: Fri, 11 Aug 2017 11:32:47 +0800 +Subject: [PATCH] Add support for tests with DEVELOPMENT_PATHS=0 + +--- + ipc.c | 36 ++++++++++++++++-------------------- + tests/async/run_test.lua | 4 ++++ + tests/async/wrangle_paths.lua | 20 ++++++++++++++++++++ + 3 files changed, 40 insertions(+), 20 deletions(-) + create mode 100644 tests/async/wrangle_paths.lua + +diff --git a/ipc.c b/ipc.c +index e0e8bfde..bd871209 100644 +--- a/ipc.c ++++ b/ipc.c +@@ -158,23 +158,20 @@ web_extension_connect_thread(gpointer UNUSED(data)) + static void + initialize_web_extensions_cb(WebKitWebContext *context, gpointer UNUSED(data)) + { +-#if DEVELOPMENT_PATHS +- gchar *extension_dir = g_get_current_dir(); +-#else +- const gchar *extension_dir = LUAKIT_INSTALL_PATH; +-#endif +- +- char *extension_file = g_build_filename(extension_dir, "luakit.so", NULL); +- if (access(extension_file, R_OK)) { +-#if DEVELOPMENT_PATHS +-# define DEVPATHS "\nLuakit was built with DEVELOPMENT_PATHS=1; are you running luakit correctly?" +-#else +-# define DEVPATHS "" +-#endif +- fatal("Cannot access luakit extension '%s': %s" DEVPATHS, extension_file, strerror(errno)); +-#undef DEVPATHS ++ char *dirs[] = { g_get_current_dir(), LUAKIT_INSTALL_PATH }, *dir = NULL; ++ ++ for (unsigned i = 0; !dir && i < LENGTH(dirs); ++i) { ++ char *extension_file = g_build_filename(dirs[i], "luakit.so", NULL); ++ verbose("checking for luakit extension at '%s'", dirs[i]); ++ if (!access(extension_file, R_OK)) ++ dir = dirs[i]; ++ g_free(extension_file); + } +- g_free(extension_file); ++ ++ if (dir) ++ verbose("found luakit extension at '%s'", dir); ++ else ++ fatal("cannot find luakit extension 'luakit.so'"); + + const char *path; + g_mutex_lock (&socket_path_lock); +@@ -185,10 +182,9 @@ initialize_web_extensions_cb(WebKitWebContext *context, gpointer UNUSED(data)) + + GVariant *payload = g_variant_new_string(path); + webkit_web_context_set_web_extensions_initialization_user_data(context, payload); +- webkit_web_context_set_web_extensions_directory(context, extension_dir); +-#if DEVELOPMENT_PATHS +- g_free(extension_dir); +-#endif ++ webkit_web_context_set_web_extensions_directory(context, dir); ++ ++ g_free(dirs[0]); + } + + static void +diff --git a/tests/async/run_test.lua b/tests/async/run_test.lua +index d281265b..2a55f225 100644 +--- a/tests/async/run_test.lua ++++ b/tests/async/run_test.lua +@@ -3,6 +3,10 @@ + -- @script async.run_test + -- @copyright 2017 Aidan Holm + ++-- Adjust paths to work when running with DEVELOPMENT_PATHS=0 ++dofile("tests/async/wrangle_paths.lua") ++require_web_module("tests/async/wrangle_paths") ++ + local shared_lib = {} + local priv = require "tests.priv" + local test = require("tests.lib") +diff --git a/tests/async/wrangle_paths.lua b/tests/async/wrangle_paths.lua +new file mode 100644 +index 00000000..66efe929 +--- /dev/null ++++ b/tests/async/wrangle_paths.lua +@@ -0,0 +1,20 @@ ++--- Test runner path wrangler. ++-- ++-- @script async.wrangle_paths ++-- @copyright 2017 Aidan Holm ++ ++local system_paths, luakit_paths = {}, {} ++for path in string.gmatch(package.path, "[^;]+") do ++ if not path:match("^%./") and not path:find("luakit") then ++ table.insert(system_paths, path) ++ elseif not path:match("^%./") and path:find("luakit_test_") then ++ table.insert(luakit_paths, path) ++ end ++end ++local rel_paths = { "./lib/?.lua", "./lib/?/init.lua", "./config/?.lua", "./config/?/init.lua", } ++system_paths = table.concat(system_paths, ";") ++rel_paths = table.concat(rel_paths, ";") ++luakit_paths = table.concat(luakit_paths, ";") ++package.path = string.format("./?.lua;%s;%s;%s", system_paths, rel_paths, luakit_paths) ++ ++-- vim: et:sw=4:ts=8:sts=4:tw=80 diff --git a/www-client/luakit/luakit-2017.08.10.ebuild b/www-client/luakit/luakit-2017.08.10.ebuild new file mode 100644 index 000000000000..58974d97427a --- /dev/null +++ b/www-client/luakit/luakit-2017.08.10.ebuild @@ -0,0 +1,74 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit toolchain-funcs + +DESCRIPTION="A fast, light, simple to use micro-browser using WebKit and Lua" +HOMEPAGE="https://luakit.github.io/luakit" + +if [[ ${PV} == 9999 ]]; then + inherit git-r3 + EGIT_REPO_URI="git://github.com/luakit/luakit.git" +else + SRC_URI="https://github.com/luakit/luakit/archive/${PV}.tar.gz -> ${P}.tar.gz" + KEYWORDS="~amd64" +fi + +LICENSE="GPL-3" +SLOT="0" +IUSE="doc luajit test" + +RDEPEND=" + dev-db/sqlite:3 + dev-libs/glib:2 + dev-lua/luafilesystem[luajit=] + net-libs/webkit-gtk:4= + x11-libs/gtk+:3 + luajit? ( dev-lang/luajit:2 ) + !luajit? ( dev-lang/lua:0 )" +DEPEND="${RDEPEND} + virtual/pkgconfig + doc? ( app-doc/doxygen ) + test? ( + dev-lua/luassert[luajit=] + dev-lua/luacheck[luajit=] + x11-base/xorg-server[xvfb] + )" + +PATCHES=( + "${FILESDIR}"/${PN}-cflags.patch + "${FILESDIR}"/${PN}-fix_tests.patch +) + +src_compile() { + emake \ + CC=$(tc-getCC) \ + PREFIX="${EPREFIX}/usr" \ + XDGPREFIX="${EPREFIX}/etc/xdg" \ + LUA_PKG_NAME=$(usex luajit 'luajit' 'lua') \ + LUA_BIN_NAME=$(usex luajit 'luajit' 'lua') \ + all + + use doc && emake doc +} + +src_test() { + emake \ + LUA_BIN_NAME=$(usex luajit 'luajit' 'lua') \ + run-tests +} + +src_install() { + emake \ + DESTDIR="${D}" \ + PREFIX="${EPREFIX}/usr" \ + DOCDIR="${ED}/usr/share/doc/${PF}" \ + XDGPREFIX="${ED}/etc/xdg" \ + install + + rm "${ED}/usr/share/doc/${PF}/COPYING.GPLv3" || die + + use doc && dodoc -r doc/html +} diff --git a/www-client/luakit/luakit-9999.ebuild b/www-client/luakit/luakit-9999.ebuild new file mode 100644 index 000000000000..136f8177f30a --- /dev/null +++ b/www-client/luakit/luakit-9999.ebuild @@ -0,0 +1,70 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit toolchain-funcs + +DESCRIPTION="A fast, light, simple to use micro-browser using WebKit and Lua" +HOMEPAGE="https://luakit.github.io/luakit" + +if [[ ${PV} == 9999 ]]; then + inherit git-r3 + EGIT_REPO_URI="git://github.com/luakit/luakit.git" +else + SRC_URI="https://github.com/luakit/luakit/archive/${PV}.tar.gz -> ${P}.tar.gz" + KEYWORDS="~amd64" +fi + +LICENSE="GPL-3" +SLOT="0" +IUSE="doc luajit test" + +RDEPEND=" + dev-db/sqlite:3 + dev-libs/glib:2 + dev-lua/luafilesystem[luajit=] + net-libs/webkit-gtk:4= + x11-libs/gtk+:3 + luajit? ( dev-lang/luajit:2 ) + !luajit? ( dev-lang/lua:0 )" +DEPEND="${RDEPEND} + virtual/pkgconfig + doc? ( app-doc/doxygen ) + test? ( + dev-lua/luassert[luajit=] + dev-lua/luacheck[luajit=] + x11-base/xorg-server[xvfb] + )" + +src_compile() { + emake \ + CC=$(tc-getCC) \ + PREFIX="${EPREFIX}/usr" \ + DOCDIR="${EPREFIX}/usr/share/doc/${PF}" \ + XDGPREFIX="${EPREFIX}/etc/xdg" \ + LUA_PKG_NAME=$(usex luajit 'luajit' 'lua') \ + LUA_BIN_NAME=$(usex luajit 'luajit' 'lua') \ + all + + use doc && emake doc +} + +src_test() { + emake \ + LUA_BIN_NAME=$(usex luajit 'luajit' 'lua') \ + run-tests +} + +src_install() { + emake \ + DESTDIR="${D}" \ + PREFIX="${EPREFIX}/usr" \ + DOCDIR="${ED}/usr/share/doc/${PF}" \ + XDGPREFIX="${ED}/etc/xdg" \ + install + + rm "${ED}/usr/share/doc/${PF}/COPYING.GPLv3" || die + + use doc && dodoc -r doc/html +} diff --git a/www-client/luakit/metadata.xml b/www-client/luakit/metadata.xml new file mode 100644 index 000000000000..0d7490811c7c --- /dev/null +++ b/www-client/luakit/metadata.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person" > + <email>lluixhi@gmail.com</email> + <name>Aric Belsito</name> + </maintainer> + <maintainer type="project"> + <email>proxy-maint@gentoo.org</email> + <name>Proxy Maintainers</name> + </maintainer> + <use> + <flag name="luajit">Use <pkg>dev-lang/luajit</pkg> instead of + <pkg>dev-lang/lua</pkg></flag> + </use> +</pkgmetadata> |