# Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ # FIXME This isn't just distutils, but runs javac from distutils - meaning java # stuff comes into play. Goodness. Satisfieing both the Java and Python teams is # going to be interesting. Plus, how are we going to ensure that other packages # (like pylucene) that use this to build and install, aren't going to break # gentoo policies? NEED_PYTHON=2.5 JAVA_PKG_IUSE="source" inherit versionator java-pkg-2 distutils DESCRIPTION="a C++ code generator for calling Java from C++/Python" HOMEPAGE="http://lucene.apache.org/pylucene/jcc/index.html" # NOTE: Versioned and slotted to match PyLucene MY_PN="PyLucene" MY_PV="$(replace_version_separator 3 '-')" MY_P="${MY_PN}-${MY_PV}" SRC_URI="http://downloads.osafoundation.org/PyLucene/jcc/${MY_PN}-${MY_PV}-src-jcc.tar.gz" RESTRICT="mirror" LICENSE="Apache-2.0" SLOT="2.4" KEYWORDS="~x86" IUSE="debug" DEPEND=">=virtual/jdk-1.4" RDEPEND=">=virtual/jre-1.4 dev-python/setuptools" S=${WORKDIR}/${MY_P}/jcc # FIXME Needs a patch applied to setuptools (issue 43) DOCS="README CHANGES DESCRIPTION INSTALL" export JCC_ARGSEP=" " # Does this mean that it'll need to be compiled after every java update? export JCC_INCLUDES="${JDK_HOME}/include/ ${JDK_HOME}/include/linux/" export JCC_CFLAGS="-fno-strict-aliasing -Wno-write-strings" export JCC_DEBUG_CFLAGS="-O0 -g --DDEBUG" export JCC_LFLAGS="-Wl \ -L${JAVA_HOME}/jre/lib/i386/ -ljava \ -L${JAVA_HOME}/jre/lib/i386/client/ -ljvm \ -rpath=${JAVA_HOME}/jre/lib/i386/:${JAVA_HOME}/jre/lib/i386/client/" export JCC_JAVAC="ejavac" src_compile() { # We need to get setuptools patched with patches/patch.43 to be able to # compile this right. NO_SHARED disables the check for such a patch. #NO_SHARED=1 if use debug; then distutils_src_compile --debug else distutils_src_compile fi } src_install() { # Note: no need to handle the docs with the java scripts because # distutils'll do that for us according to the DOCS variable above # No jar files created - no need to newjar them. if use debug; then distutils_src_install --debug else distutils_src_install fi use source && java-pkg_dosrc "${S}/java/org" # TODO handle the python and cpp source as well. }