# Copyright 1999-2017 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 EAPI=6 AUTOTOOLS_PRUNE_LIBTOOL_FILES="all" inherit autotools multilib multilib-minimal DESCRIPTION="A powerful light-weight programming language designed for extending applications" HOMEPAGE="http://www.lua.org/" SRC_URI="http://www.lua.org/ftp/${P}.tar.gz test? ( http://www.lua.org/tests/${P}-tests.tar.gz )" LICENSE="MIT" SLOT="5.3" KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" IUSE="+compat emacs readline static test" RDEPEND="readline? ( sys-libs/readline:0= ) app-eselect/eselect-lua !dev-lang/lua:0" DEPEND="${RDEPEND}" PDEPEND="emacs? ( app-emacs/lua-mode )" MULTILIB_WRAPPED_HEADERS=( /usr/include/lua${SLOT}/luaconf.h ) PATCHES=( "${FILESDIR}/${SLOT}/${PN}-5.3.0-autotoolize.patch" ) src_prepare() { default # Prepare to autotools sed -ie "s/5.3.0/${PV}/g" configure.ac eautoreconf } multilib_src_configure() { ECONF_SOURCE="${S}" econf \ $(use_enable static) \ $(use_with compat compat-module) \ $(use_with readline) \ --program-suffix="${SLOT}" \ --includedir="/usr/include/lua${SLOT}" } multilib_src_install() { emake install DESTDIR="${D}" find "${D}" -name '*.la' -delete || die } multilib_src_install_all() { dodoc README doc/*.{css,gif,html,png} } multilib_src_test() { pushd "${WORKDIR}/${P}-tests" >/dev/null || die LD_LIBRARY_PATH="${BUILD_DIR}/${P}/src/.libs" \ "${BUILD_DIR}/src/lua" -e"_U=true" all.lua || die popd >/dev/null || die }