summaryrefslogtreecommitdiff
blob: ce9cc4eb272e29117e77b4d049b5eff1df9cdab5 (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
# 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 2 '_')
MY_P="${MY_PN}_${MY_PV}"

SRC_URI="http://alembic.googlecode.com/files/${MY_P}.tgz"

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]
	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}/${MY_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/alembic-1.0.0/lib/static/*.a
	cp -r ${TMPINSTALL}/usr/local/alembic-1.0.0/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}/${MY_P}
		doxygen
		dohtml -r doc/html/*
	fi
}