Sophie

Sophie

distrib > Mageia > 1 > i586 > media > core-updates-src > by-pkgid > 8eb1f219cc29d15fadb5dc59e3988125 > files > 7

v8-3.12.7-0.1.mga1.src.rpm

# Hi Googlers! If you're looking in here for patches, nifty.
# You (and everyone else) are welcome to use any of my Chromium patches under the terms of the GPLv2 or later.
# You (and everyone else) are welcome to use any of my V8-specific patches under the terms of the BSD license.
# You (and everyone else) may NOT use my patches under any other terms.
# I hate to be a party-pooper here, but I really don't want to help Google make a proprietary browser.
# There are enough of those already.
# All copyrightable work in these spec files and patches is Copyright 2010 Tom Callaway

# For the 1.2 branch, we use 0s here
# For 1.3+, we use the three digit versions
%global somajor 3
%global sominor 12
%global sobuild 7
%global sover %{somajor}.%{sominor}.%{sobuild}
%{!?python_sitelib: %global python_sitelib %(%{__python} \
    -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}

%define subrel 1

Name:       v8
Version:    %{somajor}.%{sominor}.%{sobuild}
Release:    %mkrel 0
Summary:    JavaScript Engine
Group:      System/Libraries
License:    BSD
URL:        http://code.google.com/p/v8
# No tarballs, pulled from svn
# Checkout script is Source1
Source0:    v8-%{version}.tar.bz2
Source1:    v8-daily-tarball.sh
# Enable experimental i18n extension that chromium needs
Patch0:     v8-3.3.10-enable-experimental.patch
# Disable comparison check that gcc 4.5 thinks is always false
Patch1:     v8-3.2.10-always-false.patch
# Fix language-matcher.cc compile
Patch2:     v8-3.3.10-language-matcher-fix.patch
# Remove unnecessary shebangs
Patch3:     v8-2.5.9-shebangs.patch
ExclusiveArch:    %{ix86} x86_64 %arm
BuildRequires:    scons
BuildRequires:    readline-devel
BuildRequires:    icu-devel

%description
V8 is Google's open source JavaScript engine. V8 is written in C++ and is used 
in Google Chrome, the open source browser from Google. V8 implements ECMAScript 
as specified in ECMA-262, 3rd edition.

%files
%doc AUTHORS ChangeLog LICENSE
%{_bindir}/d8
%{_libdir}/*.so.*

#--------------------------------------------------------------------

%package devel
Group:      System/Libraries 
Summary:    Development headers and libraries for v8
Requires:   %{name} = %{version}-%{release}

%description devel
Development headers and libraries for v8.

%files devel
%{_includedir}/*.h
%{_includedir}/v8
%{_includedir}/v8/extensions/
%{_libdir}/*.so
%{python_sitelib}/j*.py*

#--------------------------------------------------------------------

%prep
%setup -qn %{name}-%{version}

# -fno-strict-aliasing is needed with gcc 4.4 to get past some ugly code
PARSED_OPT_FLAGS=`echo \'%{optflags} \' | sed "s/ /',/g" | sed "s/',/', '/g"`
sed -i "s|'-O3',|$PARSED_OPT_FLAGS '-fno-strict-aliasing',|g" SConstruct

%build

env=CCFLAGS:"-fPIC"
scons -j3 library=shared snapshots=on visibility=default mode=release \
%ifarch x86_64
arch=x64 \
%endif
%ifarch %arm
armeabi=hard vfp3=on \
%endif

# When will people learn to create versioned shared libraries by default?
# first, lets get rid of the old .so
rm -rf libv8.so
rm -rf libv8preparser.so
# Now, lets make it right.
g++ %{optflags} -shared -Wl,-soname,libv8preparser.so.%{somajor} -o libv8preparser.so.%{sover} obj/release/allocation.os obj/release/bignum-dtoa.os obj/release/bignum.os obj/release/cached-powers.os obj/release/conversions.os obj/release/diy-fp.os obj/release/dtoa.os obj/release/fast-dtoa.os obj/release/fixed-dtoa.os obj/release/preparse-data.os obj/release/preparser-api.os obj/release/preparser.os obj/release/scanner.os obj/release/strtod.os obj/release/token.os obj/release/unicode.os obj/release/utils.os -lpthread
rm obj/release/preparser-api.os
%ifarch %arm
g++ %{optflags} -shared -Wl,-soname,libv8.so.%{somajor} -o libv8.so.%{sover} obj/release/*.os obj/release/arm/*.os obj/release/extensions/*.os -lpthread
%endif
%ifarch %{ix86}
g++ %{optflags} -shared -Wl,-soname,libv8.so.%{somajor} -o libv8.so.%{sover} obj/release/*.os obj/release/ia32/*.os obj/release/extensions/*.os -lpthread
%endif
%ifarch x86_64
g++ %{optflags} -shared -Wl,-soname,libv8.so.%{somajor} -o libv8.so.%{sover} obj/release/*.os obj/release/x64/*.os obj/release/extensions/*.os -lpthread
%endif

# We need to do this so d8 can link against it.
ln -sf libv8.so.%{sover} libv8.so
ln -sf libv8preparser.so.%{sover} libv8preparser.so

scons d8 mode=release \
%ifarch x86_64
arch=x64 \
%endif
%ifarch %arm
armeabi=hard vfp3=on \
%endif
library=shared snapshots=on console=readline visibility=default

# Sigh. I f*****g hate scons.
rm -rf d8

g++ %{optflags} -o d8 obj/release/d8.os -lv8 -lpthread -lreadline -L.

%install
mkdir -p %{buildroot}%{_includedir}
mkdir -p %{buildroot}%{_libdir}
install -p include/*.h %{buildroot}%{_includedir}


mkdir -p %{buildroot}%{_includedir}/v8/x64
install -p src/*.h %{buildroot}%{_includedir}/v8
install -p src/x64/*.h %{buildroot}%{_includedir}/v8/x64


install -p libv8.so.%{sover} %{buildroot}%{_libdir}
install -p libv8preparser.so.%{sover} %{buildroot}%{_libdir}
mkdir -p %{buildroot}%{_bindir}
install -p -m0755 d8 %{buildroot}%{_bindir}

pushd %{buildroot}%{_libdir}
ln -sf libv8.so.%{sover} libv8.so
ln -sf libv8.so.%{sover} libv8.so.%{somajor}
ln -sf libv8.so.%{sover} libv8.so.%{somajor}.%{sominor}
ln -sf libv8preparser.so.%{sover} libv8preparser.so.%{somajor}.%{sominor}
ln -sf libv8preparser.so.%{sover} libv8preparser.so.%{somajor}
ln -sf libv8preparser.so.%{sover} libv8preparser.so
popd

chmod -x %{buildroot}%{_includedir}/v8*.h

mkdir -p %{buildroot}%{_includedir}/v8/extensions/experimental/
install -p src/extensions/*.h %{buildroot}%{_includedir}/v8/extensions/
#install -p src/extensions/experimental/*.h %{buildroot}%{_includedir}/v8/extensions/experimental/

chmod -x %{buildroot}%{_includedir}/v8/extensions/*.h
#chmod -x %{buildroot}%{_includedir}/v8/extensions/experimental/*.h

# install Python JS minifier scripts for nodejs
install -d %{buildroot}%{python_sitelib}
install -p -m0744 tools/jsmin.py %{buildroot}%{python_sitelib}/
chmod -R -x %{buildroot}%{python_sitelib}/*.py*


%changelog

* Thu Jul 05 2012 dmorgan <dmorgan> 3.12.7-0.1.mga1
+ Revision: 267823
- New version 3.12.7 ( mga #6679 )

* Sat Mar 26 2011 shikamaru <shikamaru> 3.1.8.3-1.mga1
+ Revision: 77771
- imported package v8


* Sat Mar 26 2011 Rémy CLOUARD <shikamaru@mandriva.org> 3.1.8.3-1.mga1
- initial package