Skip to content

Commit

Permalink
dev-lua/ldoc: migrate to lua-single.eclass
Browse files Browse the repository at this point in the history
No point in making this multi-impl regardless of the fact it installs
some Lua modules, from what I can tell LDoc is meant to be always used
as a command-line tool.

Closes: https://bugs.gentoo.org/752897
Signed-off-by: Marek Szuba <[email protected]>
  • Loading branch information
Marek Szuba committed Nov 28, 2020
1 parent e5aaa5e commit 4119516
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 0 deletions.
21 changes: 21 additions & 0 deletions dev-lua/ldoc/files/ldoc-1.4.6-slotted_lua.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Do not try to auto-guess Lua directories from the path to the interpreter,
it does not work with the wrapper set up by lua-single.eclass. Use the
values of LUA, LUA_BINDIR and LUA_SHAREDIR provided by the ebuild instead.

--- a/makefile
+++ b/makefile
@@ -1,13 +1,9 @@
-LUA= $(shell echo `which lua`)
-LUA_BINDIR= $(shell echo `dirname $(LUA)`)
-LUA_PREFIX= $(shell echo `dirname $(LUA_BINDIR)`)
-LUA_SHAREDIR=$(LUA_PREFIX)/share/lua/5.1

ldoc:

install: install_parts
mkdir -p $(DESTDIR)$(LUA_BINDIR)
- echo "lua $(LUA_SHAREDIR)/ldoc.lua \$$*" > $(DESTDIR)$(LUA_BINDIR)/ldoc
+ echo "$(LUA) $(LUA_SHAREDIR)/ldoc.lua \$$*" > $(DESTDIR)$(LUA_BINDIR)/ldoc
chmod +x $(DESTDIR)$(LUA_BINDIR)/ldoc

install_luajit: install_parts
35 changes: 35 additions & 0 deletions dev-lua/ldoc/ldoc-1.4.6-r100.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

LUA_COMPAT=( lua5-1 luajit )

inherit lua-single

DESCRIPTION="A LuaDoc-compatible documentation generation system"
HOMEPAGE="https://stevedonovan.github.io/ldoc/"
SRC_URI="https://github.com/stevedonovan/LDoc/archive/${PV}.tar.gz -> ${P}.tar.gz"

LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~x86"

REQUIRED_USE="${LUA_REQUIRED_USE}"

RDEPEND="$(lua_gen_cond_dep '
dev-lua/penlight[${LUA_USEDEP}]
')"
DEPEND="${RDEPEND}"

PATCHES=(
"${FILESDIR}/${PN}-1.4.6-mkdir.patch"
"${FILESDIR}/${PN}-1.4.6-slotted_lua.patch"
)

S="${WORKDIR}/LDoc-${PV}"
RESTRICT="test"

src_install() {
emake DESTDIR="${ED}" LUA_BINDIR="${EPREFIX}/usr/bin" LUA_SHAREDIR="$(lua_get_lmod_dir)" install
}
1 change: 1 addition & 0 deletions profiles/package.mask
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,7 @@ dev-lua/luacrypto
=dev-libs/efl-1.25.1-r10
>=dev-lua/busted-2.0.0-r100
>=dev-lua/dkjson-2.5-r100
>=dev-lua/ldoc-1.4.6-r100
>=dev-lua/lpeg-1.0.2-r100
>=dev-lua/lua-bit32-5.3.5-r100
>=dev-lua/lua-zlib-1.2-r100
Expand Down

0 comments on commit 4119516

Please sign in to comment.