]> git.pld-linux.org Git - packages/v8.git/commitdiff
- up to 2.0.0 (20091118svn3334)
authorElan Ruusamäe <glen@pld-linux.org>
Wed, 2 Dec 2009 07:08:04 +0000 (07:08 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    v8-2.0.0-d8-allocation.patch -> 1.1
    v8-d8-fwrite-return.patch -> 1.1
    v8.spec -> 1.6

v8-2.0.0-d8-allocation.patch [new file with mode: 0644]
v8-d8-fwrite-return.patch [new file with mode: 0644]
v8.spec

diff --git a/v8-2.0.0-d8-allocation.patch b/v8-2.0.0-d8-allocation.patch
new file mode 100644 (file)
index 0000000..62af3ba
--- /dev/null
@@ -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));
diff --git a/v8-d8-fwrite-return.patch b/v8-d8-fwrite-return.patch
new file mode 100644 (file)
index 0000000..c789798
--- /dev/null
@@ -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();
+ }
diff --git a/v8.spec b/v8.spec
index 1058a3b0655a0ba81f48a409725f6eac019d5674..f12592ec9548075387a92c3d08d3e06a377f6d7b 100644 (file)
--- a/v8.spec
+++ b/v8.spec
@@ -1,11 +1,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
@@ -13,9 +21,9 @@ URL:          http://code.google.com/p/v8
 # 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
@@ -37,16 +45,27 @@ Development headers and libraries for v8.
 
 %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
@@ -56,18 +75,41 @@ Development headers and libraries for v8.
 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}
 
@@ -84,6 +126,7 @@ rm -rf $RPM_BUILD_ROOT
 %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
 
This page took 0.104551 seconds and 4 git commands to generate.