v8-vl.spec 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
  2. %global somajor 3
  3. %global sominor 0
  4. %global sobuild 12
  5. %global sover %{somajor}.%{sominor}.%{sobuild}
  6. %define svnrevision 6522
  7. Name: v8
  8. Version: %{sover}
  9. Release: 1%{?svnrevision:.svn%svnrevision}%{?_dist_release}
  10. Provides: lib%{name} = %{version}-%{release}
  11. Summary: JavaScript Engine
  12. Summary(ja): JavaScript エンジン
  13. Group: System Environment/Libraries
  14. License: BSD
  15. URL: http://code.google.com/p/v8
  16. Source0: %{name}-%{version}%{?svnrevision:.svn%svnrevision}.tar.bz2
  17. Source10: v8-snapshot.sh
  18. Patch0: v8-2.5.9-buildfix.patch
  19. BuildRoot: %{_tmppath}/%{name}-%{version}-root
  20. ExclusiveArch: %{ix86} x86_64 arm
  21. BuildRequires: scons
  22. BuildRequires: readline-devel
  23. %description
  24. V8 is Google's open source JavaScript engine. V8 is written in C++ and is used
  25. in Google Chrome, the open source browser from Google. V8 implements ECMAScript
  26. as specified in ECMA-262, 3rd edition.
  27. #'
  28. %description -l ja
  29. V8 は Google のオープンソース JavaScript エンジンです。
  30. V8 で C++ 書かれており、Google 発のオープンソースブラウザである
  31. Google Chrome で使われています。
  32. V8 は ECMA-262 第 3 版で指定されている ECMAScript を満たしています。
  33. %package devel
  34. Group: Development/Libraries
  35. Summary: Development headers and libraries for v8
  36. Requires: %{name} = %{version}-%{release}
  37. Provides: lib%{name}-devel = %{version}-%{release}
  38. %description devel
  39. Development headers, libraries and tools for v8.
  40. %prep
  41. %setup -q
  42. %patch0 -p0 -b .orig
  43. # -fno-strict-aliasing is needed with gcc 4.4 to get past some ugly code
  44. PARSED_OPT_FLAGS=`echo \'$RPM_OPT_FLAGS \' | %__sed "s/ /',/g" | %__sed "s/',/', '/g"`
  45. %__sed -i "s|'-O3',|$PARSED_OPT_FLAGS '-fno-strict-aliasing',|g" SConstruct
  46. %build
  47. %if %{?_dist_release} == "vl6"
  48. export GCC_VERSION="44"
  49. %endif
  50. scons library=shared snapshots=on %{_smp_mflags} \
  51. %ifarch x86_64
  52. arch=x64 \
  53. %endif
  54. visibility=default \
  55. env=CCFLAGS:"-fPIC"
  56. # When will people learn to create versioned shared libraries by default?
  57. # first, lets get rid of the old .so
  58. %__rm -f libv8.so
  59. # Now, lets make it right.
  60. %__cxx $RPM_OPT_FLAGS -fPIC -o libv8.so.%{sover} -shared \
  61. -Wl,-soname,libv8.so.%{somajor} \
  62. obj/release/*.os \
  63. obj/release/extensions/*.os \
  64. %ifarch arm
  65. obj/release/arm/*.os \
  66. %endif
  67. %ifarch %{ix86}
  68. obj/release/ia32/*.os \
  69. %endif
  70. %ifarch x86_64
  71. obj/release/x64/*.os \
  72. %endif
  73. ;
  74. # We need to do this so d8 can link against it.
  75. %__ln_s -f libv8.so.%{sover} libv8.so
  76. scons d8 %{_smp_mflags} \
  77. %ifarch x86_64
  78. arch=x64 \
  79. %endif
  80. library=shared snapshots=on console=readline visibility=default
  81. # Ahem
  82. %__rm -f d8
  83. %__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
  84. %install
  85. %__rm -rf %{buildroot}
  86. [ -f libv8.so ] && [ ! -f libv8.so.%{sover} ] && %__mv libv8.so libv8.so.%{sover}
  87. %__mkdir_p %{buildroot}%{_includedir}
  88. %__mkdir_p %{buildroot}%{_libdir}
  89. %__install -p include/*.h %{buildroot}%{_includedir}
  90. %__install -p libv8.so.%{sover} %{buildroot}%{_libdir}
  91. %__mkdir_p %{buildroot}%{_bindir}
  92. %__install -p -m0755 d8 %{buildroot}%{_bindir}
  93. %__install -d %{buildroot}%{python_sitelib}
  94. %__install -pm644 tools/js2c.py %{buildroot}%{python_sitelib}
  95. %__install -pm644 tools/jsmin.py %{buildroot}%{python_sitelib}
  96. cd %{buildroot}%{_libdir}
  97. %__ln_s -f libv8.so.%{sover} libv8.so
  98. %__ln_s -f libv8.so.%{sover} libv8.so.%{somajor}
  99. %__ln_s -f libv8.so.%{sover} libv8.so.%{somajor}.%{sominor}
  100. %__chmod -x %{buildroot}%{_includedir}/v8*.h
  101. # %check
  102. # tools/test.py --no-build -p dots --shell d8
  103. %clean
  104. %__rm -rf %{buildroot}
  105. %post -p /sbin/ldconfig
  106. %postun -p /sbin/ldconfig
  107. %files
  108. %defattr(-,root,root,-)
  109. %doc AUTHORS ChangeLog LICENSE
  110. %{_bindir}/d8
  111. %{_libdir}/*.so.*
  112. %files devel
  113. %defattr(-,root,root,-)
  114. %{_includedir}/*.h
  115. %{_libdir}/*.so
  116. %{python_sitelib}/*.py*
  117. %changelog
  118. * Sat Jan 29 2011 Munehiro Yamamoto <munepi@vinelinux.org> - 3.0.12-1.svn6522
  119. - source 3.0.12 rev.6387
  120. * Sat Jan 22 2011 Munehiro Yamamoto <munepi@vinelinux.org> - 3.0.9-1.svn6387
  121. - source 3.0.9 rev.6387
  122. * Thu Dec 23 2010 Munehiro Yamamoto <munepi@vinelinux.org> - 3.0.4-1.svn6102
  123. - source 3.0.4 rev.6102
  124. * Sat Dec 11 2010 Munehiro Yamamoto <munepi@vinelinux.org> - 3.0.0-1.svn5932
  125. - source 3.0.0 rev.5932
  126. * Sat Dec 04 2010 Munehiro Yamamoto <munepi@vinelinux.org> - 2.5.9-1.svn5896
  127. - source 2.5.9 rev.5896
  128. * Fri Nov 26 2010 Munehiro Yamamoto <munepi@vinelinux.org> - 2.5.8-1.svn5891
  129. - source 2.5.8 rev.5891
  130. * Thu Nov 11 2010 Munehiro Yamamoto <munepi@vinelinux.org> - 2.5.6-1.svn5808
  131. - source 2.5.6 rev.5808
  132. * Sun Oct 31 2010 Munehiro Yamamoto <munepi@vinelinux.org> - 2.5.2-1.svn5743
  133. - source 2.5.2 rev.5743
  134. * Sat Oct 16 2010 Munehiro Yamamoto <munepi@vinelinux.org> - 2.4.9-1.svn5631
  135. - source 2.4.9 rev.5631
  136. * Sun Oct 10 2010 Munehiro Yamamoto <munepi@vinelinux.org> - 2.4.8-1
  137. - initial build
  138. * Sat Sep 18 2010 Lubomir Rintel <lkundrak@v3.sk> - 2.4.4-1
  139. - Newer version
  140. - Package based on 2.3.11-1.20100831svn5385 by Tom "spot" Callaway
  141. * Wed Sep 15 2010 Lubomir Rintel <lkundrak@v3.sk> - 2.3.8-2
  142. - Package based on 2.3.11-1.20100831svn5385 by Tom "spot" Callaway