dev-ml/num: add for newer ocaml + coq
[gentoo.git] / dev-ml / facile / facile-1.1.3.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 DESCRIPTION="OCaml constraint programming library on integer & integer set finite domains"
7 HOMEPAGE="http://opti.recherche.enac.fr/"
8 SRC_URI="http://opti.recherche.enac.fr/facile/distrib/${P}.tar.gz"
9
10 LICENSE="LGPL-2.1"
11 SLOT="0/${PV}"
12
13 KEYWORDS="alpha amd64 arm64 hppa ia64 ppc ppc64 ~sparc x86"
14 IUSE="+ocamlopt"
15
16 RDEPEND=">=dev-lang/ocaml-4:=[ocamlopt?]"
17 DEPEND="${RDEPEND}
18         sys-apps/sed
19 "
20
21 DOCS=( README )
22
23 PATCHES=( "${FILESDIR}/${PN}"-1.1-make.patch ) # Fix building on FreeBSD
24
25 src_prepare() {
26         default
27
28         # Disable building native code objects if we dont have/want ocamlopt
29         if ! use ocamlopt; then
30                 sed -i -e 's/\.opt//' src/Makefile || die "failed to change native code compiler to bytecode ones"
31                 sed -i -e 's/ facile\.cmxa//' src/Makefile || die "failed to remove native code objects"
32                 sed -i -e 's/\.opt/.out/g' \
33                         -e 's: src/facile\.cmxa::'\
34                         -e 's: src/facile\.a::'\
35                         -e 's:^.*facile\.cmxa::'\
36                         -e 's:^.*facile\.a::' Makefile || die "failed to remove native code objects"
37         fi
38 }
39
40 src_configure(){
41         # This is a custom configure script and it does not support standard options
42         ./configure --faciledir "${D}"$(ocamlc -where)/facile/ || die
43 }
44
45 src_test() {
46         emake check
47 }
48
49 src_install(){
50         dodir $(ocamlc -where)
51         emake install
52         einstalldocs
53 }