mozjs78-vl.spec 8.9 KB

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