1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 PYTHON_COMPAT=( python2_7 )
8 inherit cmake-utils eutils python-r1 multilib-minimal
10 DESCRIPTION="A HTML/CSS User Interface library"
11 HOMEPAGE="http://librocket.com/"
12 SRC_URI="https://dev.gentoo.org/~hasufell/distfiles/${P}.tar.xz"
18 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
21 >=media-libs/freetype-2.5.0.1[${MULTILIB_USEDEP}]
24 dev-libs/boost[${PYTHON_USEDEP}]
33 DOCS=( changelog.txt readme.md )
35 python_BUILD_DIR=${WORKDIR}/${P}_build_python
36 CMAKE_USE_DIR="${S}"/Build
38 multilib_src_configure() {
40 -DBUILD_PYTHON_BINDINGS=OFF
41 -DSAMPLES_DIR=/usr/share/${PN}/samples
44 if multilib_is_native_abi ; then
45 mycmakeargs+=( $(cmake-utils_use_build samples SAMPLES) )
47 mycmakeargs+=( -DBUILD_SAMPLES=OFF )
50 cmake-utils_src_configure
52 if multilib_is_native_abi ; then
56 -DBUILD_PYTHON_BINDINGS=ON
57 -DCMAKE_SKIP_RPATH=YES
59 BUILD_DIR="${python_BUILD_DIR}-${EPYTHON}" cmake-utils_src_configure
61 einfo "configuring python binding"
62 python_foreach_impl cfgpybind
67 multilib_src_compile() {
68 cmake-utils_src_compile
69 local abi_build_dir=${BUILD_DIR}
71 if multilib_is_native_abi ; then
74 cp "${abi_build_dir}"/{libRocketCore*,libRocketControls*} "${python_BUILD_DIR}-${EPYTHON}"/ || die
75 BUILD_DIR="${python_BUILD_DIR}-${EPYTHON}" cmake-utils_src_make _rocketcontrols/fast _rocketcore/fast
77 einfo "compiling python binding"
78 python_foreach_impl buildpybind
83 multilib_src_install() {
84 cmake-utils_src_install
86 if multilib_is_native_abi ; then
89 python_domodule "${S}"/bin/rocket.py
90 exeinto "$(python_get_sitedir)"
91 doexe ${python_BUILD_DIR}-${EPYTHON}/_rocket{core,controls}.so
93 einfo "installing python binding"
94 python_foreach_impl instpybind