packages: v8/v8.spec, v8/v8-2.0.0-d8-allocation.patch (NEW), v8/v8-d8-fwrit...

glen glen at pld-linux.org
Wed Dec 2 08:08:10 CET 2009


Author: glen                         Date: Wed Dec  2 07:08:10 2009 GMT
Module: packages                      Tag: HEAD
---- Log message:
- up to 2.0.0 (20091118svn3334)

---- Files affected:
packages/v8:
   v8.spec (1.5 -> 1.6) , v8-2.0.0-d8-allocation.patch (NONE -> 1.1)  (NEW), v8-d8-fwrite-return.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/v8/v8.spec
diff -u packages/v8/v8.spec:1.5 packages/v8/v8.spec:1.6
--- packages/v8/v8.spec:1.5	Sun Nov 15 01:33:09 2009
+++ packages/v8/v8.spec	Wed Dec  2 08:08:04 2009
@@ -2,11 +2,19 @@
 # TODO
 # - cxx is not passed to build
 # - cleaner way for cxxflags
-%define		snap	20090918
-%define		rel		1
+
+# For the 1.2 branch, we use 0s here
+# For 1.3+, we use the three digit versions
+%define		somajor 2
+%define		sominor 0
+%define		sobuild 0
+%define		sover %{somajor}.%{sominor}.%{sobuild}
+
+%define		snap	20091118svn3334
+%define		rel		0.1
 Summary:	JavaScript Engine
 Name:		v8
-Version:	1.2.13
+Version:	2.0.0
 Release:	0.%{snap}.%{rel}
 License:	BSD
 Group:		Libraries
@@ -14,9 +22,9 @@
 # No tarballs, pulled from svn
 # svn export http://v8.googlecode.com/svn/trunk/ v8
 Source0:	%{name}-%{snap}.tar.bz2
-# Source0-md5:	736a6a7a21aa8a2834a583763d37a7af
-#Patch0:	%{name}-svn2430-unused-parameter.patch
-#Patch1:	http://codereview.chromium.org/download/issue115176_4_1002.diff
+# Source0-md5:	014dd59b50b7859f3845b535ebd06ad2
+Patch0:		%{name}-d8-fwrite-return.patch
+Patch1:		%{name}-2.0.0-d8-allocation.patch
 BuildRequires:	libstdc++-devel
 BuildRequires:	readline-devel
 BuildRequires:	scons
@@ -38,16 +46,27 @@
 
 %prep
 %setup -q -n %{name}
-#%patch0 -p1
-#%patch1 -p0
+%patch0 -p1
+%patch1 -p1
 %{__sed} -i -e "s,'-O3','%{rpmcxxflags}'.split(' ')," SConstruct
 
