*/*: [QA] Fix trivial cases of MissingTestRestrict
[gentoo.git] / dev-lang / polyml / polyml-5.5.1.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI="5"
5
6 inherit base autotools pax-utils
7
8 MY_P="${PN}.${PV}"
9
10 DESCRIPTION="Poly/ML is a full implementation of Standard ML"
11 HOMEPAGE="https://www.polyml.org"
12 SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.gz"
13
14 LICENSE="LGPL-2.1"
15 SLOT="0/${PV}"
16 KEYWORDS="~amd64 ~x86"
17 IUSE="X elibc_glibc +gmp portable test +threads"
18 RESTRICT="!test? ( test )"
19
20 RDEPEND="X? ( x11-libs/motif:0 )
21                 gmp? ( >=dev-libs/gmp-5 )
22                 elibc_glibc? ( threads? ( >=sys-libs/glibc-2.13 ) )
23                 virtual/libffi"
24 DEPEND="${RDEPEND}"
25
26 S=${WORKDIR}/${MY_P}
27
28 PATCHES=(
29         # Bug 256679 - patch the assembler code.  The remaining executable stacks in ./.libs/poly
30         # comes from the polyml generated ./polyexport.o file.
31         "${FILESDIR}/${PN}-5.5.0-asm.patch"
32         # https://sourceforge.net/p/polyml/code/1875/ for isabelle-2013.2
33         "${FILESDIR}/${PN}-5.5.1-inputN-return-for-zero-chars.patch"
34         # https://sourceforge.net/p/polyml/code/1869/
35         # Adds Test146.ML that fails, applying it anyway as it is required by
36         # sci-mathematics/isabelle-2013.2
37         "${FILESDIR}/${PN}-5.5.1-optimize-closure.patch"
38 )
39
40 src_prepare() {
41         base_src_prepare
42         eautoreconf
43         if [ -f "${S}/Tests/Succeed/Test146.ML" ]; then
44                 mv "${S}/Tests/Succeed/Test146.ML" "${S}/Tests/Succeed/Test146.ML.disable-test-as-it-fails"
45         fi
46 }
47
48 src_configure() {
49         econf \
50                 --enable-shared \
51                 --disable-static \
52                 --with-system-libffi \
53                 $(use_with X x) \
54                 $(use_with gmp) \
55                 $(use_with portable) \
56                 $(use_with threads)
57 }
58
59 src_compile() {
60         # Bug 453146 - dev-lang/polyml-5.5.0: fails to build (pax kernel?)
61         pushd libpolyml || die "Could not cd to libpolyml"
62         emake
63         popd
64         emake polyimport
65         pax-mark m "${S}/.libs/polyimport"
66         emake
67         pax-mark m "${S}/.libs/poly"
68 }
69
70 src_test() {
71         emake tests || die "tests failed"
72 }