/[gentoo-x86]/dev-lang/lua/lua-5.1.4-r8.ebuild
Gentoo

Contents of /dev-lang/lua/lua-5.1.4-r8.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.9 - (show annotations) (download)
Sun Sep 9 14:58:48 2012 UTC (2 years, 3 months ago) by armin76
Branch: MAIN
CVS Tags: HEAD
Changes since 1.8: +2 -2 lines
alpha/ia64/s390/sh/sparc stable wrt #430752

(Portage version: 2.1.11.9/cvs/Linux x86_64)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/dev-lang/lua/lua-5.1.4-r8.ebuild,v 1.8 2012/09/05 09:28:49 jlec Exp $
4
5 EAPI=4
6
7 inherit eutils multilib portability toolchain-funcs versionator
8
9 DESCRIPTION="A powerful light-weight programming language designed for extending applications"
10 HOMEPAGE="http://www.lua.org/"
11 SRC_URI="http://www.lua.org/ftp/${P}.tar.gz"
12
13 LICENSE="MIT"
14 SLOT="0"
15 KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~x86-fbsd"
16 IUSE="+deprecated emacs readline static"
17
18 RDEPEND="readline? ( sys-libs/readline )"
19 DEPEND="${RDEPEND}
20 sys-devel/libtool"
21 PDEPEND="emacs? ( app-emacs/lua-mode )"
22
23 src_prepare() {
24 local PATCH_PV=$(get_version_component_range 1-2)
25
26 epatch "${FILESDIR}"/${PN}-${PATCH_PV}-make-r1.patch
27 epatch "${FILESDIR}"/${PN}-${PATCH_PV}-module_paths.patch
28
29 EPATCH_SOURCE="${FILESDIR}/${PV}" EPATCH_SUFFIX="upstream.patch" epatch
30
31 # correct lua versioning
32 sed -i -e 's/\(LIB_VERSION = \)6:1:1/\16:4:1/' src/Makefile
33
34 sed -i -e 's:\(/README\)\("\):\1.gz\2:g' doc/readme.html
35
36 if ! use deprecated ; then
37 epatch "${FILESDIR}"/${P}-deprecated.patch
38 epatch "${FILESDIR}"/${P}-test.patch
39 fi
40
41 if ! use readline ; then
42 epatch "${FILESDIR}"/${PN}-${PATCH_PV}-readline.patch
43 fi
44
45 # Using dynamic linked lua is not recommended for performance
46 # reasons. http://article.gmane.org/gmane.comp.lang.lua.general/18519
47 # Mainly, this is of concern if your arch is poor with GPRs, like x86
48 # Note that this only affects the interpreter binary (named lua), not the lua
49 # compiler (built statically) nor the lua libraries (both shared and static
50 # are installed)
51 if use static ; then
52 epatch "${FILESDIR}"/${PN}-${PATCH_PV}-make_static-r1.patch
53 fi
54
55 # We want packages to find our things...
56 sed -i \
57 -e 's:/usr/local:/usr:' \
58 -e "s:/\<lib\>:/$(get_libdir):g" \
59 etc/lua.pc
60 }
61
62 # no need for a configure phase
63 src_configure() { true; }
64
65 src_compile() {
66 tc-export CC
67 myflags=
68 # what to link to liblua
69 liblibs="-lm"
70 liblibs="${liblibs} $(dlopen_lib)"
71
72 # what to link to the executables
73 mylibs=
74 if use readline; then
75 mylibs="-lreadline"
76 fi
77
78 cd src
79 emake CC="${CC}" CFLAGS="-DLUA_USE_LINUX ${CFLAGS}" \
80 RPATH="${EPREFIX}/usr/$(get_libdir)/" \
81 LUA_LIBS="${mylibs}" \
82 LIB_LIBS="${liblibs}" \
83 V=${PV} \
84 gentoo_all || die "emake failed"
85
86 mv lua_test ../test/lua.static
87 }
88
89 src_install() {
90 emake INSTALL_TOP="${ED}/usr" INSTALL_LIB="${ED}/usr/$(get_libdir)" \
91 V=${PV} gentoo_install \
92 || die "emake install gentoo_install failed"
93
94 dodoc HISTORY README
95 dohtml doc/*.html doc/*.png doc/*.css doc/*.gif
96
97 doicon etc/lua.ico
98 insinto /usr/$(get_libdir)/pkgconfig
99 doins etc/lua.pc
100
101 doman doc/lua.1 doc/luac.1
102 }
103
104 src_test() {
105 local positive="bisect cf echo env factorial fib fibfor hello printf sieve
106 sort trace-calls trace-globals"
107 local negative="readonly"
108 local test
109
110 cd "${S}"
111 for test in ${positive}; do
112 test/lua.static test/${test}.lua || die "test $test failed"
113 done
114
115 for test in ${negative}; do
116 test/lua.static test/${test}.lua && die "test $test failed"
117 done
118 }

  ViewVC Help
Powered by ViewVC 1.1.20