+# create simple makefile
+cat <<'EOF'> Makefile
+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
+V8_LIBS = -lpthread -lreadline -lpthread -L. -lv8
+
+v8:
+	$(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $(V8_OBJS) $(V8_LIBS)
+EOF
+
 %build
+# build library
 %scons \
 	library=shared \
 	snapshots=on \
 	soname=off \
 	console=readline \
+	visibility=default \
 %ifarch x86_64
 	arch=x64 \
 %endif
@@ -57,18 +76,41 @@
 rm libv8.so
 # Now, lets make it right.
 %ifarch arm
-%{__cxx} %{rpmcflags} %{rpmldflags} -fPIC -o libv8.so.0.0.0 -shared -Wl,-soname,libv8.so.0 obj/release/*.os obj/release/arm/*.os
+%{__cxx} %{rpmcflags} %{rpmldflags} -fPIC -o libv8.so.%{sover} -shared -Wl,-soname,libv8.so.%{somajor} obj/release/*.os obj/release/arm/*.os -lpthread
 %endif
 %ifarch %{ix86}
-%{__cxx} %{rpmcflags} %{rpmldflags} -fPIC -o libv8.so.0.0.0 -shared -Wl,-soname,libv8.so.0 obj/release/*.os obj/release/ia32/*.os
+%{__cxx} %{rpmcflags} %{rpmldflags} -fPIC -o libv8.so.%{sover} -shared -Wl,-soname,libv8.so.%{somajor} obj/release/*.os obj/release/ia32/*.os -lpthread
 %endif
 %ifarch %{x8664}
-%{__cxx} %{rpmcflags} %{rpmldflags} -fPIC -o libv8.so.0.0.0 -shared -Wl,-soname,libv8.so.0 obj/release/*.os obj/release/x64/*.os
+%{__cxx} %{rpmcflags} %{rpmldflags} -fPIC -o libv8.so.%{sover} -shared -Wl,-soname,libv8.so.%{somajor} obj/release/*.os obj/release/x64/*.os -lpthread
 %endif
 
+# We need to do this so d8 binary can link against it.
+ln -sf libv8.so.%{sover} libv8.so
+
+# build binary
+%scons d8 \
+	library=shared \
+	snapshots=on \
+	console=readline \
+	visibility=default \
+	%ifarch x86_64
+	arch=x64 \
+	%endif
+	env=CCFLAGS:"-fPIC"
+
+# Sigh. scons links all statically, relink
+mv d8 d8.static
+
+%{__make} v8 \
+	CXX="%{__cxx}" \
+	CXXFLAGS="%{rpmcxxflags}" \
+	LDFLAGS="%{rpmldflags}"
+
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{_includedir},%{_libdir}}
+install -d $RPM_BUILD_ROOT{%{_bindir},%{_includedir},%{_libdir}}
+install -p v8 $RPM_BUILD_ROOT%{_bindir}
 cp -a include/*.h $RPM_BUILD_ROOT%{_includedir}
 install -p libv8.so.*.*.* $RPM_BUILD_ROOT%{_libdir}
 
@@ -85,6 +127,7 @@
 %files
 %defattr(644,root,root,755)
 %doc AUTHORS ChangeLog LICENSE
+%attr(755,root,root) %{_bindir}/v8
 %attr(755,root,root) %{_libdir}/libv8.so.*.*.*
 %attr(755,root,root) %ghost %{_libdir}/libv8.so.0
 
@@ -99,6 +142,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.6  2009/12/02 07:08:04  glen
+- up to 2.0.0 (20091118svn3334)
+
 Revision 1.5  2009/11/15 00:33:09  zbyniu
 - BR: libstdc++-devel
 

================================================================
Index: packages/v8/v8-2.0.0-d8-allocation.patch
diff -u /dev/null packages/v8/v8-2.0.0-d8-allocation.patch:1.1
--- /dev/null	Wed Dec  2 08:08:10 2009
+++ packages/v8/v8-2.0.0-d8-allocation.patch	Wed Dec  2 08:08:04 2009
@@ -0,0 +1,34 @@
+diff -up v8/src/allocation.cc.allocation v8/src/allocation.cc
+--- v8/src/allocation.cc.allocation	2009-11-18 22:37:12.000000000 -0500
++++ v8/src/allocation.cc	2009-11-18 22:38:33.000000000 -0500
+@@ -88,8 +88,8 @@ char* StrDup(const char* str) {
+ }
+ 
+ 
+-char* StrNDup(const char* str, int n) {
+-  int length = StrLength(str);
++char* StrNDup(const char* str, size_t n) {
++  size_t length = StrLength(str);
+   if (n < length) length = n;
+   char* result = NewArray<char>(length + 1);
+   memcpy(result, str, length * kCharSize);
+diff -up v8/src/d8-readline.cc.allocation v8/src/d8-readline.cc
+--- v8/src/d8-readline.cc.allocation	2009-11-18 15:09:01.000000000 -0500
++++ v8/src/d8-readline.cc	2009-11-18 22:37:58.000000000 -0500
+@@ -32,6 +32,7 @@
+ 
+ 
+ #include "d8.h"
++#include "allocation.h"
+ 
+ 
+ // There are incompatibilities between different versions and different
+@@ -103,7 +104,7 @@ char* ReadLineEditor::CompletionGenerato
+   static unsigned current_index;
+   static Persistent<Array> current_completions;
+   if (state == 0) {
+-    i::SmartPointer<char> full_text(i::StrNDup(rl_line_buffer, rl_point));
++    i::SmartPointer<char> full_text(i::StrNDup(rl_line_buffer, (size_t) rl_point));
+     HandleScope scope;
+     Handle<Array> completions =
+       Shell::GetCompletions(String::New(text), String::New(*full_text));

================================================================
Index: packages/v8/v8-d8-fwrite-return.patch
diff -u /dev/null packages/v8/v8-d8-fwrite-return.patch:1.1
--- /dev/null	Wed Dec  2 08:08:10 2009
+++ packages/v8/v8-d8-fwrite-return.patch	Wed Dec  2 08:08:04 2009
@@ -0,0 +1,13 @@
+diff -up v8/src/d8.cc.BAD v8/src/d8.cc
+--- v8/src/d8.cc.BAD	2009-09-16 12:14:52.000000000 -0400
++++ v8/src/d8.cc	2009-09-16 12:17:42.000000000 -0400
+@@ -159,7 +159,8 @@ Handle<Value> Shell::Write(const Argumen
+       printf(" ");
+     }
+     v8::String::Utf8Value str(args[i]);
+-    fwrite(*str, sizeof(**str), str.length(), stdout);
++    int n = fwrite(*str, sizeof(**str), str.length(), stdout);
++    if (n != 1) printf("fwrite to stdout failed!\n");
+   }
+   return Undefined();
+ }
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/v8/v8.spec?r1=1.5&r2=1.6&f=u



More information about the pld-cvs-commit mailing list