]>
Commit | Line | Data |
---|---|---|
5e90f260 ER |
1 | |
2 | # For the 1.2 branch, we use 0s here | |
3 | # For 1.3+, we use the three digit versions | |
ecf7d4a4 | 4 | %define somajor 3 |
5 | %define sominor 1 | |
6 | %define sobuild 5 | |
5e90f260 ER |
7 | %define sover %{somajor}.%{sominor}.%{sobuild} |
8 | ||
ecf7d4a4 | 9 | %define snap 20110218svn6858 |
37bf3af8 | 10 | %define rel 1 |
b8bbb50f AM |
11 | Summary: JavaScript Engine |
12 | Name: v8 | |
ecf7d4a4 | 13 | Version: 3.1.5.0 |
c894b44e | 14 | Release: 0.%{snap}.%{rel} |
b8bbb50f AM |
15 | License: BSD |
16 | Group: Libraries | |
17 | URL: http://code.google.com/p/v8 | |
18 | # No tarballs, pulled from svn | |
19 | # svn export http://v8.googlecode.com/svn/trunk/ v8 | |
20 | Source0: %{name}-%{snap}.tar.bz2 | |
ecf7d4a4 | 21 | # Source0-md5: 8ebfa445587a4a649c704d8a20d14ab4 |
ffa963bd | 22 | #Patch0: %{name}-d8-fwrite-return.patch |
5e90f260 | 23 | Patch1: %{name}-2.0.0-d8-allocation.patch |
ffa963bd | 24 | Patch2: %{name}-cstdio.patch |
25 | Patch3: %{name}-strndup.patch | |
26 | BuildRequires: gcc >= 4.0 | |
54ff92d3 | 27 | BuildRequires: libstdc++-devel |
7594b47f | 28 | BuildRequires: readline-devel |
b8bbb50f | 29 | BuildRequires: scons |
c894b44e | 30 | ExclusiveArch: %{ix86} %{x8664} arm |
b8bbb50f AM |
31 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
32 | ||
33 | %description | |
34 | V8 is Google's open source JavaScript engine. V8 is written in C++ and | |
35 | is used in Google Chrome, the open source browser from Google. V8 | |
36 | implements ECMAScript as specified in ECMA-262, 3rd edition. | |
37 | ||
37bf3af8 ER |
38 | This package contains the command line program. |
39 | ||
40 | %package libs | |
41 | Summary: V8 JavaScript Engine shared library | |
42 | Group: Libraries | |
43 | Conflicts: v8 < 2.0.0 | |
44 | ||
45 | %description libs | |
46 | V8 is Google's open source JavaScript engine. V8 is written in C++ and | |
47 | is used in Google Chrome, the open source browser from Google. V8 | |
48 | implements ECMAScript as specified in ECMA-262, 3rd edition. | |
49 | ||
50 | This package contains the shared library. | |
51 | ||
b8bbb50f AM |
52 | %package devel |
53 | Summary: Development headers and libraries for v8 | |
54 | Group: Development/Libraries | |
37bf3af8 | 55 | Requires: %{name}-libs = %{version}-%{release} |
b8bbb50f AM |
56 | |
57 | %description devel | |
58 | Development headers and libraries for v8. | |
59 | ||
60 | %prep | |
61 | %setup -q -n %{name} | |
ffa963bd | 62 | #%patch0 -p1 |
5e90f260 | 63 | %patch1 -p1 |
ffa963bd | 64 | %patch2 -p1 |
65 | %patch3 -p1 | |
7594b47f | 66 | %{__sed} -i -e "s,'-O3','%{rpmcxxflags}'.split(' ')," SConstruct |
b8bbb50f | 67 | |
5e90f260 ER |
68 | # create simple makefile |
69 | cat <<'EOF'> Makefile | |
ecf7d4a4 | 70 | V8_OBJS = obj/release/d8-debug.os obj/release/d8-posix.os obj/release/d8-readline.os obj/release/d8.os obj/release/d8-js.os obj/release/extensions/externalize-string-extension.os obj/release/extensions/gc-extension.os |
5e90f260 ER |
71 | V8_LIBS = -lpthread -lreadline -lpthread -L. -lv8 |
72 | ||
73 | v8: | |
74 | $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $(V8_OBJS) $(V8_LIBS) | |
75 | EOF | |
76 | ||
b8bbb50f | 77 | %build |
5e90f260 | 78 | # build library |
ffa963bd | 79 | |
80 | CFLAGS="%{rpmcflags}" | |
81 | CXXFLAGS="%{rpmcxxflags}" | |
82 | LDFLAGS="%{rpmcflags}" | |
83 | %if "%{pld_release}" == "ac" | |
84 | CC=%{__cc}4 | |
85 | CXX=%{__cxx}4 | |
86 | %else | |
87 | CC=%{__cc} | |
88 | CXX=%{__cxx} | |
89 | %endif | |
90 | export CFLAGS LDFLAGS CXXFLAGS CC CXX | |
b8bbb50f | 91 | %scons \ |
c894b44e ER |
92 | library=shared \ |
93 | snapshots=on \ | |
7594b47f ER |
94 | soname=off \ |
95 | console=readline \ | |
5e90f260 | 96 | visibility=default \ |
b8bbb50f | 97 | %ifarch x86_64 |
c894b44e | 98 | arch=x64 \ |
b8bbb50f | 99 | %endif |
c894b44e ER |
100 | env=CCFLAGS:"-fPIC" |
101 | ||
7594b47f ER |
102 | # the soname=on creates soname as libv8-1.3.11.1.so, that's wrong |
103 | rm libv8.so | |
b8bbb50f AM |
104 | # Now, lets make it right. |
105 | %ifarch arm | |
ecf7d4a4 | 106 | %{__cxx} %{rpmcflags} %{rpmldflags} -fPIC -o libv8.so.%{sover} -shared -Wl,-soname,libv8.so.%{somajor} obj/release/*.os obj/release/arm/*.os obj/release/extensions/*.os -lpthread |
b8bbb50f AM |
107 | %endif |
108 | %ifarch %{ix86} | |
ecf7d4a4 | 109 | %{__cxx} %{rpmcflags} %{rpmldflags} -fPIC -o libv8.so.%{sover} -shared -Wl,-soname,libv8.so.%{somajor} obj/release/*.os obj/release/ia32/*.os obj/release/extensions/*.os -lpthread |
b8bbb50f | 110 | %endif |
7594b47f | 111 | %ifarch %{x8664} |
ecf7d4a4 | 112 | %{__cxx} %{rpmcflags} %{rpmldflags} -fPIC -o libv8.so.%{sover} -shared -Wl,-soname,libv8.so.%{somajor} obj/release/*.os obj/release/x64/*.os obj/release/extensions/*.os -lpthread |
b8bbb50f AM |
113 | %endif |
114 | ||
5e90f260 ER |
115 | # We need to do this so d8 binary can link against it. |
116 | ln -sf libv8.so.%{sover} libv8.so | |
117 | ||
118 | # build binary | |
119 | %scons d8 \ | |
120 | library=shared \ | |
121 | snapshots=on \ | |
122 | console=readline \ | |
123 | visibility=default \ | |
124 | %ifarch x86_64 | |
125 | arch=x64 \ | |
126 | %endif | |
127 | env=CCFLAGS:"-fPIC" | |
128 | ||
129 | # Sigh. scons links all statically, relink | |
130 | mv d8 d8.static | |
131 | ||
132 | %{__make} v8 \ | |
133 | CXX="%{__cxx}" \ | |
134 | CXXFLAGS="%{rpmcxxflags}" \ | |
135 | LDFLAGS="%{rpmldflags}" | |
136 | ||
b8bbb50f AM |
137 | %install |
138 | rm -rf $RPM_BUILD_ROOT | |
5e90f260 ER |
139 | install -d $RPM_BUILD_ROOT{%{_bindir},%{_includedir},%{_libdir}} |
140 | install -p v8 $RPM_BUILD_ROOT%{_bindir} | |
c894b44e ER |
141 | cp -a include/*.h $RPM_BUILD_ROOT%{_includedir} |
142 | install -p libv8.so.*.*.* $RPM_BUILD_ROOT%{_libdir} | |
b8bbb50f | 143 | |
c894b44e ER |
144 | lib=$(basename $RPM_BUILD_ROOT%{_libdir}/libv8.so.*.*.*) |
145 | ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libv8.so | |
146 | ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libv8.so.0 | |
b8bbb50f AM |
147 | |
148 | %clean | |
149 | rm -rf $RPM_BUILD_ROOT | |
150 | ||
37bf3af8 ER |
151 | %post libs -p /sbin/ldconfig |
152 | %postun libs -p /sbin/ldconfig | |
b8bbb50f AM |
153 | |
154 | %files | |
155 | %defattr(644,root,root,755) | |
156 | %doc AUTHORS ChangeLog LICENSE | |
5e90f260 | 157 | %attr(755,root,root) %{_bindir}/v8 |
37bf3af8 ER |
158 | |
159 | %files libs | |
c894b44e ER |
160 | %attr(755,root,root) %{_libdir}/libv8.so.*.*.* |
161 | %attr(755,root,root) %ghost %{_libdir}/libv8.so.0 | |
b8bbb50f AM |
162 | |
163 | %files devel | |
164 | %defattr(644,root,root,755) | |
c894b44e | 165 | %attr(755,root,root) %{_libdir}/libv8.so |
b8bbb50f | 166 | %{_includedir}/*.h |