1 |
# Copyright 1999-2012 Gentoo Foundation |
2 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
# $Header: /var/cvsroot/gentoo-x86/dev-lang/v8/v8-3.10.8.7.ebuild,v 1.2 2012/05/26 10:10:50 grobian Exp $ |
4 |
|
5 |
EAPI="4" |
6 |
|
7 |
PYTHON_DEPEND="2:2.6" |
8 |
|
9 |
inherit eutils multilib pax-utils python toolchain-funcs versionator |
10 |
|
11 |
DESCRIPTION="Google's open source JavaScript engine" |
12 |
HOMEPAGE="http://code.google.com/p/v8" |
13 |
SRC_URI="http://commondatastorage.googleapis.com/chromium-browser-official/${P}.tar.bz2" |
14 |
LICENSE="BSD" |
15 |
|
16 |
SLOT="0" |
17 |
KEYWORDS="~amd64 ~x86" |
18 |
IUSE="" |
19 |
|
20 |
pkg_setup() { |
21 |
python_set_active_version 2 |
22 |
python_pkg_setup |
23 |
} |
24 |
|
25 |
src_compile() { |
26 |
tc-export AR CC CXX RANLIB |
27 |
|
28 |
# Use target arch detection logic from bug #354601. |
29 |
case ${CHOST} in |
30 |
i?86-*) myarch=ia32 ;; |
31 |
x86_64-*) |
32 |
if [[ $ABI = x86 ]] ; then |
33 |
myarch=ia32 |
34 |
else |
35 |
myarch=x64 |
36 |
fi ;; |
37 |
arm*-*) myarch=arm ;; |
38 |
*) die "Unrecognized CHOST: ${CHOST}" |
39 |
esac |
40 |
mytarget=${myarch}.release |
41 |
|
42 |
soname_version="$(get_version_component_range 1-3)" |
43 |
|
44 |
local snapshot=on |
45 |
host-is-pax && snapshot=off |
46 |
|
47 |
# TODO: Add console=readline option once implemented upstream |
48 |
# http://code.google.com/p/v8/issues/detail?id=1781 |
49 |
|
50 |
emake V=1 \ |
51 |
library=shared \ |
52 |
werror=no \ |
53 |
soname_version=${soname_version} \ |
54 |
snapshot=${snapshot} \ |
55 |
${mytarget} || die |
56 |
|
57 |
pax-mark m out/${mytarget}/{cctest,d8,shell} || die |
58 |
} |
59 |
|
60 |
src_test() { |
61 |
local arg testjobs |
62 |
for arg in ${MAKEOPTS}; do |
63 |
case ${arg} in |
64 |
-j*) testjobs=${arg#-j} ;; |
65 |
--jobs=*) testjobs=${arg#--jobs=} ;; |
66 |
esac |
67 |
done |
68 |
|
69 |
tools/test-wrapper-gypbuild.py \ |
70 |
-j${testjobs:-1} \ |
71 |
--arch-and-mode=${mytarget} \ |
72 |
--no-presubmit \ |
73 |
--progress=dots || die |
74 |
} |
75 |
|
76 |
src_install() { |
77 |
insinto /usr |
78 |
doins -r include || die |
79 |
|
80 |
dobin out/${mytarget}/d8 || die |
81 |
|
82 |
if [[ ${CHOST} == *-darwin* ]] ; then |
83 |
# buildsystem is too horrific to get this built correctly |
84 |
mv out/${mytarget}/lib.target/libv8.so.${soname_version} \ |
85 |
out/${mytarget}/lib.target/libv8$(get_libname ${soname_version}) || die |
86 |
fi |
87 |
|
88 |
dolib out/${mytarget}/lib.target/libv8$(get_libname ${soname_version}) || die |
89 |
dosym libv8$(get_libname ${soname_version}) /usr/$(get_libdir)/libv8$(get_libname) || die |
90 |
|
91 |
dodoc AUTHORS ChangeLog || die |
92 |
} |
93 |
|
94 |
pkg_preinst() { |
95 |
preserved_libs=() |
96 |
local baselib candidate |
97 |
|
98 |
eshopts_push -s nullglob |
99 |
|
100 |
for candidate in "${EROOT}usr/$(get_libdir)"/libv8$(get_libname).*; do |
101 |
baselib=${candidate##*/} |
102 |
if [[ ! -e "${ED}usr/$(get_libdir)/${baselib}" ]]; then |
103 |
preserved_libs+=( "${EPREFIX}/usr/$(get_libdir)/${baselib}" ) |
104 |
fi |
105 |
done |
106 |
|
107 |
eshopts_pop |
108 |
|
109 |
if [[ ${#preserved_libs[@]} -gt 0 ]]; then |
110 |
preserve_old_lib "${preserved_libs[@]}" |
111 |
fi |
112 |
} |
113 |
|
114 |
pkg_postinst() { |
115 |
if [[ ${#preserved_libs[@]} -gt 0 ]]; then |
116 |
preserve_old_lib_notify "${preserved_libs[@]}" |
117 |
fi |
118 |
} |