1 |
%define major 3 |
2 |
%define libname %mklibname %{name}_ %major |
3 |
%define libpreparser %mklibname %{name}preparser %major |
4 |
%define libdev %mklibname %name -d |
5 |
|
6 |
|
7 |
%global somajor 3 |
8 |
%global sominor 16 |
9 |
%global sobuild 14 |
10 |
%global sover %{somajor}.%{sominor}.%{sobuild} |
11 |
|
12 |
Name: v8 |
13 |
Version: %{somajor}.%{sominor}.%{sobuild} |
14 |
Release: %mkrel 1 |
15 |
Summary: JavaScript Engine |
16 |
Group: System/Libraries |
17 |
License: BSD |
18 |
URL: http://code.google.com/p/v8 |
19 |
# No tarballs, pulled from svn |
20 |
# Checkout script is Source1 |
21 |
Source0: v8-%{version}.tar.xz |
22 |
Source1: v8-daily-tarball.sh |
23 |
# Enable experimental i18n extension that chromium needs |
24 |
Patch0: v8-3.3.10-enable-experimental.patch |
25 |
# Disable comparison check that gcc 4.5 thinks is always false |
26 |
Patch1: v8-3.2.10-always-false.patch |
27 |
# Fix language-matcher.cc compile |
28 |
Patch2: v8-3.3.10-language-matcher-fix.patch |
29 |
# Remove unnecessary shebangs |
30 |
Patch3: v8-2.5.9-shebangs.patch |
31 |
ExclusiveArch: %{ix86} x86_64 %arm |
32 |
BuildRequires: scons |
33 |
BuildRequires: readline-devel |
34 |
BuildRequires: icu-devel |
35 |
|
36 |
%description |
37 |
V8 is Google's open source JavaScript engine. V8 is written in C++ and is used |
38 |
in Google Chrome, the open source browser from Google. V8 implements ECMAScript |
39 |
as specified in ECMA-262, 3rd edition. |
40 |
|
41 |
%files |
42 |
%doc AUTHORS ChangeLog LICENSE |
43 |
%{_bindir}/d8 |
44 |
|
45 |
#-------------------------------------------------------------------- |
46 |
|
47 |
%package -n %libname |
48 |
Summary: JavaScript Engine |
49 |
Group: System/Libraries |
50 |
Conflicts: %name < 3.12.8 |
51 |
|
52 |
%description -n %libname |
53 |
V8 is Google's open source JavaScript engine. V8 is written in C++ and is used |
54 |
in Google Chrome, the open source browser from Google. V8 implements ECMAScript |
55 |
as specified in ECMA-262, 3rd edition. |
56 |
|
57 |
%files -n %libname |
58 |
%{_libdir}/lib%{name}.so.%{major}* |
59 |
|
60 |
#-------------------------------------------------------------------- |
61 |
|
62 |
%package -n %libpreparser |
63 |
Summary: JavaScript Engine |
64 |
Group: System/Libraries |
65 |
Conflicts: %name < 3.12.8 |
66 |
|
67 |
%description -n %libpreparser |
68 |
V8 is Google's open source JavaScript engine. V8 is written in C++ and is used |
69 |
in Google Chrome, the open source browser from Google. V8 implements ECMAScript |
70 |
as specified in ECMA-262, 3rd edition. |
71 |
|
72 |
%files -n %libpreparser |
73 |
%{_libdir}/lib%{name}preparser.so.%{major}* |
74 |
|
75 |
#-------------------------------------------------------------------- |
76 |
|
77 |
%package -n %libdev |
78 |
Group: System/Libraries |
79 |
Summary: Development headers and libraries for v8 |
80 |
Requires: %{libname} = %{version}-%{release} |
81 |
Requires: %libpreparser = %{version}-%{release} |
82 |
Obsoletes: %name-devel |
83 |
Provides: %name-devel = %version-%release |
84 |
|
85 |
%description -n %libdev |
86 |
Development headers and libraries for v8. |
87 |
|
88 |
%files -n %libdev |
89 |
%{_includedir}/*.h |
90 |
%{_includedir}/v8 |
91 |
%{_includedir}/v8/extensions/ |
92 |
%{_libdir}/*.so |
93 |
%{python_sitelib}/j*.py* |
94 |
|
95 |
#-------------------------------------------------------------------- |
96 |
|
97 |
%prep |
98 |
%setup -qn %{name}-%{version} |
99 |
|
100 |
# -fno-strict-aliasing is needed with gcc 4.4 to get past some ugly code |
101 |
PARSED_OPT_FLAGS=`echo \'%{optflags} \' | sed "s/ /',/g" | sed "s/',/', '/g"` |
102 |
sed -i "s|'-O3',|$PARSED_OPT_FLAGS '-fno-strict-aliasing',|g" SConstruct |
103 |
|
104 |
%build |
105 |
|
106 |
env=CCFLAGS:"-fPIC" |
107 |
scons -j3 library=shared snapshots=on visibility=default mode=release \ |
108 |
%ifarch x86_64 |
109 |
arch=x64 \ |
110 |
%endif |
111 |
%ifarch %arm |
112 |
armeabi=hard vfp3=on \ |
113 |
%endif |
114 |
|
115 |
# When will people learn to create versioned shared libraries by default? |
116 |
# first, lets get rid of the old .so |
117 |
rm -rf libv8.so |
118 |
rm -rf libv8preparser.so |
119 |
# Now, lets make it right. |
120 |
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 |
121 |
rm obj/release/preparser-api.os |
122 |
%ifarch %arm |
123 |
g++ %{optflags} -shared -Wl,-soname,libv8.so.%{somajor} -o libv8.so.%{sover} obj/release/*.os obj/release/arm/*.os obj/release/extensions/*.os -lpthread |
124 |
%endif |
125 |
%ifarch %{ix86} |
126 |
g++ %{optflags} -shared -Wl,-soname,libv8.so.%{somajor} -o libv8.so.%{sover} obj/release/*.os obj/release/ia32/*.os obj/release/extensions/*.os -lpthread |
127 |
%endif |
128 |
%ifarch x86_64 |
129 |
g++ %{optflags} -shared -Wl,-soname,libv8.so.%{somajor} -o libv8.so.%{sover} obj/release/*.os obj/release/x64/*.os obj/release/extensions/*.os -lpthread |
130 |
%endif |
131 |
|
132 |
# We need to do this so d8 can link against it. |
133 |
ln -sf libv8.so.%{sover} libv8.so |
134 |
ln -sf libv8preparser.so.%{sover} libv8preparser.so |
135 |
|
136 |
scons d8 mode=release \ |
137 |
%ifarch x86_64 |
138 |
arch=x64 \ |
139 |
%endif |
140 |
%ifarch %arm |
141 |
armeabi=hard vfp3=on \ |
142 |
%endif |
143 |
library=shared snapshots=on console=readline visibility=default |
144 |
|
145 |
# Sigh. I f*****g hate scons. |
146 |
rm -rf d8 |
147 |
|
148 |
g++ %{optflags} -o d8 obj/release/d8.os -lv8 -lpthread -lreadline -L. |
149 |
|
150 |
%install |
151 |
mkdir -p %{buildroot}%{_includedir} |
152 |
mkdir -p %{buildroot}%{_libdir} |
153 |
install -p include/*.h %{buildroot}%{_includedir} |
154 |
|
155 |
|
156 |
mkdir -p %{buildroot}%{_includedir}/v8/x64 |
157 |
install -p src/*.h %{buildroot}%{_includedir}/v8 |
158 |
install -p src/x64/*.h %{buildroot}%{_includedir}/v8/x64 |
159 |
|
160 |
|
161 |
install -p libv8.so.%{sover} %{buildroot}%{_libdir} |
162 |
install -p libv8preparser.so.%{sover} %{buildroot}%{_libdir} |
163 |
mkdir -p %{buildroot}%{_bindir} |
164 |
install -p -m0755 d8 %{buildroot}%{_bindir} |
165 |
|
166 |
pushd %{buildroot}%{_libdir} |
167 |
ln -sf libv8.so.%{sover} libv8.so |
168 |
ln -sf libv8.so.%{sover} libv8.so.%{somajor} |
169 |
ln -sf libv8.so.%{sover} libv8.so.%{somajor}.%{sominor} |
170 |
ln -sf libv8preparser.so.%{sover} libv8preparser.so.%{somajor}.%{sominor} |
171 |
ln -sf libv8preparser.so.%{sover} libv8preparser.so.%{somajor} |
172 |
ln -sf libv8preparser.so.%{sover} libv8preparser.so |
173 |
popd |
174 |
|
175 |
chmod -x %{buildroot}%{_includedir}/v8*.h |
176 |
|
177 |
mkdir -p %{buildroot}%{_includedir}/v8/extensions/experimental/ |
178 |
install -p src/extensions/*.h %{buildroot}%{_includedir}/v8/extensions/ |
179 |
#install -p src/extensions/experimental/*.h %{buildroot}%{_includedir}/v8/extensions/experimental/ |
180 |
|
181 |
chmod -x %{buildroot}%{_includedir}/v8/extensions/*.h |
182 |
#chmod -x %{buildroot}%{_includedir}/v8/extensions/experimental/*.h |
183 |
|
184 |
# install Python JS minifier scripts for nodejs |
185 |
install -d %{buildroot}%{python_sitelib} |
186 |
install -p -m0744 tools/jsmin.py %{buildroot}%{python_sitelib}/ |
187 |
chmod -R -x %{buildroot}%{python_sitelib}/*.py* |