v8-vl.spec 7.4 KB

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