]> git.pld-linux.org Git - packages/v8.git/blame - v8.spec
- up to 3.1.5.0
[packages/v8.git] / v8.spec
CommitLineData
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
11Summary: JavaScript Engine
12Name: v8
ecf7d4a4 13Version: 3.1.5.0
c894b44e 14Release: 0.%{snap}.%{rel}
b8bbb50f
AM
15License: BSD
16Group: Libraries
17URL: http://code.google.com/p/v8
18# No tarballs, pulled from svn
19# svn export http://v8.googlecode.com/svn/trunk/ v8
20Source0: %{name}-%{snap}.tar.bz2
ecf7d4a4 21# Source0-md5: 8ebfa445587a4a649c704d8a20d14ab4
ffa963bd 22#Patch0: %{name}-d8-fwrite-return.patch
5e90f260 23Patch1: %{name}-2.0.0-d8-allocation.patch
ffa963bd 24Patch2: %{name}-cstdio.patch
25Patch3: %{name}-strndup.patch
26BuildRequires: gcc >= 4.0
54ff92d3 27BuildRequires: libstdc++-devel
7594b47f 28BuildRequires: readline-devel
b8bbb50f 29BuildRequires: scons
c894b44e 30ExclusiveArch: %{ix86} %{x8664} arm
b8bbb50f
AM
31BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32
33%description
34V8 is Google's open source JavaScript engine. V8 is written in C++ and
35is used in Google Chrome, the open source browser from Google. V8
36implements ECMAScript as specified in ECMA-262, 3rd edition.
37
37bf3af8
ER
38This package contains the command line program.
39
40%package libs
41Summary: V8 JavaScript Engine shared library
42Group: Libraries
43Conflicts: v8 < 2.0.0
44
45%description libs
46V8 is Google's open source JavaScript engine. V8 is written in C++ and
47is used in Google Chrome, the open source browser from Google. V8
48implements ECMAScript as specified in ECMA-262, 3rd edition.
49
50This package contains the shared library.
51
b8bbb50f
AM
52%package devel
53Summary: Development headers and libraries for v8
54Group: Development/Libraries
37bf3af8 55Requires: %{name}-libs = %{version}-%{release}
b8bbb50f
AM
56
57%description devel
58Development 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
69cat <<'EOF'> Makefile
ecf7d4a4 70V8_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
71V8_LIBS = -lpthread -lreadline -lpthread -L. -lv8
72
73v8:
74 $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $(V8_OBJS) $(V8_LIBS)
75EOF
76
b8bbb50f 77%build
5e90f260 78# build library
ffa963bd 79
80CFLAGS="%{rpmcflags}"
81CXXFLAGS="%{rpmcxxflags}"
82LDFLAGS="%{rpmcflags}"
83%if "%{pld_release}" == "ac"
84CC=%{__cc}4
85CXX=%{__cxx}4
86%else
87CC=%{__cc}
88CXX=%{__cxx}
89%endif
90export 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
103rm 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.
116ln -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
130mv d8 d8.static
131
132%{__make} v8 \
133 CXX="%{__cxx}" \
134 CXXFLAGS="%{rpmcxxflags}" \
135 LDFLAGS="%{rpmldflags}"
136
b8bbb50f
AM
137%install
138rm -rf $RPM_BUILD_ROOT
5e90f260
ER
139install -d $RPM_BUILD_ROOT{%{_bindir},%{_includedir},%{_libdir}}
140install -p v8 $RPM_BUILD_ROOT%{_bindir}
c894b44e
ER
141cp -a include/*.h $RPM_BUILD_ROOT%{_includedir}
142install -p libv8.so.*.*.* $RPM_BUILD_ROOT%{_libdir}
b8bbb50f 143
c894b44e
ER
144lib=$(basename $RPM_BUILD_ROOT%{_libdir}/libv8.so.*.*.*)
145ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libv8.so
146ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libv8.so.0
b8bbb50f
AM
147
148%clean
149rm -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
This page took 0.064372 seconds and 4 git commands to generate.