Gentoo Archives: gentoo-commits

From: "Vadim A. Misbakh-Soloviov" <mva@×××.name>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/lua:master commit in: dev-lang/luajit/
Date: Mon, 27 May 2013 19:42:57
Message-Id: 1369683749.e665936fc299db6862ab8ecc0842260cc605337a.mva@gentoo
1 commit: e665936fc299db6862ab8ecc0842260cc605337a
2 Author: Vadim A. Misbakh-Soloviov <mva <AT> mva <DOT> name>
3 AuthorDate: Mon May 27 19:42:29 2013 +0000
4 Commit: Vadim A. Misbakh-Soloviov <mva <AT> mva <DOT> name>
5 CommitDate: Mon May 27 19:42:29 2013 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/lua.git;a=commit;h=e665936f
7
8 [dev-lang/luajit] some more ebuild improvements
9
10 Signed-off-by: Vadim A. Misbakh-Soloviov <mva <AT> mva.name>
11
12 ---
13 dev-lang/luajit/luajit-2.0.1.ebuild | 39 +++++++++++++++++++++----------------
14 dev-lang/luajit/luajit-9999.ebuild | 39 +++++++++++++++++++++----------------
15 2 files changed, 44 insertions(+), 34 deletions(-)
16
17 diff --git a/dev-lang/luajit/luajit-2.0.1.ebuild b/dev-lang/luajit/luajit-2.0.1.ebuild
18 index 3859c71..4020f88 100644
19 --- a/dev-lang/luajit/luajit-2.0.1.ebuild
20 +++ b/dev-lang/luajit/luajit-2.0.1.ebuild
21 @@ -23,17 +23,21 @@ PDEPEND="
22
23 S="${WORKDIR}/${MY_P}"
24
25 -# Workaround for CHECKREQS_MEMORY
26 -pkg_setup() { :; }
27 -
28 -pkg_pretend() {
29 - CHECKREQS_DISK_BUILD="10M"
30 - use optimization && {
31 +check_req() {
32 + if use optimization; then
33 CHECKREQS_MEMORY="200M"
34 ewarn "Optimized (amalgamated) build wants at least 200MB of RAM"
35 ewarn "If you have no such RAM - try to disable 'optimization' flag"
36 - }
37 - check-reqs_pkg_pretend
38 + fi
39 + check-reqs_pkg_${1}
40 +}
41 +
42 +pkg_pretend() {
43 + check_req pretend
44 +}
45 +
46 +pkg_setup() {
47 + check_req setup
48 }
49
50 src_prepare(){
51 @@ -48,9 +52,11 @@ src_prepare(){
52 -e "s|lib/|$(get_libdir)/|" \
53 -i src/luaconf.h || die "failed to fix prefix in luaconf.h"
54
55 - use lua52compat && sed \
56 - -e "/LUAJIT_ENABLE_LUA52COMPAT/s|#||" \
57 - -i src/Makefile || die
58 + if use lua52compat; then
59 + sed \
60 + -e "/LUAJIT_ENABLE_LUA52COMPAT/s|#||" \
61 + -i src/Makefile || die "Lua-5.2 compat fix failed"
62 + fi
63
64 # removing strip
65 sed -e '/$(Q)$(TARGET_STRIP)/d' -i src/Makefile \
66 @@ -65,6 +71,9 @@ src_prepare(){
67 }
68
69 src_compile() {
70 + local opt;
71 + use optimization && opt="amalg";
72 +
73 if has_version '=sys-devel/gcc-4.7.3' && gcc-specs-pie && has ccache ${FEATURES}; then
74 # It is three ways to avoid compilation breaking
75 # in case, when user use gcc-4.7.3+pie+ccache:
76 @@ -99,11 +108,7 @@ src_compile() {
77 ewarn "to disable ccache instead."
78 fi
79
80 - if use optimization; then
81 - emake amalg || die "emake failed!"
82 - else
83 - emake || die "emake failed!"
84 - fi
85 + emake "${opt}"
86 }
87
88 src_install() {
89 @@ -118,7 +123,7 @@ pkg_postinst() {
90 einfo "You'd probably want to install dev-lua/iluajit to";
91 ewarn "get fully functional interactive shell for LuaJIT";
92 fi
93 - if has_version app-editors/emacs || app-editors/xemacs; then
94 + if has_version app-editors/emacs || has_version app-editors/xemacs; then
95 einfo "You'd probably want to install app-emacs/lua-mode to";
96 ewarn "get Lua completion in emacs.";
97 fi
98
99 diff --git a/dev-lang/luajit/luajit-9999.ebuild b/dev-lang/luajit/luajit-9999.ebuild
100 index 7a8ce47..90a35e4 100644
101 --- a/dev-lang/luajit/luajit-9999.ebuild
102 +++ b/dev-lang/luajit/luajit-9999.ebuild
103 @@ -21,17 +21,21 @@ PDEPEND="
104 virtual/lua[luajit]
105 "
106
107 -# Workaround for CHECKREQS_MEMORY
108 -pkg_setup() { :; }
109 -
110 -pkg_pretend() {
111 - CHECKREQS_DISK_BUILD="10M"
112 - use optimization && {
113 +check_req() {
114 + if use optimization; then
115 CHECKREQS_MEMORY="200M"
116 ewarn "Optimized (amalgamated) build wants at least 200MB of RAM"
117 ewarn "If you have no such RAM - try to disable 'optimization' flag"
118 - }
119 - check-reqs_pkg_pretend
120 + fi
121 + check-reqs_pkg_${1}
122 +}
123 +
124 +pkg_pretend() {
125 + check_req pretend
126 +}
127 +
128 +pkg_setup() {
129 + check_req setup
130 }
131
132 src_prepare(){
133 @@ -46,9 +50,11 @@ src_prepare(){
134 -e "s|lib/|$(get_libdir)/|" \
135 -i src/luaconf.h || die "failed to fix prefix in luaconf.h"
136
137 - use lua52compat && sed \
138 - -e "/LUAJIT_ENABLE_LUA52COMPAT/s|#||" \
139 - -i src/Makefile || die
140 + if use lua52compat; then
141 + sed \
142 + -e "/LUAJIT_ENABLE_LUA52COMPAT/s|#||" \
143 + -i src/Makefile || die "Lua-5.2 compat fix failed"
144 + fi
145
146 # removing strip
147 sed -e '/$(Q)$(TARGET_STRIP)/d' -i src/Makefile \
148 @@ -61,6 +67,9 @@ src_prepare(){
149 }
150
151 src_compile() {
152 + local opt;
153 + use optimization && opt="amalg";
154 +
155 if has_version '=sys-devel/gcc-4.7.3' && gcc-specs-pie && has ccache ${FEATURES}; then
156 # It is three ways to avoid compilation breaking
157 # in case, when user use gcc-4.7.3+pie+ccache:
158 @@ -95,11 +104,7 @@ src_compile() {
159 ewarn "to disable ccache instead."
160 fi
161
162 - if use optimization; then
163 - emake amalg || die "emake failed!"
164 - else
165 - emake || die "emake failed!"
166 - fi
167 + emake "${opt}"
168 }
169
170 src_install() {
171 @@ -114,7 +119,7 @@ pkg_postinst() {
172 einfo "You'd probably want to install dev-lua/iluajit to";
173 ewarn "get fully functional interactive shell for LuaJIT";
174 fi
175 - if has_version app-editors/emacs || app-editors/xemacs; then
176 + if has_version app-editors/emacs || has_version app-editors/xemacs; then
177 einfo "You'd probably want to install app-emacs/lua-mode to";
178 ewarn "get Lua completion in emacs.";
179 fi