/[gentoo-x86]/dev-lang/v8/v8-3.9.13.ebuild
Gentoo

Contents of /dev-lang/v8/v8-3.9.13.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Mon Apr 2 12:47:18 2012 UTC (2 years, 8 months ago) by phajdan.jr
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
FILE REMOVED
Version bump for dev channel release. Remove old.

(Portage version: 2.1.10.49/cvs/Linux i686)

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.9.13.ebuild,v 1.2 2012/03/24 10:33:08 phajdan.jr 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 ~x64-macos ~x86-macos"
18 IUSE=""
19
20 pkg_pretend() {
21 local gccver=$(gcc-fullversion)
22 if [[ ${gccver} = 4.5.2 ]]; then
23 eerror "The currently selected version of gcc is known to segfault when building this"
24 eerror "version of V8. Please use at least gcc-4.5.3."
25 die "gcc-${gccver} detected."
26 fi
27 }
28
29 pkg_setup() {
30 python_set_active_version 2
31 python_pkg_setup
32 }
33
34 src_prepare() {
35 # don't force 32-bits mode on Darwin
36 sed -i -e '/-arch i386/d' build/gyp/pylib/gyp/generator/make.py || die
37 # force using Makefiles, instead of Xcode project file on Darwin
38 sed -i -e '/darwin/s/xcode/make/' build/gyp/pylib/gyp/__init__.py || die
39 # don't refuse to build shared_libs because we build somewhere else
40 sed -i \
41 -e '/params\.get.*mac.*darwin.*linux/s/mac/darwin/' \
42 -e "/if GetFlavor(params) == 'mac':/s/mac/darwin/" \
43 -e "/^ if flavor == 'mac':/s/mac/darwin/" \
44 build/gyp/pylib/gyp/generator/make.py || die
45 # make sure our v8.dylib doesn't end up being empty and give it a proper
46 # install_name (soname)
47 sed -i \
48 -e '/^LINK_COMMANDS_MAC =/,/^SHARED_HEADER =/s#-shared#-dynamiclib -all_load -install_name '"${EPREFIX}/usr/$(get_libdir)/libv8$(get_libname $(get_version_component_range 1-3))"'#' \
49 build/gyp/pylib/gyp/generator/make.py || die
50 # don't force targetting old machines
51 sed -i -e "s/, '-mmacosx-version-min=10.4'//" SConstruct || die
52 }
53
54 src_compile() {
55 tc-export AR CC CXX RANLIB
56 export LINK="${CXX}"
57
58 # Use target arch detection logic from bug #354601.
59 case ${CHOST} in
60 i?86-*) myarch=ia32 ;;
61 x86_64-*)
62 if [[ $ABI = x86 ]] ; then
63 myarch=ia32
64 else
65 myarch=x64
66 fi ;;
67 arm*-*) myarch=arm ;;
68 *) die "Unrecognized CHOST: ${CHOST}"
69 esac
70 mytarget=${myarch}.release
71
72 soname_version="$(get_version_component_range 1-3)"
73
74 local snapshot=on
75 host-is-pax && snapshot=off
76
77 # TODO: Add console=readline option once implemented upstream
78 # http://code.google.com/p/v8/issues/detail?id=1781
79
80 emake V=1 \
81 library=shared \
82 werror=no \
83 soname_version=${soname_version} \
84 snapshot=${snapshot} \
85 ${mytarget} || die
86
87 pax-mark m out/${mytarget}/{cctest,d8,shell} || die
88 }
89
90 src_test() {
91 local arg testjobs
92 for arg in ${MAKEOPTS}; do
93 case ${arg} in
94 -j*) testjobs=${arg#-j} ;;
95 --jobs=*) testjobs=${arg#--jobs=} ;;
96 esac
97 done
98
99 tools/test-wrapper-gypbuild.py \
100 -j${testjobs:-1} \
101 --arch-and-mode=${mytarget} \
102 --no-presubmit \
103 --progress=dots || die
104 }
105
106 src_install() {
107 insinto /usr
108 doins -r include || die
109
110 dobin out/${mytarget}/d8 || die
111
112 if [[ ${CHOST} == *-darwin* ]] ; then
113 # buildsystem is too horrific to get this built correctly
114 mv out/${mytarget}/lib.target/libv8.so.${soname_version} \
115 out/${mytarget}/lib.target/libv8$(get_libname ${soname_version}) || die
116 fi
117
118 dolib out/${mytarget}/lib.target/libv8$(get_libname ${soname_version}) || die
119 dosym libv8$(get_libname ${soname_version}) /usr/$(get_libdir)/libv8$(get_libname) || die
120
121 dodoc AUTHORS ChangeLog || die
122 }
123
124 pkg_preinst() {
125 preserved_libs=()
126 local baselib candidate
127
128 eshopts_push -s nullglob
129
130 for candidate in "${EROOT}usr/$(get_libdir)"/libv8$(get_libname).*; do
131 baselib=${candidate##*/}
132 if [[ ! -e "${ED}usr/$(get_libdir)/${baselib}" ]]; then
133 preserved_libs+=( "${EPREFIX}/usr/$(get_libdir)/${baselib}" )
134 fi
135 done
136
137 eshopts_pop
138
139 if [[ ${#preserved_libs[@]} -gt 0 ]]; then
140 preserve_old_lib "${preserved_libs[@]}"
141 fi
142 }
143
144 pkg_postinst() {
145 if [[ ${#preserved_libs[@]} -gt 0 ]]; then
146 preserve_old_lib_notify "${preserved_libs[@]}"
147 fi
148 }

  ViewVC Help
Powered by ViewVC 1.1.20