mozjs68-vl.spec 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340
  1. %global major 68
  2. # LTO - Enable in Release builds, but consider disabling for development as it increases compile time
  3. %global build_with_lto 1
  4. # Require tests to pass?
  5. %global require_tests 0
  6. # typedarray-arg-set-values-same-buffer-other-type.js is failing on s390x
  7. %ifarch s390x s390
  8. %global require_tests 0
  9. %endif
  10. %if 0%{?build_with_lto}
  11. %global optflags %{optflags} -flto
  12. %global build_ldflags %{build_ldflags} -flto
  13. %endif
  14. # Require libatomic for ppc
  15. %ifarch ppc
  16. %global system_libatomic 1
  17. %endif
  18. # Big endian platforms
  19. %ifarch ppc ppc64 s390 s390x
  20. %global big_endian 1
  21. %endif
  22. Name: mozjs%{major}
  23. Version: 68.11.0
  24. Release: 1%{?_dist_release}
  25. Summary: SpiderMonkey JavaScript library
  26. Vendor: Project Vine
  27. Distribution: Vine Linux
  28. License: MPLv2.0 and MPLv1.1 and BSD and GPLv2+ and GPLv3+ and LGPLv2+ and AFL and ASL 2.0
  29. URL: https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey
  30. Source0: https://ftp.mozilla.org/pub/firefox/releases/%{version}esr/source/firefox-%{version}esr.source.tar.xz
  31. # Patches from Debian mozjs60, rebased for mozjs68:
  32. Patch01: fix-soname.patch
  33. Patch02: copy-headers.patch
  34. Patch03: tests-increase-timeout.patch
  35. Patch09: icu_sources_data.py-Decouple-from-Mozilla-build-system.patch
  36. Patch10: icu_sources_data-Write-command-output-to-our-stderr.patch
  37. # Build fixes - https://hg.mozilla.org/mozilla-central/rev/ca36a6c4f8a4a0ddaa033fdbe20836d87bbfb873
  38. Patch12: emitter.patch
  39. Patch13: emitter_test.patch
  40. # Build fixes
  41. Patch14: init_patch.patch
  42. # TODO: Check with mozilla for cause of these fails and re-enable spidermonkey compile time checks if needed
  43. Patch15: spidermonkey_checks_disable.patch
  44. Patch16: Remove-unused-LLVM-and-Rust-build-dependencies.patch
  45. # armv7 fixes
  46. Patch17: armv7_disable_WASM_EMULATE_ARM_UNALIGNED_FP_ACCESS.patch
  47. # s390x fixes, TODO: file bug report upstream?
  48. Patch18: spidermonkey_style_check_disable_s390x.patch
  49. Patch19: Don-t-run-non262-extensions-clone-errors.js-on-s390x.patch
  50. # Patches from Fedora firefox package:
  51. Patch26: build-icu-big-endian.patch
  52. # Support Python 3 in js tests
  53. Patch30: jstests_python-3.patch
  54. BuildRequires: autoconf213
  55. BuildRequires: cargo
  56. BuildRequires: clang-devel
  57. BuildRequires: gcc
  58. BuildRequires: gcc-c++
  59. BuildRequires: perl
  60. BuildRequires: pkgconfig(libffi)
  61. BuildRequires: pkgconfig(zlib)
  62. # Build requires Python 2, tests are patched to run with Python 3
  63. BuildRequires: python-devel
  64. BuildRequires: python3-devel
  65. BuildRequires: python3-rpm-macros
  66. BuildRequires: python3-six
  67. BuildRequires: readline-devel
  68. BuildRequires: zip
  69. %if 0%{?system_libatomic}
  70. BuildRequires: libatomic
  71. %endif
  72. %description
  73. SpiderMonkey is the code-name for Mozilla Firefox's C++ implementation of
  74. JavaScript. It is intended to be embedded in other applications
  75. that provide host environments for JavaScript.
  76. %package devel
  77. Summary: Development files for %{name}
  78. Requires: %{name}%{?_isa} = %{version}-%{release}
  79. %description devel
  80. The %{name}-devel package contains libraries and header files for
  81. developing applications that use %{name}.
  82. %debug_package
  83. %prep
  84. %setup -q -n firefox-%{version}/js/src
  85. pushd ../..
  86. %patch01 -p1
  87. %patch02 -p1
  88. %patch03 -p1
  89. %patch09 -p1
  90. %patch10 -p1
  91. %patch12 -p1
  92. %patch13 -p1
  93. %patch14 -p1
  94. %patch15 -p1
  95. %patch16 -p1
  96. %ifarch armv7hl
  97. # Disable WASM_EMULATE_ARM_UNALIGNED_FP_ACCESS as it causes the compilation to fail
  98. # https://bugzilla.mozilla.org/show_bug.cgi?id=1526653
  99. %patch17 -p1
  100. %endif
  101. %ifarch s390x
  102. %patch18 -p1
  103. %patch19 -p1
  104. %endif
  105. # Patch for big endian platforms only
  106. %if 0%{?big_endian}
  107. %patch26 -p1 -b .icu
  108. %endif
  109. # Execute tests with Python 3
  110. %patch30 -p1
  111. # make sure we don't ever accidentally link against bundled security libs
  112. rm -rf security/
  113. popd
  114. # Remove zlib directory (to be sure using system version)
  115. rm -rf ../../modules/zlib
  116. %build
  117. export LANG=ja_JP.UTF-8
  118. # Prefer GCC, because clang doesn't support -fstack-clash-protection yet
  119. export CC=gcc
  120. export CXX=g++
  121. %if 0%{?build_with_lto}
  122. export AR=%{_bindir}/gcc-ar
  123. export RANLIB=%{_bindir}/gcc-ranlib
  124. export NM=%{_bindir}/gcc-nm
  125. %endif
  126. export CFLAGS="%{optflags}"
  127. export CXXFLAGS="$CFLAGS"
  128. export LINKFLAGS="%{?__global_ldflags}"
  129. export PYTHON="%{__python}"
  130. autoconf-2.13
  131. %configure \
  132. --without-system-icu \
  133. --enable-posix-nspr-emulation \
  134. --with-system-zlib \
  135. --disable-tests \
  136. --disable-strip \
  137. --with-intl-api \
  138. --enable-readline \
  139. --enable-shared-js \
  140. --disable-optimize \
  141. --enable-pie \
  142. --disable-jemalloc \
  143. --enable-unaligned-private-values
  144. %if 0%{?big_endian}
  145. echo "Generate big endian version of config/external/icu/data/icud58l.dat"
  146. pushd ../..
  147. ./mach python intl/icu_sources_data.py .
  148. ls -l config/external/icu/data
  149. rm -f config/external/icu/data/icudt*l.dat
  150. popd
  151. %endif
  152. %make_build
  153. %install
  154. export LANG=ja_JP.UTF-8
  155. rm -rf %{buildroot}
  156. %make_install
  157. # Fix permissions
  158. chmod -x %{buildroot}%{_libdir}/pkgconfig/*.pc
  159. # Avoid multilib conflicts
  160. case `uname -i` in
  161. i386 | ppc | s390 | sparc )
  162. wordsize="32"
  163. ;;
  164. x86_64 | ppc64 | s390x | sparc64 )
  165. wordsize="64"
  166. ;;
  167. *)
  168. wordsize=""
  169. ;;
  170. esac
  171. if test -n "$wordsize"
  172. then
  173. mv %{buildroot}%{_includedir}/mozjs-%{major}/js-config.h \
  174. %{buildroot}%{_includedir}/mozjs-%{major}/js-config-$wordsize.h
  175. cat >%{buildroot}%{_includedir}/mozjs-%{major}/js-config.h <<EOF
  176. #ifndef JS_CONFIG_H_MULTILIB
  177. #define JS_CONFIG_H_MULTILIB
  178. #include <bits/wordsize.h>
  179. #if __WORDSIZE == 32
  180. # include "js-config-32.h"
  181. #elif __WORDSIZE == 64
  182. # include "js-config-64.h"
  183. #else
  184. # error "unexpected value for __WORDSIZE macro"
  185. #endif
  186. #endif
  187. EOF
  188. fi
  189. # Remove unneeded files
  190. rm %{buildroot}%{_bindir}/js%{major}-config
  191. rm %{buildroot}%{_libdir}/libjs_static.ajs
  192. # Rename library and create symlinks, following fix-soname.patch
  193. mv %{buildroot}%{_libdir}/libmozjs-%{major}.so \
  194. %{buildroot}%{_libdir}/libmozjs-%{major}.so.0.0.0
  195. ln -s libmozjs-%{major}.so.0.0.0 %{buildroot}%{_libdir}/libmozjs-%{major}.so.0
  196. ln -s libmozjs-%{major}.so.0 %{buildroot}%{_libdir}/libmozjs-%{major}.so
  197. %check
  198. export LANG=ja_JP.UTF-8
  199. # Run SpiderMonkey tests
  200. %if 0%{?require_tests}
  201. PYTHONPATH=tests/lib %{__python3} tests/jstests.py -d -s -t 1800 --no-progress --wpt=disabled ../../js/src/dist/bin/js%{major}
  202. %else
  203. PYTHONPATH=tests/lib %{__python3} tests/jstests.py -d -s -t 1800 --no-progress --wpt=disabled ../../js/src/dist/bin/js%{major} || :
  204. %endif
  205. # Run basic JIT tests
  206. %if 0%{?require_tests}
  207. PYTHONPATH=tests/lib %{__python3} jit-test/jit_test.py -s -t 1800 --no-progress ../../js/src/dist/bin/js%{major} basic
  208. %else
  209. PYTHONPATH=tests/lib %{__python3} jit-test/jit_test.py -s -t 1800 --no-progress ../../js/src/dist/bin/js%{major} basic || :
  210. %endif
  211. %post -p /sbin/ldconfig
  212. %postun -p /sbin/ldconfig
  213. %files
  214. %doc README.html
  215. %{_libdir}/libmozjs-%{major}.so.0*
  216. %files devel
  217. %{_bindir}/js%{major}
  218. %{_libdir}/libmozjs-%{major}.so
  219. %{_libdir}/pkgconfig/*.pc
  220. %{_includedir}/mozjs-%{major}/
  221. %changelog
  222. * Tue Aug 04 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 68.11.0-1
  223. - initial build for Vine Linux.
  224. - new upstream release.
  225. * Tue Jun 30 2020 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.10.0-1
  226. - Update to 68.10.0
  227. * Tue Jun 02 2020 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.9.0-1
  228. - Update to 68.9.0
  229. - Drop llvm and rust deps
  230. * Wed May 06 2020 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.8.0-1
  231. - Update to 68.8.0
  232. * Tue Apr 07 2020 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.7.0-1
  233. - Update to 68.7.0
  234. * Tue Mar 17 2020 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.6.0-2
  235. - Rebuild with GCC 10
  236. - Nuke check_spidermonkey_style.py on s390x
  237. * Wed Mar 11 2020 Kalev Lember <klember@redhat.com> - 68.6.0-1
  238. - Update to 68.6.0
  239. * Mon Feb 10 2020 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.5.0-1
  240. - Update to 68.5.0
  241. * Mon Feb 03 2020 Kalev Lember <klember@redhat.com> - 68.4.2-3
  242. - Build with --enable-unaligned-private-values
  243. * Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 68.4.2-2
  244. - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
  245. * Wed Jan 22 2020 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.4.2-1
  246. - Update to 68.4.2
  247. * Tue Jan 07 2020 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.4.0-1
  248. - Update to 68.4.0
  249. * Sat Dec 07 2019 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.3.0-1
  250. - Update to 68.3.0
  251. * Wed Nov 20 2019 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.2.0-5
  252. - Don't enforce tests to pass on s390 and s390x again
  253. * Tue Nov 19 2019 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.2.0-4
  254. - Enable LTO
  255. - Enforce SpiderMonkey tests in check section on all architectures
  256. * Sun Nov 17 2019 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.2.0-3
  257. - Fix armv7 build
  258. * Thu Nov 14 2019 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.2.0-2
  259. - Fix s390x build
  260. - Exclude armv7 for now, see comment up in the spec
  261. * Mon Nov 04 2019 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.2.0-1
  262. - Initial mozjs68 package based on mozjs60