# Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: PYTHON_DEPEND="3" EAPI=3 inherit multilib git-2 cmake-utils python DESCRIPTION="YafaRay is a raytracing open source render engine" HOMEPAGE="http://www.yafaray.org/" EGIT_REPO_URI="git://github.com/YafaRay/Core.git" LICENSE="LGPL-2.1" SLOT="0" KEYWORDS="~amd64 ~ppc ~x86" IUSE="+blender +qt4 +freetype +openexr +jpeg +png +tiff" RDEPEND=" dev-libs/libxml2 freetype? ( media-libs/freetype ) png? ( media-libs/libpng ) openexr? ( media-libs/openexr ) sys-libs/zlib jpeg? ( virtual/jpeg ) tiff? ( media-libs/tiff ) blender? ( >=media-gfx/blender-2.5 ) qt4? ( x11-libs/qt-gui:4 x11-libs/qt-core:4 )" DEPEND="${RDEPEND} app-arch/unzip dev-lang/swig" pkg_setup() { python_set_active_version 3 } src_configure() { local mycmakeargs="-DYAF_PY_VERSION=$(python_get_version) \ -DPYTHON_INCLUDE_DIR=$(python_get_includedir) \ -DPYTHON_LIBRARY=$(python_get_library) -DYAF_BINDINGS_PY_DIR=$(python_get_sitedir) $(cmake-utils_use_with qt4 QT) $(cmake-tuils_use_with freetype Freetype) $(cmake-tuils_use_with openexr OpenEXR) $(cmake-tuils_use_with jpeg JPEG) $(cmake-tuils_use_with png PNG) $(cmake-tuils_use_with tiff TIFF)" cmake-utils_src_configure } src_unpack() { git-2_src_unpack } src_install(){ cmake-utils_src_install if use blender; then #Since I use blender-9999 and it constantly changes the version I #couldn't think of a better way to get the directory. If some knows of a #more robust way, by all means... local BLENDER_DIR="/usr/share/blender/$(ls /usr/share/blender)/scripts/addons/yafaray/" mkdir -p "${D}${BLENDER_DIR}" EGIT_SOURCEDIR="${D}${BLENDER_DIR}" \ EGIT_REPO_URI="git://github.com/YafaRay/Blender-2.5-Exporter.git" \ git-2_src_unpack dodir "${BLENDER_DIR}"/bin #Technically the python bindings should be installed only for the #system. But enough of the paths are hardcoded in the blender addon that #I just made symlinks. Again, if someone knows a better way... dosym /usr/lib/libyafaraycore.so "${BLENDER_DIR}"bin/libyafaraycore.so || die "link failed" dosym /usr/lib/libyafarayplugin.so "${BLENDER_DIR}"bin/libyafarayplugin.so || die "link failed" dosym "$(python_get_sitedir)"/yafrayinterface.py "${BLENDER_DIR}"bin/yafrayinterface.py || die "link failed" dosym "$(python_get_sitedir)"/_yafrayinterface.so "${BLENDER_DIR}"bin/_yafrayinterface.so || die "link failed" cd "${BLENDER_DIR}"/bin/ ln -s /usr/lib/yafaray/ plugins fi }