diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2018-07-14 21:03:06 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2018-07-14 21:03:06 +0100 |
commit | 8376ef56580626e9c0f796d5b85b53a0a1c7d5f5 (patch) | |
tree | 7681bbd4e8b05407772df40a4bf04cbbc8afc3fa /dev-lua/luvit/luvit-9999.ebuild | |
parent | 30a9caf154332f12ca60756e1b75d2f0e3e1822d (diff) |
gentoo resync : 14.07.2018
Diffstat (limited to 'dev-lua/luvit/luvit-9999.ebuild')
-rw-r--r-- | dev-lua/luvit/luvit-9999.ebuild | 101 |
1 files changed, 101 insertions, 0 deletions
diff --git a/dev-lua/luvit/luvit-9999.ebuild b/dev-lua/luvit/luvit-9999.ebuild new file mode 100644 index 000000000000..5718d425719e --- /dev/null +++ b/dev-lua/luvit/luvit-9999.ebuild @@ -0,0 +1,101 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=5 + +inherit toolchain-funcs multilib git-2 + +# TODO: FHS https://github.com/luvit/luvit/issues/379 + +DESCRIPTION="Takes node.js' architecture and dependencies and fits it in the Lua language" +HOMEPAGE="https://luvit.io/" +EGIT_REPO_URI="https://github.com/luvit/luvit.git" + +KEYWORDS="" +SLOT="0" +IUSE="bundled-libs examples libressl" +# luvit Apache-2.0 +# luajit MIT +# yajl BSD +LICENSE="Apache-2.0 bundled-libs? ( BSD MIT )" + +# fails in portage environment +# succeeds if run manually +RESTRICT="test" + +RDEPEND=" + !libressl? ( dev-libs/openssl:0= ) + libressl? ( dev-libs/libressl:0= ) + sys-libs/zlib + !bundled-libs? ( + dev-lang/luajit:2[lua52compat] + >=dev-libs/yajl-2.0.4 + )" +DEPEND="${RDEPEND} + virtual/pkgconfig" + +EGIT_HAS_SUBMODULES=1 + +src_prepare() { + rm -r deps/{openssl,zlib} || die + + if use bundled-libs ; then + MY_YAJL_VERSION=$(git --git-dir deps/yajl/.git describe --tags) + MY_LUAJIT_VERSION=$(git --git-dir deps/luajit/.git describe --tags) + else + rm -r deps/{luajit,yajl} || die + MY_YAJL_VERSION=$($(tc-getPKG_CONFIG) --modversion yajl) + MY_LUAJIT_VERSION=$($(tc-getPKG_CONFIG) --modversion luajit) + fi + + MY_HTTP_VERSION=$(git --git-dir deps/http-parser/.git describe --tags) + MY_UV_VERSION=$(git --git-dir deps/uv/.git describe --all --long | cut -f 3 -d -) + + sed \ + -e "s:^YAJL_VERSION=.*:YAJL_VERSION=${MY_YAJL_VERSION}:" \ + -e "s:^LUAJIT_VERSION=.*:LUAJIT_VERSION=${MY_LUAJIT_VERSION}:" \ + -e "s:^HTTP_VERSION=.*:HTTP_VERSION=${MY_HTTP_VERSION}:" \ + -e "s:^UV_VERSION.*:UV_VERSION=${MY_UV_VERSION}:" \ + -i Makefile || die "sed failed" + + sed -i \ + -e "s/-Werror//" \ + -e "s/-O3//" \ + deps/http-parser/Makefile || die "fixing flags failed!" +} + +src_configure() { + # skip retarded gyp build system + : +} + +src_compile() { + tc-export CC AR + + emake -C deps/cares + + myemakeargs=( + DEBUG=0 + WERROR=0 + USE_SYSTEM_SSL=1 + USE_SYSTEM_ZLIB=1 + # bundled luajit is compiled with special flags + USE_SYSTEM_LUAJIT=$(usex bundled-libs "0" "1") + USE_SYSTEM_YAJL=$(usex bundled-libs "0" "1") + PREFIX=/usr + LIBDIR="${D}"/usr/$(get_libdir)/${PN} + DESTDIR="${D}" + ) + + emake "${myemakeargs[@]}" all +} + +src_install() { + emake "${myemakeargs[@]}" install + dodoc TODO ChangeLog README.markdown errors.markdown + + if use examples ; then + dodoc -r examples + docompress -x /usr/share/doc/${PF}/examples + fi +} |