Diff lua-5.2.4-r1 with a lua-5.3.3

/usr/portage/dev-lang/lua/lua-5.3.3.ebuild 2019-01-26 00:09:00.000000000 +0300
7 7

  
8 8
DESCRIPTION="A powerful light-weight programming language designed for extending applications"
9 9
HOMEPAGE="http://www.lua.org/"
10
TEST_PV="5.2.2" # no 5.2.3-specific release yet
11
TEST_A="${PN}-${TEST_PV}-tests.tar.gz"
12
PKG_A="${P}.tar.gz"
13
SRC_URI="
14
	http://www.lua.org/ftp/${PKG_A}
15
	test? ( https://www.lua.org/tests/${TEST_A} )"
10
SRC_URI="http://www.lua.org/ftp/${P}.tar.gz"
16 11

  
17 12
LICENSE="MIT"
18
SLOT="5.2"
13
SLOT="5.3"
19 14
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"
20
IUSE="+deprecated emacs readline static test test-complete"
15
IUSE="+deprecated emacs readline static"
21 16

  
22 17
RDEPEND="readline? ( sys-libs/readline:0= )
23 18
	app-eselect/eselect-lua
......
115 110
	emake INSTALL_TOP="${ED}/usr" INSTALL_LIB="${ED}/usr/$(get_libdir)" \
116 111
			V=${SLOT} gentoo_install
117 112

  
118
	case $SLOT in
119
		0)
120
			LIBNAME="lua"
121
			INCLUDEDIR_SUFFIX=''
122
			;;
123
		*)	LIBNAME="lua${SLOT}"
124
			INCLUDEDIR_SUFFIX="/lua${SLOT}"
125
			;;
126
	esac
127

  
128 113
	# We want packages to find our things...
129
	# A slotted Lua uses different directories for headers & names for
130
	# libraries, and pkgconfig should reflect that.
131
	local PATCH_PV=$(get_version_component_range 1-2)
132
	cp "${FILESDIR}/lua.pc" "${WORKDIR}" || die
133
	sed -r -i \
114
	cp "${FILESDIR}/lua.pc" "${WORKDIR}"
115
	sed -i \
134 116
		-e "s:^prefix= :prefix= ${EPREFIX}:" \
135 117
		-e "s:^V=.*:V= ${PATCH_PV}:" \
136 118
		-e "s:^R=.*:R= ${PV}:" \
137 119
		-e "s:/,lib,:/$(get_libdir):g" \
138
		-e "/^Libs:/s:( )(-llua)($| ):\1-l${LIBNAME}\3:" \
139
		-e "/^includedir=/s:include$:include${INCLUDEDIR_SUFFIX}:" \
140
		"${WORKDIR}/lua.pc" || die
120
		"${WORKDIR}/lua.pc"
141 121

  
142 122
	insinto "/usr/$(get_libdir)/pkgconfig"
143 123
	newins "${WORKDIR}/lua.pc" "lua${SLOT}.pc"
144
	# Copy Debian's symlink support:
145
	# https://salsa.debian.org/lua-team/lua5.3/blob/master/debian/rules#L19
146
	# FreeBSD calls the pkgconfig 'lua-5.3.pc'
147
	# Older systems called it 'lua53.pc'
148
	dosym "lua${SLOT}.pc" "/usr/$(get_libdir)/pkgconfig/lua-${SLOT}.pc"
149
	dosym "lua${SLOT}.pc" "/usr/$(get_libdir)/pkgconfig/lua${SLOT/.}.pc"
150 124
}
151 125

  
152 126
multilib_src_install_all() {
......
159 133

  
160 134
# Makefile contains a dummy target that doesn't do tests
161 135
# but causes issues with slotted lua (bug #510360)
162
src_test() {
163
	debug-print-function ${FUNCNAME} "$@"
164
	cd "${WORKDIR}/lua-${TEST_PV}-tests" || die
165
	# https://www.lua.org/tests/
166
	# There are two sets:
167
	# basic
168
	# complete.
169
	#
170
	# The basic subset is selected by passing -e'_U=true'
171
	# The complete set is noted to contain tests that may consume too much memory or have non-portable tests.
172
	# attrib.lua for example needs some multilib customization (have to compile the stuff in libs/ for each ABI)
173
	use test-complete || TEST_OPTS="-e_U=true"
174
	TEST_MARKER="${T}/test.failed"
175
	rm -f "${TEST_MARKER}"
176

  
177
	# If we are failing, set the marker file, and only check it after done all ABIs
178
	abi_src_test() {
179
		debug-print-function ${FUNCNAME} "$@"
180
		TEST_LOG="${T}/test.${MULTIBUILD_ID}.log"
181
		eval "${BUILD_DIR}"/src/lua${SLOT} ${TEST_OPTS} all.lua 2>&1 | tee "${TEST_LOG}" || die
182
		grep -sq -e "final OK" "${TEST_LOG}" || echo "FAIL ${MULTIBUILD_ID}" >>"${TEST_MARKER}"
183
		return 0
184
	}
185

  
186
	multilib_foreach_abi abi_src_test
187

  
188
	if [ -e "${TEST_MARKER}" ]; then
189
		cat "${TEST_MARKER}"
190
		die "Tests failed"
191
	fi
192
}
136
src_test() { :; }
Thank you!