Browse Source

update to 3.10.8

git-svn-id: http://trac.vinelinux.org/repos/projects/specs@6992 ec354946-7b23-47d6-9f5a-488ba84defc7
daisuke 12 years ago
parent
commit
3ebd6124c7
1 changed files with 109 additions and 56 deletions
  1. 109 56
      v/v8/v8-vl.spec

+ 109 - 56
v/v8/v8-vl.spec

@@ -1,11 +1,11 @@
 %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
 
 %global somajor 3
-%global sominor 0
-%global sobuild 12
+%global sominor 10
+%global sobuild 8
 %global sover %{somajor}.%{sominor}.%{sobuild}
 
-%define svnrevision 6522
+#define svnrevision 6522
 
 Name:		v8
 Version:	%{sover}
@@ -18,13 +18,14 @@ License:	BSD
 URL:		http://code.google.com/p/v8
 Source0:	%{name}-%{version}%{?svnrevision:.svn%svnrevision}.tar.bz2
 Source10:	v8-snapshot.sh
-Patch0:         v8-2.5.9-buildfix.patch
+#Patch0:         v8-2.5.9-buildfix.patch
 
 BuildRoot:	%{_tmppath}/%{name}-%{version}-root
 ExclusiveArch:	%{ix86} x86_64 arm
 
 BuildRequires:	scons
 BuildRequires:	readline-devel
+#BuildRequires:  libicu-devel
 
 %description
 V8 is Google's open source JavaScript engine. V8 is written in C++ and is used 
@@ -50,88 +51,136 @@ Development headers, libraries and tools for v8.
 
 %prep
 %setup -q
-%patch0 -p0 -b .orig
+#%patch0 -p0 -b .orig
 
 # -fno-strict-aliasing is needed with gcc 4.4 to get past some ugly code
-PARSED_OPT_FLAGS=`echo \'$RPM_OPT_FLAGS \' | %__sed "s/ /',/g" | %__sed "s/',/', '/g"`
-%__sed -i "s|'-O3',|$PARSED_OPT_FLAGS '-fno-strict-aliasing',|g" SConstruct
-
-
+PARSED_OPT_FLAGS=`echo \'$RPM_OPT_FLAGS -fPIC -fno-strict-aliasing -Wno-unused-parameter -Wno-error=strict-overflow -Wno-unused-but-set-variable\'| \
+  sed "s/ /',/g" | \
+  sed "s/',/', '/g"`
+%__sed -i "s|'-O3',|$PARSED_OPT_FLAGS,|g" SConstruct
+
+# clear spurious executable bits
+find . \( -name \*.cc -o -name \*.h -o -name \*.py \) -a -executable \
+  |while read FILE ; do
+      echo $FILE
+      chmod -x $FILE
+  done
+	    
 %build
-%if %{?_dist_release} == "vl6"
 export GCC_VERSION="44"
-%endif
-scons library=shared snapshots=on %{_smp_mflags} \
+scons library=shared snapshots=on \
+    %{_smp_mflags} \
 %ifarch x86_64
     arch=x64 \
+%endif
+%ifarch armv7hl armv7hnl
+    armeabi=hard \
+%endif
+%ifarch armv5tel armv6l armv7l
+    armeabi=soft \
 %endif
     visibility=default \
     env=CCFLAGS:"-fPIC"
 
 # When will people learn to create versioned shared libraries by default?
-# first, lets get rid of the old .so
-%__rm -f libv8.so
+# first, lets get rid of the old .so file
+rm -rf libv8.so libv8preparser.so
 # Now, lets make it right.
