Use https by default
[gentoo.git] / dev-libs / libRocket / libRocket-1.2.1_p20130110-r1.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=5
6
7 PYTHON_COMPAT=( python2_7 )
8 inherit cmake-utils eutils python-r1 multilib-minimal
9
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"
13
14 LICENSE="MIT"
15 SLOT="0"
16 KEYWORDS="amd64 x86"
17 IUSE="python samples"
18 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
19
20 RDEPEND="
21         >=media-libs/freetype-2.5.0.1[${MULTILIB_USEDEP}]
22         python? (
23                 ${PYTHON_DEPS}
24                 dev-libs/boost[${PYTHON_USEDEP}]
25         )
26         samples? (
27                 virtual/opengl
28                 x11-libs/libXext
29                 x11-libs/libX11
30         )"
31 DEPEND="${RDEPEND}"
32
33 DOCS=( changelog.txt readme.md )
34
35 python_BUILD_DIR=${WORKDIR}/${P}_build_python
36 CMAKE_USE_DIR="${S}"/Build
37
38 multilib_src_configure() {
39         local mycmakeargs=(
40                 -DBUILD_PYTHON_BINDINGS=OFF
41                 -DSAMPLES_DIR=/usr/share/${PN}/samples
42         )
43
44         if multilib_is_native_abi ; then
45                 mycmakeargs+=( $(cmake-utils_use_build samples SAMPLES) )
46         else
47                 mycmakeargs+=( -DBUILD_SAMPLES=OFF )
48         fi
49
50         cmake-utils_src_configure
51
52         if multilib_is_native_abi ; then
53                 if use python ; then
54                         cfgpybind() {
55                                 local mycmakeargs=(
56                                         -DBUILD_PYTHON_BINDINGS=ON
57                                         -DCMAKE_SKIP_RPATH=YES
58                                 )
59                                 BUILD_DIR="${python_BUILD_DIR}-${EPYTHON}" cmake-utils_src_configure
60                         }
61                         einfo "configuring python binding"
62                         python_foreach_impl cfgpybind
63                 fi
64         fi
65 }
66
67 multilib_src_compile() {
68         cmake-utils_src_compile
69         local abi_build_dir=${BUILD_DIR}
70
71         if multilib_is_native_abi ; then
72                 if use python ; then
73                         buildpybind() {
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
76                         }
77                         einfo "compiling python binding"
78                         python_foreach_impl buildpybind
79                 fi
80         fi
81 }
82
83 multilib_src_install() {
84         cmake-utils_src_install
85
86         if multilib_is_native_abi ; then
87                 if use python ; then
88                         instpybind() {
89                                 python_domodule "${S}"/bin/rocket.py
90                                 exeinto "$(python_get_sitedir)"
91                                 doexe ${python_BUILD_DIR}-${EPYTHON}/_rocket{core,controls}.so
92                         }
93                         einfo "installing python binding"
94                         python_foreach_impl instpybind
95                 fi
96         fi
97 }