# Copyright 1999-2008 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils findlib DESCRIPTION="OCaml library which reads and writes data in the JSON format" HOMEPAGE="http://martin.jambon.free.fr/json-wheel.html" SRC_URI="http://martin.jambon.free.fr/${P}.tar.gz" LICENSE="as-is GPL-2" SLOT="0" KEYWORDS="~amd64 ~x86" IUSE="+ocamlopt" DEPEND=">=dev-lang/ocaml-3.10 >=dev-ml/ocamlnet-2.2.9" RDEPEND="${DEPEND}" pkg_setup() { if use ocamlopt && ! built_with_use --missing true dev-lang/ocaml ocamlopt; then eerror "In order to build ${PN} with native code support from ocaml" eerror "You first need to have a native code ocaml compiler." eerror "You need to install dev-lang/ocaml with ocamlopt useflag on." die "Please install ocaml with ocamlopt useflag" fi } src_compile() { emake all || die "make failed" if use ocamlopt; then emake opt || die "make failed" fi } src_install() { dodir /usr/bin findlib_src_install BINDIR="${D}/usr/bin" }