5e78861eac401266faf8ec585ed1243c41be5605
[gentoo.git] / dev-ml / labltk / labltk-8.06.2.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5
6 inherit findlib eutils
7
8 DESCRIPTION="OCaml interface to the Tcl/Tk GUI framework"
9 HOMEPAGE="https://forge.ocamlcore.org/projects/labltk/"
10 SRC_URI="https://forge.ocamlcore.org/frs/download.php/1628/${P}.tar.gz"
11
12 LICENSE="QPL-1.0 LGPL-2"
13 SLOT="0/${PV}"
14 KEYWORDS="~alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 sparc x86 ~amd64-linux ~x86-linux"
15 IUSE="+ocamlopt X"
16
17 RDEPEND=">=dev-lang/tk-8.0.3:=
18         >=dev-lang/ocaml-4.04:=[ocamlopt?,X(+)?]"
19 DEPEND="${RDEPEND}
20         >=dev-ml/findlib-1.5.5-r1"
21
22 src_prepare() {
23         epatch "${FILESDIR}/findlib.patch"
24         has_version '>=dev-lang/ocaml-4.05.0_beta' && epatch "${FILESDIR}/ocaml405.patch"
25 }
26
27 src_configure() {
28         ./configure --use-findlib --verbose $(use X || echo "--tk-no-x11") || die "configure failed!"
29 }
30
31 src_compile() {
32         emake -j1
33         use ocamlopt && emake -j1 opt
34 }
35
36 src_install() {
37         findlib_src_preinst
38         dodir /usr/bin
39         emake \
40                 INSTALLDIR="${D}$(ocamlc -where)/labltk" \
41                 INSTALLBINDIR="${ED}/usr/bin/" \
42                 install
43         dodoc Changes README.mlTk
44 }