Diff lua-5.2.3 with a lua-5.2.3-r1

/usr/portage/dev-lang/lua/lua-5.2.3-r1.ebuild 2019-10-11 18:40:00.000000000 +0300
3 3

  
4 4
EAPI=5
5 5

  
6
inherit eutils autotools multilib portability toolchain-funcs versionator
6
inherit eutils autotools multilib multilib-minimal portability toolchain-funcs versionator
7 7

  
8 8
DESCRIPTION="A powerful light-weight programming language designed for extending applications"
9 9
HOMEPAGE="http://www.lua.org/"
......
11 11

  
12 12
LICENSE="MIT"
13 13
SLOT="5.2"
14
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-linux"
14
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
15 15
IUSE="+deprecated emacs readline static"
16 16

  
17 17
RDEPEND="readline? ( sys-libs/readline:0= )
......
21 21
	sys-devel/libtool"
22 22
PDEPEND="emacs? ( app-emacs/lua-mode )"
23 23

  
24
MULTILIB_WRAPPED_HEADERS=(
25
	/usr/include/lua${SLOT}/luaconf.h
26
)
27

  
24 28
src_prepare() {
25 29
	local PATCH_PV=$(get_version_component_range 1-2)
26 30

  
27 31
	epatch "${FILESDIR}"/${PN}-${PATCH_PV}-make-r1.patch
28 32

  
33
	# use glibtool on Darwin (versus Apple libtool)
34
	if [[ ${CHOST} == *-darwin* ]] ; then
35
		sed -i -e '/LIBTOOL = /s:/libtool:/glibtool:' \
36
			Makefile src/Makefile || die
37
	fi
38

  
29 39
	[ -d "${FILESDIR}/${PV}" ] && \
30 40
		EPATCH_SOURCE="${FILESDIR}/${PV}" EPATCH_SUFFIX="upstream.patch" epatch
31 41

  
32
	sed -i \
33
		-e 's:\(define LUA_ROOT\s*\).*:\1"'${EPREFIX}'/usr/":' \
34
		-e "s:\(define LUA_CDIR\s*LUA_ROOT \"\)lib:\1$(get_libdir):" \
35
		src/luaconf.h \
36
	|| die "failed patching luaconf.h"
37

  
38 42
	# correct lua versioning
39
	sed -i -e 's/\(LIB_VERSION = \)6:1:1/\10:0:0/' src/Makefile
43
	sed -i -e 's/\(LIB_VERSION = \)6:1:1/\10:0:0/' src/Makefile || die
40 44

  
41
	sed -i -e 's:\(/README\)\("\):\1.gz\2:g' doc/readme.html
45
	sed -i -e 's:\(/README\)\("\):\1.gz\2:g' doc/readme.html || die
42 46

  
43 47
	if ! use readline ; then
44
		sed -i -e '/#define LUA_USE_READLINE/d' src/luaconf.h
48
		sed -i -e '/#define LUA_USE_READLINE/d' src/luaconf.h || die
45 49
	fi
46 50

  
47 51
	# Using dynamic linked lua is not recommended for performance
......
51 55
	# compiler (built statically) nor the lua libraries (both shared and static
52 56
	# are installed)
53 57
	if use static ; then
54
		sed -i -e 's:\(-export-dynamic\):-static \1:' src/Makefile
58
		sed -i -e 's:\(-export-dynamic\):-static \1:' src/Makefile || die
55 59
	fi
56 60

  
57 61
	# upstream does not use libtool, but we do (see bug #336167)
58
	cp "${FILESDIR}/configure.in" "${S}"
62
	cp "${FILESDIR}/configure.in" "${S}"/ || die
59 63
	eautoreconf
64

  
65
	# custom Makefiles
66
	multilib_copy_sources
60 67
}
61 68

  
62
src_compile() {
69
multilib_src_configure() {
70
	sed -i \
71
		-e 's:\(define LUA_ROOT\s*\).*:\1"'${EPREFIX}'/usr/":' \
72
		-e "s:\(define LUA_CDIR\s*LUA_ROOT \"\)lib:\1$(get_libdir):" \
73
		src/luaconf.h \
74
	|| die "failed patching luaconf.h"
75

  
76
	econf
77
}
78

  
79
multilib_src_compile() {
63 80
	tc-export CC
64 81

  
65 82
	# what to link to liblua
......
86 103
			LUA_LIBS="${mylibs}" \
87 104
			LIB_LIBS="${liblibs}" \
88 105
			V=$(get_version_component_range 1-2) \
89
			gentoo_all || die "emake failed"
106
			gentoo_all
90 107
}
91 108

  
92
src_install() {
109
multilib_src_install() {
93 110
	emake INSTALL_TOP="${ED}/usr" INSTALL_LIB="${ED}/usr/$(get_libdir)" \
94
			V=${SLOT} gentoo_install \
95
	|| die "emake install gentoo_install failed"
96

  
97
	dodoc README
98
	dohtml doc/*.html doc/*.png doc/*.css doc/*.gif
99

  
100
	newman doc/lua.1 lua${SLOT}.1
101
	newman doc/luac.1 luac${SLOT}.1
111
			V=${SLOT} gentoo_install
102 112

  
103 113
	# We want packages to find our things...
104 114
	cp "${FILESDIR}/lua.pc" "${WORKDIR}"
105 115
	sed -i \
116
		-e "s:^prefix= :prefix= ${EPREFIX}:" \
106 117
		-e "s:^V=.*:V= ${PATCH_PV}:" \
107 118
		-e "s:^R=.*:R= ${PV}:" \
108 119
		-e "s:/,lib,:/$(get_libdir):g" \
......
112 123
	newins "${WORKDIR}/lua.pc" "lua${SLOT}.pc"
113 124
}
114 125

  
126
multilib_src_install_all() {
127
	dodoc README
128
	dohtml doc/*.html doc/*.png doc/*.css doc/*.gif
129

  
130
	newman doc/lua.1 lua${SLOT}.1
131
	newman doc/luac.1 luac${SLOT}.1
132
}
133

  
115 134
# Makefile contains a dummy target that doesn't do tests
116 135
# but causes issues with slotted lua (bug #510360)
117 136
src_test() { :; }
Thank you!