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