v8-vl.spec 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  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 10
  4. %global sobuild 8
  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. #BuildRequires: libicu-devel
  24. %description
  25. V8 is Google's open source JavaScript engine. V8 is written in C++ and is used
  26. in Google Chrome, the open source browser from Google. V8 implements ECMAScript
  27. as specified in ECMA-262, 3rd edition.
  28. #'
  29. %description -l ja
  30. V8 は Google のオープンソース JavaScript エンジンです。
  31. V8 で C++ 書かれており、Google 発のオープンソースブラウザである
  32. Google Chrome で使われています。
  33. V8 は ECMA-262 第 3 版で指定されている ECMAScript を満たしています。
  34. %package devel
  35. Group: Development/Libraries
  36. Summary: Development headers and libraries for v8
  37. Requires: %{name} = %{version}-%{release}
  38. Provides: lib%{name}-devel = %{version}-%{release}
  39. %description devel
  40. Development headers, libraries and tools for v8.
  41. %prep
  42. %setup -q
  43. #%patch0 -p0 -b .orig
  44. # -fno-strict-aliasing is needed with gcc 4.4 to get past some ugly code
  45. PARSED_OPT_FLAGS=`echo \'$RPM_OPT_FLAGS -fPIC -fno-strict-aliasing -Wno-unused-parameter -Wno-error=strict-overflow -Wno-unused-but-set-variable\'| \
  46. sed "s/ /',/g" | \
  47. sed "s/',/', '/g"`
  48. %__sed -i "s|'-O3',|$PARSED_OPT_FLAGS,|g" SConstruct
  49. # clear spurious executable bits
  50. find . \( -name \*.cc -o -name \*.h -o -name \*.py \) -a -executable \
  51. |while read FILE ; do
  52. echo $FILE
  53. chmod -x $FILE
  54. done
  55. %build
  56. export GCC_VERSION="44"
  57. scons library=shared snapshots=on \
  58. %{_smp_mflags} \
  59. %ifarch x86_64
  60. arch=x64 \
  61. %endif
  62. %ifarch armv7hl armv7hnl
  63. armeabi=hard \
  64. %endif
  65. %ifarch armv5tel armv6l armv7l
  66. armeabi=soft \
  67. %endif
  68. visibility=default \
  69. env=CCFLAGS:"-fPIC"
  70. # When will people learn to create versioned shared libraries by default?
  71. # first, lets get rid of the old .so file
  72. rm -rf libv8.so libv8preparser.so
  73. # Now, lets make it right.
  74. g++ $RPM_OPT_FLAGS -fPIC -o libv8preparser.so.%{sover} -shared -Wl,-soname,libv8preparser.so.%{somajor} \
  75. obj/release/allocation.os \
  76. obj/release/bignum.os \
  77. obj/release/bignum-dtoa.os \
  78. obj/release/cached-powers.os \
  79. obj/release/diy-fp.os \
  80. obj/release/dtoa.os \
  81. obj/release/fast-dtoa.os \
  82. obj/release/fixed-dtoa.os \
  83. obj/release/preparse-data.os \
  84. obj/release/preparser-api.os \
  85. obj/release/preparser.os \
  86. obj/release/scanner.os \
  87. obj/release/strtod.os \
  88. obj/release/token.os \
  89. obj/release/unicode.os \
  90. obj/release/utils.os
  91. # "obj/release/preparser-api.os" should not be included in the libv8.so file.
  92. export RELEASE_BUILD_OBJS=`echo obj/release/*.os | sed 's|obj/release/preparser-api.os||g'`
  93. %ifarch %{arm}
  94. 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
  95. %endif
  96. %ifarch %{ix86}
  97. 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
  98. %endif
  99. %ifarch x86_64
  100. 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
  101. %endif
  102. # We need to do this so d8 can link against it.
  103. ln -sf libv8.so.%{sover} libv8.so
  104. ln -sf libv8preparser.so.%{sover} libv8preparser.so
  105. # This will fail to link d8 because it doesn't use the icu libs.
  106. scons d8 \
  107. %ifarch x86_64
  108. arch=x64 \
  109. %endif
  110. %ifarch armv7hl armv7hnl
  111. armeabi=hard \
  112. %endif
  113. %ifarch armv5tel armv6l armv7l
  114. armeabi=soft \
  115. %endif
  116. library=shared snapshots=on console=readline visibility=default || :
  117. # Ahem
  118. %__rm -f d8
  119. g++ $RPM_OPT_FLAGS -o d8 obj/release/d8.os -lreadline -lpthread -L. -lv8 $ICU_LINK_FLAGS
  120. %install
  121. rm -rf %{buildroot}
  122. mkdir -p %{buildroot}%{_includedir}
  123. mkdir -p %{buildroot}%{_libdir}
  124. install -p include/*.h %{buildroot}%{_includedir}
  125. install -p libv8.so.%{sover} %{buildroot}%{_libdir}
  126. install -p libv8preparser.so.%{sover} %{buildroot}%{_libdir}
  127. mkdir -p %{buildroot}%{_bindir}
  128. install -p -m0755 d8 %{buildroot}%{_bindir}
  129. pushd %{buildroot}%{_libdir}
  130. ln -sf libv8.so.%{sover} libv8.so
  131. ln -sf libv8.so.%{sover} libv8.so.%{somajor}
  132. ln -sf libv8.so.%{sover} libv8.so.%{somajor}.%{sominor}
  133. ln -sf libv8preparser.so.%{sover} libv8preparser.so
  134. ln -sf libv8preparser.so.%{sover} libv8preparser.so.%{somajor}
  135. ln -sf libv8preparser.so.%{sover} libv8preparser.so.%{somajor}.%{sominor}
  136. popd
  137. chmod -x %{buildroot}%{_includedir}/v8*.h
  138. mkdir -p %{buildroot}%{_includedir}/v8/extensions/
  139. install -p src/extensions/*.h %{buildroot}%{_includedir}/v8/extensions/
  140. chmod -x %{buildroot}%{_includedir}/v8/extensions/*.h
  141. # install Python JS minifier scripts for nodejs
  142. install -d %{buildroot}%{python_sitelib}
  143. sed -i 's|/usr/bin/python2.4|/usr/bin/env python|g' tools/jsmin.py
  144. sed -i 's|/usr/bin/python2.4|/usr/bin/env python|g' tools/js2c.py
  145. install -p -m0744 tools/jsmin.py %{buildroot}%{python_sitelib}/
  146. install -p -m0744 tools/js2c.py %{buildroot}%{python_sitelib}/
  147. chmod -R -x %{buildroot}%{python_sitelib}/*.py*
  148. %clean
  149. %__rm -rf %{buildroot}
  150. %post -p /sbin/ldconfig
  151. %postun -p /sbin/ldconfig
  152. %files
  153. %defattr(-,root,root,-)
  154. %doc AUTHORS ChangeLog LICENSE
  155. %{_bindir}/d8
  156. %{_libdir}/*.so.*
  157. %files devel
  158. %defattr(-,root,root,-)
  159. %{_includedir}/*.h
  160. %{_includedir}/v8/extensions/
  161. %{_libdir}/*.so
  162. %{python_sitelib}/*.py*
  163. %changelog
  164. * Wed Oct 24 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 3.10.8-1
  165. - update to 3.10.8
  166. * Sat Jan 29 2011 Munehiro Yamamoto <munepi@vinelinux.org> - 3.0.12-1.svn6522
  167. - source 3.0.12 rev.6387
  168. * Sat Jan 22 2011 Munehiro Yamamoto <munepi@vinelinux.org> - 3.0.9-1.svn6387
  169. - source 3.0.9 rev.6387
  170. * Thu Dec 23 2010 Munehiro Yamamoto <munepi@vinelinux.org> - 3.0.4-1.svn6102
  171. - source 3.0.4 rev.6102
  172. * Sat Dec 11 2010 Munehiro Yamamoto <munepi@vinelinux.org> - 3.0.0-1.svn5932
  173. - source 3.0.0 rev.5932
  174. * Sat Dec 04 2010 Munehiro Yamamoto <munepi@vinelinux.org> - 2.5.9-1.svn5896
  175. - source 2.5.9 rev.5896
  176. * Fri Nov 26 2010 Munehiro Yamamoto <munepi@vinelinux.org> - 2.5.8-1.svn5891
  177. - source 2.5.8 rev.5891
  178. * Thu Nov 11 2010 Munehiro Yamamoto <munepi@vinelinux.org> - 2.5.6-1.svn5808
  179. - source 2.5.6 rev.5808
  180. * Sun Oct 31 2010 Munehiro Yamamoto <munepi@vinelinux.org> - 2.5.2-1.svn5743
  181. - source 2.5.2 rev.5743
  182. * Sat Oct 16 2010 Munehiro Yamamoto <munepi@vinelinux.org> - 2.4.9-1.svn5631
  183. - source 2.4.9 rev.5631
  184. * Sun Oct 10 2010 Munehiro Yamamoto <munepi@vinelinux.org> - 2.4.8-1
  185. - initial build
  186. * Sat Sep 18 2010 Lubomir Rintel <lkundrak@v3.sk> - 2.4.4-1
  187. - Newer version
  188. - Package based on 2.3.11-1.20100831svn5385 by Tom "spot" Callaway
  189. * Wed Sep 15 2010 Lubomir Rintel <lkundrak@v3.sk> - 2.3.8-2
  190. - Package based on 2.3.11-1.20100831svn5385 by Tom "spot" Callaway