-%__cxx $RPM_OPT_FLAGS -fPIC -o libv8.so.%{sover} -shared \
-    -Wl,-soname,libv8.so.%{somajor} \
-        obj/release/*.os \
-        obj/release/extensions/*.os \
-    %ifarch arm
-        obj/release/arm/*.os \
-    %endif
-    %ifarch %{ix86}
-        obj/release/ia32/*.os \
-    %endif
-    %ifarch x86_64
-        obj/release/x64/*.os \
-    %endif
-	;
+g++ $RPM_OPT_FLAGS -fPIC -o libv8preparser.so.%{sover} -shared -Wl,-soname,libv8preparser.so.%{somajor} \
+	obj/release/allocation.os \
+	obj/release/bignum.os \
+	obj/release/bignum-dtoa.os \
+	obj/release/cached-powers.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
+
+# "obj/release/preparser-api.os" should not be included in the libv8.so file.
+export RELEASE_BUILD_OBJS=`echo obj/release/*.os | sed 's|obj/release/preparser-api.os||g'`
+
+%ifarch %{arm}
+g++ $RPM_OPT_FLAGS -fPIC -o libv8.so.%{sover} -shared -Wl,-soname,libv8.so.%{somajor} $RELEASE_BUILD_OBJS obj/release/extensions/*.os obj/release/arm/*.os $ICU_LINK_FLAGS
+%endif
+%ifarch %{ix86}
+g++ $RPM_OPT_FLAGS -fPIC -o libv8.so.%{sover} -shared -Wl,-soname,libv8.so.%{somajor} $RELEASE_BUILD_OBJS obj/release/extensions/*.os obj/release/ia32/*.os $ICU_LINK_FLAGS
+%endif
+%ifarch x86_64
+g++ $RPM_OPT_FLAGS -fPIC -o libv8.so.%{sover} -shared -Wl,-soname,libv8.so.%{somajor} $RELEASE_BUILD_OBJS obj/release/extensions/*.os obj/release/x64/*.os $ICU_LINK_FLAGS
+%endif
+
 # We need to do this so d8 can link against it.
-%__ln_s -f libv8.so.%{sover} libv8.so
+ln -sf libv8.so.%{sover} libv8.so
+ln -sf libv8preparser.so.%{sover} libv8preparser.so
 
-scons d8 %{_smp_mflags} \
+# This will fail to link d8 because it doesn't use the icu libs.
+scons d8 \
 %ifarch x86_64
-    arch=x64 \
+arch=x64 \
 %endif
-    library=shared snapshots=on console=readline visibility=default
+%ifarch armv7hl armv7hnl
+armeabi=hard \
+%endif
+%ifarch armv5tel armv6l armv7l
+armeabi=soft \
+%endif
+library=shared snapshots=on console=readline visibility=default || :
 
 # Ahem
 %__rm -f d8
 
-%__cxx $RPM_OPT_FLAGS -o d8 obj/release/d8-debug.os obj/release/d8-posix.os obj/release/d8-readline.os obj/release/d8.os obj/release/d8-js.os -lpthread -lreadline -lpthread -L. -lv8
+g++ $RPM_OPT_FLAGS -o d8 obj/release/d8.os -lreadline -lpthread -L. -lv8 $ICU_LINK_FLAGS
 
 
 %install
-%__rm -rf %{buildroot}
-
-[ -f libv8.so ] && [ ! -f libv8.so.%{sover} ] && %__mv libv8.so libv8.so.%{sover}
-%__mkdir_p %{buildroot}%{_includedir}
-%__mkdir_p %{buildroot}%{_libdir}
-%__install -p include/*.h %{buildroot}%{_includedir}
-%__install -p libv8.so.%{sover} %{buildroot}%{_libdir}
-%__mkdir_p %{buildroot}%{_bindir}
-%__install -p -m0755 d8 %{buildroot}%{_bindir}
-
-%__install -d %{buildroot}%{python_sitelib}
-%__install -pm644 tools/js2c.py %{buildroot}%{python_sitelib}
-%__install -pm644 tools/jsmin.py %{buildroot}%{python_sitelib}
+rm -rf %{buildroot}
+mkdir -p %{buildroot}%{_includedir}
+mkdir -p %{buildroot}%{_libdir}
+install -p include/*.h %{buildroot}%{_includedir}
+install -p libv8.so.%{sover} %{buildroot}%{_libdir}
+install -p libv8preparser.so.%{sover} %{buildroot}%{_libdir}
+mkdir -p %{buildroot}%{_bindir}
+install -p -m0755 d8 %{buildroot}%{_bindir}
+
+pushd %{buildroot}%{_libdir}
+ln -sf libv8.so.%{sover} libv8.so
+ln -sf libv8.so.%{sover} libv8.so.%{somajor}
+ln -sf libv8.so.%{sover} libv8.so.%{somajor}.%{sominor}
+ln -sf libv8preparser.so.%{sover} libv8preparser.so
+ln -sf libv8preparser.so.%{sover} libv8preparser.so.%{somajor}
+ln -sf libv8preparser.so.%{sover} libv8preparser.so.%{somajor}.%{sominor}
+popd
+
+chmod -x %{buildroot}%{_includedir}/v8*.h
+
+mkdir -p %{buildroot}%{_includedir}/v8/extensions/
+install -p src/extensions/*.h %{buildroot}%{_includedir}/v8/extensions/
+
+chmod -x %{buildroot}%{_includedir}/v8/extensions/*.h
+
+# install Python JS minifier scripts for nodejs
+install -d %{buildroot}%{python_sitelib}
+sed -i 's|/usr/bin/python2.4|/usr/bin/env python|g' tools/jsmin.py
+sed -i 's|/usr/bin/python2.4|/usr/bin/env python|g' tools/js2c.py
+install -p -m0744 tools/jsmin.py %{buildroot}%{python_sitelib}/
+install -p -m0744 tools/js2c.py %{buildroot}%{python_sitelib}/
+chmod -R -x %{buildroot}%{python_sitelib}/*.py*
 
-cd %{buildroot}%{_libdir}
-%__ln_s -f libv8.so.%{sover} libv8.so
-%__ln_s -f libv8.so.%{sover} libv8.so.%{somajor}
-%__ln_s -f libv8.so.%{sover} libv8.so.%{somajor}.%{sominor}
-
-%__chmod -x %{buildroot}%{_includedir}/v8*.h
-
-
-# %check
-# tools/test.py --no-build -p dots --shell d8
 
 %clean
 %__rm -rf %{buildroot}
 
 
 %post -p /sbin/ldconfig
+
 %postun -p /sbin/ldconfig
 
 
@@ -145,11 +194,15 @@ cd %{buildroot}%{_libdir}
 %files devel
 %defattr(-,root,root,-)
 %{_includedir}/*.h
+%{_includedir}/v8/extensions/
 %{_libdir}/*.so
 %{python_sitelib}/*.py*
 
 
 %changelog
+* Wed Oct 24 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 3.10.8-1
+- update to 3.10.8
+
 * Sat Jan 29 2011 Munehiro Yamamoto <munepi@vinelinux.org> - 3.0.12-1.svn6522
 - source 3.0.12 rev.6387