]> git.pld-linux.org Git - packages/v8.git/blame - v8.spec
- libs split; rel 1
[packages/v8.git] / v8.spec
CommitLineData
c8c14515 1# TODO
7594b47f
ER
2# - cxx is not passed to build
3# - cleaner way for cxxflags
5e90f260
ER
4
5# For the 1.2 branch, we use 0s here
6# For 1.3+, we use the three digit versions
7%define somajor 2
8%define sominor 0
9%define sobuild 0
10%define sover %{somajor}.%{sominor}.%{sobuild}
11
12%define snap 20091118svn3334
37bf3af8 13%define rel 1
b8bbb50f
AM
14Summary: JavaScript Engine
15Name: v8
5e90f260 16Version: 2.0.0
c894b44e 17Release: 0.%{snap}.%{rel}
b8bbb50f
AM
18License: BSD
19Group: Libraries
20URL: http://code.google.com/p/v8
21# No tarballs, pulled from svn
22# svn export http://v8.googlecode.com/svn/trunk/ v8
23Source0: %{name}-%{snap}.tar.bz2
5e90f260
ER
24# Source0-md5: 014dd59b50b7859f3845b535ebd06ad2
25Patch0: %{name}-d8-fwrite-return.patch
26Patch1: %{name}-2.0.0-d8-allocation.patch
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}
5e90f260
ER
62%patch0 -p1
63%patch1 -p1
7594b47f 64%{__sed} -i -e "s,'-O3','%{rpmcxxflags}'.split(' ')," SConstruct
b8bbb50f 65
5e90f260
ER
66# create simple makefile
67cat <<'EOF'> Makefile
68V8_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
69V8_LIBS = -lpthread -lreadline -lpthread -L. -lv8
70
71v8:
72 $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $(V8_OBJS) $(V8_LIBS)
73EOF
74
b8bbb50f 75%build
5e90f260 76# build library
b8bbb50f 77%scons \
c894b44e
ER
78 library=shared \
79 snapshots=on \
7594b47f
ER
80 soname=off \
81 console=readline \
5e90f260 82 visibility=default \
b8bbb50f 83%ifarch x86_64
c894b44e 84 arch=x64 \
b8bbb50f 85%endif
c894b44e
ER
86 env=CCFLAGS:"-fPIC"
87
7594b47f
ER
88# the soname=on creates soname as libv8-1.3.11.1.so, that's wrong
89rm libv8.so
b8bbb50f
AM
90# Now, lets make it right.
91%ifarch arm
5e90f260 92%{__cxx} %{rpmcflags} %{rpmldflags} -fPIC -o libv8.so.%{sover} -shared -Wl,-soname,libv8.so.%{somajor} obj/release/*.os obj/release/arm/*.os -lpthread
b8bbb50f
AM
93%endif
94%ifarch %{ix86}
5e90f260 95%{__cxx} %{rpmcflags} %{rpmldflags} -fPIC -o libv8.so.%{sover} -shared -Wl,-soname,libv8.so.%{somajor} obj/release/*.os obj/release/ia32/*.os -lpthread
b8bbb50f 96%endif
7594b47f 97%ifarch %{x8664}
5e90f260 98%{__cxx} %{rpmcflags} %{rpmldflags} -fPIC -o libv8.so.%{sover} -shared -Wl,-soname,libv8.so.%{somajor} obj/release/*.os obj/release/x64/*.os -lpthread
b8bbb50f
AM
99%endif
100
5e90f260
ER
101# We need to do this so d8 binary can link against it.
102ln -sf libv8.so.%{sover} libv8.so
103
104# build binary
105%scons d8 \
106 library=shared \
107 snapshots=on \
108 console=readline \
109 visibility=default \
110 %ifarch x86_64
111 arch=x64 \
112 %endif
113 env=CCFLAGS:"-fPIC"
114
115# Sigh. scons links all statically, relink
116mv d8 d8.static
117
118%{__make} v8 \
119 CXX="%{__cxx}" \
120 CXXFLAGS="%{rpmcxxflags}" \
121 LDFLAGS="%{rpmldflags}"
122
b8bbb50f
AM
123%install
124rm -rf $RPM_BUILD_ROOT
5e90f260
ER
125install -d $RPM_BUILD_ROOT{%{_bindir},%{_includedir},%{_libdir}}
126install -p v8 $RPM_BUILD_ROOT%{_bindir}
c894b44e
ER
127cp -a include/*.h $RPM_BUILD_ROOT%{_includedir}
128install -p libv8.so.*.*.* $RPM_BUILD_ROOT%{_libdir}
b8bbb50f 129
c894b44e
ER
130lib=$(basename $RPM_BUILD_ROOT%{_libdir}/libv8.so.*.*.*)
131ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libv8.so
132ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libv8.so.0
b8bbb50f
AM
133
134%clean
135rm -rf $RPM_BUILD_ROOT
136
37bf3af8
ER
137%post libs -p /sbin/ldconfig
138%postun libs -p /sbin/ldconfig
b8bbb50f
AM
139
140%files
141%defattr(644,root,root,755)
142%doc AUTHORS ChangeLog LICENSE
5e90f260 143%attr(755,root,root) %{_bindir}/v8
37bf3af8
ER
144
145%files libs
c894b44e
ER
146%attr(755,root,root) %{_libdir}/libv8.so.*.*.*
147%attr(755,root,root) %ghost %{_libdir}/libv8.so.0
b8bbb50f
AM
148
149%files devel
150%defattr(644,root,root,755)
c894b44e 151%attr(755,root,root) %{_libdir}/libv8.so
b8bbb50f 152%{_includedir}/*.h
This page took 0.079853 seconds and 4 git commands to generate.