dev-libs/libluv: new package (1.30.1_p0)
authorBernardo Meurer <bernardo@standard.ai>
Thu, 5 Sep 2019 08:15:50 +0000 (01:15 -0700)
committerJoonas Niilola <juippis@gentoo.org>
Thu, 5 Sep 2019 18:45:03 +0000 (21:45 +0300)
Bare libuv bindings for lua

Closes: https://bugs.gentoo.org/691878
Package-Manager: Portage-2.3.75, Repoman-2.3.17
Signed-off-by: Bernardo Meurer <bernardo@standard.ai>
Closes: https://github.com/gentoo/gentoo/pull/12864
Signed-off-by: Joonas Niilola <juippis@gentoo.org>
dev-lua/luv/Manifest [new file with mode: 0644]
dev-lua/luv/luv-1.30.1_p0.ebuild [new file with mode: 0644]
dev-lua/luv/metadata.xml [new file with mode: 0644]

diff --git a/dev-lua/luv/Manifest b/dev-lua/luv/Manifest
new file mode 100644 (file)
index 0000000..0b15419
--- /dev/null
@@ -0,0 +1,2 @@
+DIST luv-1.30.1_p0.tar.gz 88560 BLAKE2B 9eb32f4e13921899a80dfba143508d26ef0bee3ce0186b62b31ee9da508aa434ac01dcdbd5654f03fd18798791b71e310739e2d9a879f03bf6c48475cc6e0b46 SHA512 c7f613e72d5e5e93035597fcb6a3868d60e61811d4858ced1c2087f31ed0720c11fe436af51d6626c0d77ed448989520b220d6a150b49f6ec0fe557472dd66c7
+DIST luv-lua-compat-1.30.1_p0.zip 62515 BLAKE2B 173dbe43a1f1f4e440c1e40b0a0b22b4ca580568e754a44fbcf57370a53340ebe247de18ae8e98e68cf0f85ae2fa6ec41d5acfb9a433e4bdc717a1e80a2480b6 SHA512 7e66b059aecdb4de630fd305fdcc439cccac94b44101c8b74d61f0f40a1e01e8e68c811a96bddcf5bb0ae09f369d9524f0ec9b009e31d89aef2a1115becba056
diff --git a/dev-lua/luv/luv-1.30.1_p0.ebuild b/dev-lua/luv/luv-1.30.1_p0.ebuild
new file mode 100644 (file)
index 0000000..50c64f2
--- /dev/null
@@ -0,0 +1,62 @@
+# Copyright 2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit cmake-utils unpacker
+
+MY_PV="${PV/_p/-}"
+MY_P="${PN}-${MY_PV}"
+
+DESCRIPTION="Bare libuv bindings for lua"
+HOMEPAGE="https://github.com/luvit/luv"
+# XXX: Remember to check this hash between bumps!
+# https://github.com/luvit/luv/tree/master/deps
+LUA_COMPAT_HASH="daebe77a2f498817713df37f0bb316db1d82222f"
+SRC_URI="
+       https://github.com/luvit/${PN}/archive/${MY_PV}.tar.gz -> ${P}.tar.gz
+       https://github.com/keplerproject/lua-compat-5.3/archive/${LUA_COMPAT_HASH}.zip -> ${PN}-lua-compat-${PV}.zip
+"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="luajit test"
+
+BDEPEND="
+       virtual/pkgconfig
+       test? (
+               luajit? ( dev-lang/luajit:2 )
+               !luajit? ( dev-lang/lua:0 )
+       )
+"
+DEPEND="dev-libs/libuv:="
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+       # Fix libdir
+       # Match '/lib/' and '/lib"' without capturing / or ", replacing with libdir
+       sed -i -r "s/\/lib(\"|\/)/\/$(get_libdir)\1/g" CMakeLists.txt || die "Failed to sed CMakeLists.txt"
+       cmake-utils_src_prepare
+}
+
+src_configure() {
+       lua_compat_dir="${WORKDIR}/lua-compat-5.3-${LUA_COMPAT_HASH}"
+       local mycmakeargs=(
+               -DBUILD_MODULE=OFF
+               -DLUA_BUILD_TYPE=System
+               -DLUA_COMPAT53_DIR="${lua_compat_dir}"
+               -DWITH_LUA_ENGINE=$(usex luajit LuaJIT Lua)
+               -DWITH_SHARED_LIBUV=ON
+       )
+       cmake-utils_src_configure
+}
+
+src_test() {
+       local elua="$(usex luajit luajit lua)"
+       # We need to copy the library back so that the tests see it
+       cp "${BUILD_DIR}/libluv.so" "./luv.so" || die "Failed to copy library for tests"
+       ${elua} "tests/run.lua" || die "Tests failed"
+}
diff --git a/dev-lua/luv/metadata.xml b/dev-lua/luv/metadata.xml
new file mode 100644 (file)
index 0000000..b860177
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+       <maintainer type="person">
+               <email>bernardo@standard.ai</email>
+               <name>Bernardo Meurer</name>
+       </maintainer>
+       <maintainer type="project">
+               <email>proxy-maint@gentoo.org</email>
+               <name>Gentoo Proxy Maintainers Project</name>
+       </maintainer>
+       <longdescription lang="en">
+               libuv bindings for luajit and lua 5.1/ 5.2/ 5.3.
+
+               This library makes libuv available to lua scripts. It was made for the
+               luvit project but should usable from nearly any lua project.
+       </longdescription>
+       <upstream>
+               <remote-id type="github">luvit/luv</remote-id>
+       </upstream>
+</pkgmetadata>