Coccinelle release 1.0.0-rc13
[bpt/coccinelle.git] / bundles / pycaml / chemoelectric-pycaml-8614105 / gentoo-support / pycaml-9999.ebuild
CommitLineData
d6ce1786
C
1# Copyright 1999-2008 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2
3# $Header$
4
5EAPI="2"
6SUPPORT_PYTHON_ABIS="1"
7
8inherit findlib python eutils git
9
10IUSE=""
11
12DESCRIPTION="Bindings for Python and OCaml"
13HOMEPAGE="http://github.com/chemoelectric/pycaml"
14SRC_URI=""
15EGIT_REPO_URI="git://github.com/chemoelectric/pycaml.git"
16
17LICENSE="LGPL-2.1"
18SLOT="0"
19KEYWORDS="~amd64 ppc x86"
20
21RDEPEND=">=dev-ml/ocaml-make-6.29.3"
22DEPEND=">=dev-lang/ocaml-3.11.1
23 >=dev-lang/python-2.6.4
24 ${RDEPEND}"
25
26S="${WORKDIR}/${PN}"
27
28
29pkg_setup() {
30 if ! built_with_use --missing true dev-lang/ocaml ocamlopt; then
31 eerror "${PN} needs to be built with native code support from ocaml"
32 eerror "You first need to have a native code ocaml compiler."
33 eerror "You need to install dev-lang/ocaml with ocamlopt useflag on."
34 die "Please install ocaml with ocamlopt useflag"
35 fi
36}
37
38src_compile() {
39 compile_abi_pycaml() {
40 abi=`echo "${PYTHON_ABI}" | sed -e 's/\./_/g'`
41 name="${PN}${abi}"
42 cd "${WORKDIR}"
43 cp -r "${PN}" "${name}"
44 cd "${name}"
45 emake -j1 PYVER="${PYTHON_ABI}" PYVER_PACK="${abi}" \
46 get_libdir="$(get_libdir)" || die "emake failed"
47 }
48 python_execute_function compile_abi_pycaml
49
50 compile_pycaml() {
51 cd "${S}"
52 emake -j1 PYVER="${PYVER}" PYVER_PACK="" \
53 get_libdir="$(get_libdir)" || die "emake failed"
54 }
55 python_version
56 compile_pycaml
57}
58
59src_install() {
60 python_need_rebuild
61
62 # Use findlib to install properly, especially to avoid
63 # the shared library mess
64 findlib_src_preinst
65
66 install_abi_pycaml() {
67 abi=`echo "${PYTHON_ABI}" | sed -e 's/\./_/g'`
68 name="${PN}${abi}"
69 cd "${WORKDIR}/${name}"
70 ocamlfind install "${name}" \
71 dllpycaml"${abi}"_stubs.so* libpycaml"${abi}"_stubs.a \
72 pycaml"${abi}".a pycaml"${abi}".cma pycaml"${abi}".cmxa \
73 pycaml.cmi pycaml.cmo pycaml.cmx pycaml.ml pycaml.mli \
74 pycaml.o pycaml_stubs.c pycaml_stubs.h pycaml_stubs.o META
75 }
76 python_execute_function install_abi_pycaml
77
78 install_pycaml() {
79 cd "${S}"
80 ocamlfind install "${PN}" \
81 dllpycaml_stubs.so* libpycaml_stubs.a pycaml.a pycaml.cma \
82 pycaml.cmi pycaml.cmo pycaml.cmx pycaml.cmxa pycaml.ml pycaml.mli \
83 pycaml.o pycaml_stubs.c pycaml_stubs.h pycaml_stubs.o META
84 }
85 python_version
86 install_pycaml
87}