| 1 |
# Copyright 1999-2012 Gentoo Foundation |
| 2 |
# Distributed under the terms of the GNU General Public License v2 |
| 3 |
# $Header: /var/cvsroot/gentoo-x86/media-libs/opencollada/opencollada-0_p864.ebuild,v 1.2 2012/01/27 16:47:42 sping Exp $ |
| 4 |
|
| 5 |
EAPI="3" |
| 6 |
|
| 7 |
inherit eutils multilib cmake-utils |
| 8 |
|
| 9 |
DESCRIPTION="Stream based read/write library for COLLADA files" |
| 10 |
HOMEPAGE="http://www.opencollada.org/" |
| 11 |
SRC_URI="http://www.hartwork.org/public/${P}.tar.xz" |
| 12 |
|
| 13 |
LICENSE="MIT" |
| 14 |
SLOT="0" |
| 15 |
KEYWORDS="~amd64 ~x86" |
| 16 |
IUSE="expat" |
| 17 |
|
| 18 |
RDEPEND="dev-libs/libpcre |
| 19 |
expat? ( dev-libs/expat ) |
| 20 |
!expat? ( dev-libs/libxml2 ) |
| 21 |
media-libs/lib3ds |
| 22 |
sys-libs/zlib |
| 23 |
dev-libs/zziplib" |
| 24 |
DEPEND="${RDEPEND} |
| 25 |
sys-apps/findutils |
| 26 |
sys-apps/sed" |
| 27 |
|
| 28 |
CMAKE_BUILD_DIR="${S}"/build |
| 29 |
|
| 30 |
src_prepare() { |
| 31 |
# Remove some bundled dependencies |
| 32 |
edos2unix CMakeLists.txt || die |
| 33 |
epatch "${FILESDIR}"/${P}-expat.patch |
| 34 |
rm -R Externals/{expat,lib3ds,LibXML,pcre,zlib,zziplib} || die |
| 35 |
ewarn "$(echo "Remaining bundled dependencies:"; |
| 36 |
find Externals -mindepth 1 -maxdepth 1 -type d | sed 's|^|- |')" |
| 37 |
|
| 38 |
# Remove unused build systems |
| 39 |
rm Makefile scripts/{unixbuild.sh,vcproj2cmake.rb} || die |
| 40 |
find "${S}" -name SConscript -delete || die |
| 41 |
} |
| 42 |
|
| 43 |
src_configure() { |
| 44 |
local mycmakeargs=" -DUSE_SHARED=ON -DUSE_STATIC=OFF" |
| 45 |
|
| 46 |
# Master CMakeLists.txt says "EXPAT support not implemented" |
| 47 |
# Something like "set(LIBEXPAT_LIBRARIES expat)" is missing to make it build |
| 48 |
use expat \ |
| 49 |
&& mycmakeargs+=' -DUSE_EXPAT=ON -DUSE_LIBXML=OFF' \ |
| 50 |
|| mycmakeargs+=' -DUSE_EXPAT=OFF -DUSE_LIBXML=ON' |
| 51 |
cmake-utils_src_configure |
| 52 |
} |
| 53 |
|
| 54 |
src_install() { |
| 55 |
cmake-utils_src_install |
| 56 |
if [[ $(get_libdir) != 'lib' ]]; then |
| 57 |
mv "${D}"/usr/{lib,$(get_libdir)} || die |
| 58 |
fi |
| 59 |
|
| 60 |
dobin build/bin/OpenCOLLADAValidator || die |
| 61 |
} |