Skip to content

Commit

Permalink
dev-libs/libluv: new package (1.30.1_p0)
Browse files Browse the repository at this point in the history
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 <[email protected]>
Closes: gentoo#12864
Signed-off-by: Joonas Niilola <[email protected]>
  • Loading branch information
lovesegfault authored and juippis committed Sep 5, 2019
1 parent 97abf8e commit 9189264
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dev-lua/luv/Manifest
Original file line number Diff line number Diff line change
@@ -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
62 changes: 62 additions & 0 deletions dev-lua/luv/luv-1.30.1_p0.ebuild
Original file line number Diff line number Diff line change
@@ -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"
}
21 changes: 21 additions & 0 deletions dev-lua/luv/metadata.xml
Original file line number Diff line number Diff line change
@@ -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>[email protected]</email>
<name>Bernardo Meurer</name>
</maintainer>
<maintainer type="project">
<email>[email protected]</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>

0 comments on commit 9189264

Please sign in to comment.