mozjs78-vl.spec 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377
  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.14.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. # Fix for https://bugzilla.mozilla.org/show_bug.cgi?id=1644600 ( SharedArrayRawBufferRefs is not exported )
  47. # https://github.com/0ad/0ad/blob/83e81362d850cc6f2b3b598255b873b6d04d5809/libraries/source/spidermonkey/FixSharedArray.diff
  48. Patch30: FixSharedArray.diff
  49. # Avoid autoconf213 dependency, backported from upstream
  50. # https://bugzilla.mozilla.org/show_bug.cgi?id=1663863
  51. Patch31: 0002-D89554-autoconf1.diff
  52. Patch32: 0003-D94538-autoconf2.diff
  53. BuildRequires: make
  54. BuildRequires: autoconf213
  55. BuildRequires: cargo
  56. BuildRequires: clang-devel
  57. BuildRequires: gcc
  58. BuildRequires: gcc-c++
  59. BuildRequires: nasm
  60. BuildRequires: llvm
  61. BuildRequires: llvm-devel
  62. BuildRequires: rust
  63. BuildRequires: perl
  64. BuildRequires: pkgconfig(libffi)
  65. BuildRequires: pkgconfig(zlib)
  66. BuildRequires: python3-devel
  67. BuildRequires: python3-setuptools
  68. BuildRequires: python3-six
  69. BuildRequires: readline-devel
  70. BuildRequires: zip
  71. %if 0%{?big_endian}
  72. BuildRequires: icu
  73. %endif
  74. %if 0%{?system_libatomic}
  75. BuildRequires: libatomic
  76. %endif
  77. Obsoletes: mozjs68 < 78.0.0
  78. Obsoletes: mozjs60 < 68.0.0
  79. Obsoletes: mozjs52 < 60.0.0
  80. Obsoletes: mozjs24 < 52.0.0
  81. Obsoletes: mozjs17 < 24.0.0
  82. Obsoletes: js < 1:1.8.6
  83. %description
  84. SpiderMonkey is the code-name for Mozilla Firefox's C++ implementation of
  85. JavaScript. It is intended to be embedded in other applications
  86. that provide host environments for JavaScript.
  87. %package devel
  88. Summary: Development files for %{name}
  89. Group: programming
  90. Requires: %{name}%{?_isa} = %{version}-%{release}
  91. %description devel
  92. The %{name}-devel package contains libraries and header files for
  93. developing applications that use %{name}.
  94. %debug_package
  95. %prep
  96. %setup -q -n firefox-%{version}/js/src
  97. pushd ../..
  98. %patch01 -p1
  99. %patch02 -p1
  100. %patch03 -p1
  101. %patch09 -p1
  102. %patch10 -p1
  103. %patch12 -p1
  104. %patch14 -p1
  105. %patch15 -p1
  106. %ifarch armv7hl
  107. # Disable WASM_EMULATE_ARM_UNALIGNED_FP_ACCESS as it causes the compilation to fail
  108. # https://bugzilla.mozilla.org/show_bug.cgi?id=1526653
  109. %patch17 -p1
  110. %endif
  111. %ifarch s390x
  112. %patch18 -p1
  113. %endif
  114. # Fixes for ppc64 and s390x, there is no need to keep it in ifarch here since mozilla tests support ifarch conditions
  115. %patch19 -p1
  116. # Export SharedArrayRawBufferRefs
  117. %patch30 -p1
  118. %if 0
  119. # Avoid autoconf213 dependency
  120. %patch31 -p1 -b .autoconf213
  121. %patch32 -p1 -b .autoconf213-2
  122. AC_MACRODIR=`pwd`/build/autoconf
  123. sed -i \
  124. -e 's|@SHELL@|/bin/sh|' \
  125. -e 's|@M4@|/usr/bin/m4|' \
  126. -e 's|@AWK@|/bin/awk|' \
  127. -e "s|@AC_MACRODIR@|$AC_MACRODIR|" \
  128. build/autoconf/autoconf.sh
  129. %endif
  130. # Copy out the LICENSE file
  131. cp LICENSE js/src/
  132. popd
  133. # Remove zlib directory (to be sure using system version)
  134. rm -rf ../../modules/zlib
  135. %build
  136. # Prefer GCC for now
  137. export CC=gcc
  138. export CXX=g++
  139. # Workaround
  140. # error: options `-C embed-bitcode=no` and `-C lto` are incompatible
  141. # error: could not compile `jsrust`.
  142. # https://github.com/japaric/cargo-call-stack/issues/25
  143. export RUSTFLAGS="-C embed-bitcode"
  144. %if 0%{?build_with_lto}
  145. # https://github.com/ptomato/mozjs/commit/36bb7982b41e0ef9a65f7174252ab996cd6777bd
  146. export CARGO_PROFILE_RELEASE_LTO=true
  147. %endif
  148. export CFLAGS="%{optflags}"
  149. export CXXFLAGS="$CFLAGS"
  150. export LINKFLAGS="%{?__global_ldflags}"
  151. export PYTHON="%{__python3}"
  152. autoconf-2.13
  153. %configure \
  154. --without-system-icu \
  155. --with-system-zlib \
  156. --disable-tests \
  157. --disable-strip \
  158. --with-intl-api \
  159. --enable-readline \
  160. --enable-shared-js \
  161. --enable-optimize \
  162. --disable-debug \
  163. --enable-pie \
  164. --disable-jemalloc
  165. %if 0%{?big_endian}
  166. echo "Generate big endian version of config/external/icu/data/icud67l.dat"
  167. pushd ../..
  168. icupkg -tb config/external/icu/data/icudt67l.dat config/external/icu/data/icudt67b.dat
  169. rm -f config/external/icu/data/icudt*l.dat
  170. popd
  171. %endif
  172. %make_build
  173. %install
  174. %make_install
  175. # Fix permissions
  176. chmod -x %{buildroot}%{_libdir}/pkgconfig/*.pc
  177. # Avoid multilib conflicts
  178. case `uname -i` in
  179. i386 | ppc | s390 | sparc )
  180. wordsize="32"
  181. ;;
  182. x86_64 | ppc64 | s390x | sparc64 )
  183. wordsize="64"
  184. ;;
  185. *)
  186. wordsize=""
  187. ;;
  188. esac
  189. if test -n "$wordsize"
  190. then
  191. mv %{buildroot}%{_includedir}/mozjs-%{major}/js-config.h \
  192. %{buildroot}%{_includedir}/mozjs-%{major}/js-config-$wordsize.h
  193. cat >%{buildroot}%{_includedir}/mozjs-%{major}/js-config.h <<EOF
  194. #ifndef JS_CONFIG_H_MULTILIB
  195. #define JS_CONFIG_H_MULTILIB
  196. #include <bits/wordsize.h>
  197. #if __WORDSIZE == 32
  198. # include "js-config-32.h"
  199. #elif __WORDSIZE == 64
  200. # include "js-config-64.h"
  201. #else
  202. # error "unexpected value for __WORDSIZE macro"
  203. #endif
  204. #endif
  205. EOF
  206. fi
  207. # Remove unneeded files
  208. rm %{buildroot}%{_bindir}/js%{major}-config
  209. rm %{buildroot}%{_libdir}/libjs_static.ajs
  210. # Rename library and create symlinks, following fix-soname.patch
  211. mv %{buildroot}%{_libdir}/libmozjs-%{major}.so \
  212. %{buildroot}%{_libdir}/libmozjs-%{major}.so.0.0.0
  213. ln -s libmozjs-%{major}.so.0.0.0 %{buildroot}%{_libdir}/libmozjs-%{major}.so.0
  214. ln -s libmozjs-%{major}.so.0 %{buildroot}%{_libdir}/libmozjs-%{major}.so
  215. %check
  216. # Run SpiderMonkey tests
  217. %if 0%{?require_tests}
  218. PYTHONPATH=tests/lib %{__python3} tests/jstests.py -d -s -t 1800 --no-progress --wpt=disabled ../../js/src/dist/bin/js%{major}
  219. %else
  220. PYTHONPATH=tests/lib %{__python3} tests/jstests.py -d -s -t 1800 --no-progress --wpt=disabled ../../js/src/dist/bin/js%{major} || :
  221. %endif
  222. # Run basic JIT tests
  223. %if 0%{?require_tests}
  224. PYTHONPATH=tests/lib %{__python3} jit-test/jit_test.py -s -t 1800 --no-progress ../../js/src/dist/bin/js%{major} basic
  225. %else
  226. PYTHONPATH=tests/lib %{__python3} jit-test/jit_test.py -s -t 1800 --no-progress ../../js/src/dist/bin/js%{major} basic || :
  227. %endif
  228. %files
  229. %doc README.html
  230. %license LICENSE
  231. %{_libdir}/libmozjs-%{major}.so.0*
  232. %files devel
  233. %{_bindir}/js%{major}
  234. %{_libdir}/libmozjs-%{major}.so
  235. %{_libdir}/pkgconfig/*.pc
  236. %{_includedir}/mozjs-%{major}/
  237. %changelog
  238. * Wed Sep 08 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 78.14.0-1
  239. - new upstream release.
  240. * Tue Aug 17 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 78.13.0-1
  241. - new upstream release.
  242. - dropped ldconfig scriptlets.
  243. - imported Patch30-32 from rawhide.
  244. * Fri Jul 16 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 78.12.0-1
  245. - new upstream release.
  246. * Fri Feb 26 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 78.8.0-1
  247. - new upstream release.
  248. - dropped Patch1000: fixed in upstream.
  249. * Wed Feb 24 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 78.7.0-1
  250. - switched to mozjs-78.
  251. - added Patch1000 to build with rust-1.50.
  252. * Tue Aug 04 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 68.11.0-1
  253. - initial build for Vine Linux.
  254. - new upstream release.
  255. * Tue Jun 30 2020 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.10.0-1
  256. - Update to 68.10.0
  257. * Tue Jun 02 2020 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.9.0-1
  258. - Update to 68.9.0
  259. - Drop llvm and rust deps
  260. * Wed May 06 2020 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.8.0-1
  261. - Update to 68.8.0
  262. * Tue Apr 07 2020 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.7.0-1
  263. - Update to 68.7.0
  264. * Tue Mar 17 2020 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.6.0-2
  265. - Rebuild with GCC 10
  266. - Nuke check_spidermonkey_style.py on s390x
  267. * Wed Mar 11 2020 Kalev Lember <klember@redhat.com> - 68.6.0-1
  268. - Update to 68.6.0
  269. * Mon Feb 10 2020 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.5.0-1
  270. - Update to 68.5.0
  271. * Mon Feb 03 2020 Kalev Lember <klember@redhat.com> - 68.4.2-3
  272. - Build with --enable-unaligned-private-values
  273. * Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 68.4.2-2
  274. - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
  275. * Wed Jan 22 2020 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.4.2-1
  276. - Update to 68.4.2
  277. * Tue Jan 07 2020 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.4.0-1
  278. - Update to 68.4.0
  279. * Sat Dec 07 2019 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.3.0-1
  280. - Update to 68.3.0
  281. * Wed Nov 20 2019 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.2.0-5
  282. - Don't enforce tests to pass on s390 and s390x again
  283. * Tue Nov 19 2019 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.2.0-4
  284. - Enable LTO
  285. - Enforce SpiderMonkey tests in check section on all architectures
  286. * Sun Nov 17 2019 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.2.0-3
  287. - Fix armv7 build
  288. * Thu Nov 14 2019 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.2.0-2
  289. - Fix s390x build
  290. - Exclude armv7 for now, see comment up in the spec
  291. * Mon Nov 04 2019 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.2.0-1
  292. - Initial mozjs68 package based on mozjs60