v8-vl.spec 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  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: 2%{?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. PARSED_OPT_FLAGS=`echo \'$RPM_OPT_FLAGS -fPIC -fno-strict-aliasing -Wno-unused-parameter -Wno-error=strict-overflow -Wno-unused-but-set-variable -Wno-error=unused-local-typedefs\'| \
  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. * Sun Aug 02 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> 3.13.7.5-2
  165. - rebuild with readline-6.3
  166. * Mon Mar 11 2013 Daisuke SUZUKI <daisuke@linux.or.jp> 3.13.7.5-1
  167. - update to 3.13.7.5
  168. * Wed Oct 24 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 3.10.8-1
  169. - update to 3.10.8
  170. * Sat Jan 29 2011 Munehiro Yamamoto <munepi@vinelinux.org> - 3.0.12-1.svn6522
  171. - source 3.0.12 rev.6387
  172. * Sat Jan 22 2011 Munehiro Yamamoto <munepi@vinelinux.org> - 3.0.9-1.svn6387
  173. - source 3.0.9 rev.6387
  174. * Thu Dec 23 2010 Munehiro Yamamoto <munepi@vinelinux.org> - 3.0.4-1.svn6102
  175. - source 3.0.4 rev.6102
  176. * Sat Dec 11 2010 Munehiro Yamamoto <munepi@vinelinux.org> - 3.0.0-1.svn5932
  177. - source 3.0.0 rev.5932
  178. * Sat Dec 04 2010 Munehiro Yamamoto <munepi@vinelinux.org> - 2.5.9-1.svn5896
  179. - source 2.5.9 rev.5896
  180. * Fri Nov 26 2010 Munehiro Yamamoto <munepi@vinelinux.org> - 2.5.8-1.svn5891
  181. - source 2.5.8 rev.5891
  182. * Thu Nov 11 2010 Munehiro Yamamoto <munepi@vinelinux.org> - 2.5.6-1.svn5808
  183. - source 2.5.6 rev.5808
  184. * Sun Oct 31 2010 Munehiro Yamamoto <munepi@vinelinux.org> - 2.5.2-1.svn5743
  185. - source 2.5.2 rev.5743
  186. * Sat Oct 16 2010 Munehiro Yamamoto <munepi@vinelinux.org> - 2.4.9-1.svn5631
  187. - source 2.4.9 rev.5631
  188. * Sun Oct 10 2010 Munehiro Yamamoto <munepi@vinelinux.org> - 2.4.8-1
  189. - initial build
  190. * Sat Sep 18 2010 Lubomir Rintel <lkundrak@v3.sk> - 2.4.4-1
  191. - Newer version
  192. - Package based on 2.3.11-1.20100831svn5385 by Tom "spot" Callaway
  193. * Wed Sep 15 2010 Lubomir Rintel <lkundrak@v3.sk> - 2.3.8-2
  194. - Package based on 2.3.11-1.20100831svn5385 by Tom "spot" Callaway