summaryrefslogtreecommitdiff
blob: be9e67aeb4f66e37fcf1c80195b2cbc3e3787dc4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

# TODO: replace the alembic_bootstrap.py with proper gentoo methods (cmake eclass)

EAPI=2

inherit eutils versionator

DESCRIPTION="Alembic is an open framework for storing and sharing 3D geometry data that includes a C++ library, a file format, and client plugins and applications."
HOMEPAGE="http://code.google.com/p/alembic"

MY_PN="Alembic"
MY_PV=$(replace_version_separator 3 '_')
MY_P="${MY_PN}_${MY_PV}"
MY_PV_NODATE=$(get_version_component_range 1-3)

SRC_URI="http://alembic.googlecode.com/files/${P}.tar.bz2"

LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64"
IUSE="examples doc"
RDEPEND=""
DEPEND=">=dev-util/cmake-2.8
	>=dev-libs/boost-1.44[static-libs]
	>=media-libs/ilmbase-1.0.1[static-libs]
	>=sci-libs/hdf5-1.8.7[-mpi,static-libs]
	doc? ( >=app-doc/doxygen-1.7.3 )"

TMPBUILD="${WORKDIR}/alembic-build"
TMPINSTALL="${WORKDIR}/alembic-install"

src_configure() {
	mkdir ${TMPBUILD} && cd ${TMPBUILD}
	S=${TMPBUILD}
	
	python ${WORKDIR}/${P}/build/bootstrap/alembic_bootstrap.py \
		--disable-prman --disable-maya --disable-arnold \
		--hdf5_include_dir=/usr/include \
		--hdf5_hdf5_library=/usr/lib/libhdf5.a \
		--boost_include_dir=${LIBS}/boost_install/include \
		--boost_thread_library=/usr/lib/libboost_thread-mt.a \
		--zlib_include_dir=/usr/include \
		--zlib_library=/usr/lib/libz.a \
		--ilmbase_include_dir=/usr/include/OpenEXR \
		--ilmbase_imath_library=/usr/lib/libImath.a \
		.
}

src_compile() {
	emake
	
	if use examples; then
		cd ${S}/examples
		emake all
	fi
}

src_install() {
	mkdir ${TMPINSTALL}
	
	cd ${S}
	emake DESTDIR=${TMPINSTALL} install

	dolib.a ${TMPINSTALL}/usr/local/${PN}-${MY_PV_NODATE}/lib/static/*.a
	cp -r ${TMPINSTALL}/usr/local/${PN}-${MY_PV_NODATE}/include/Alembic ${D}/usr/include

	if use examples; then
		dobin ${TMPBUILD}/examples/bin/AbcEcho/abcecho
		dobin ${TMPBUILD}/examples/bin/AbcEcho/abcechobounds
		dobin ${TMPBUILD}/examples/bin/AbcStitcher/abcstitcher
		dobin ${TMPBUILD}/examples/bin/SimpleAbcViewer/SimpleAbcViewer
	fi

	dodoc ${WORKDIR}/${MY_P}/{ACKNOWLEDGEMENTS,FEEDBACK,LICENSE,MANIFEST,NEWS,README}.txt 

	if use doc; then
		cd ${WORKDIR}/${PN}
		doxygen
		dohtml -r doc/html/*
	fi
}