mozjs60-vl.spec 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409
  1. %global major 60
  2. # Enable LTO
  3. %global optflags %{?optflags} -flto
  4. %global build_ldflags %{?build_ldflags} -flto
  5. # Require libatomic for ppc
  6. %ifarch ppc
  7. %global system_libatomic 1
  8. %endif
  9. # Big endian platforms
  10. %ifarch ppc ppc64 s390 s390x
  11. %global big_endian 1
  12. %endif
  13. Name: mozjs%{major}
  14. Version: 60.9.0
  15. Release: 7%{?_dist_release}
  16. Summary: SpiderMonkey JavaScript library
  17. Vendor: Project Vine
  18. Distribution: Vine Linux.
  19. License: MPLv2.0 and MPLv1.1 and BSD and GPLv2+ and GPLv3+ and LGPLv2+ and AFL and ASL 2.0
  20. URL: https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey
  21. Source0: https://ftp.mozilla.org/pub/firefox/releases/%{version}esr/source/firefox-%{version}esr.source.tar.xz
  22. # Patches from Debian mozjs52_52.3.1-4.debian.tar.xz:
  23. Patch0001: fix-soname.patch
  24. Patch0002: copy-headers.patch
  25. Patch0003: tests-increase-timeout.patch
  26. Patch0008: Always-use-the-equivalent-year-to-determine-the-time-zone.patch
  27. Patch0009: icu_sources_data.py-Decouple-from-Mozilla-build-system.patch
  28. Patch0010: icu_sources_data-Write-command-output-to-our-stderr.patch
  29. Patch0011: tests-For-tests-that-are-skipped-on-64-bit-mips64-is-also.patch
  30. # Patches from Debian mozjs60_60.8.0-2.debian.tar.xz
  31. Patch001000: tests-Expect-some-floating-point-tests-to-fail-on-i386.patch
  32. # Build fixes - https://hg.mozilla.org/mozilla-central/rev/ca36a6c4f8a4a0ddaa033fdbe20836d87bbfb873
  33. Patch12: emitter.patch
  34. Patch13: emitter_test.patch
  35. Patch14: init_patch.patch
  36. # s390x fixes:
  37. # https://salsa.debian.org/gnome-team/mozjs60/blob/debian/master/debian/patches/enddianness.patch
  38. Patch15: enddianness.patch
  39. # https://salsa.debian.org/gnome-team/mozjs60/blob/debian/master/debian/patches/jsproperty-endian.patch
  40. Patch16: jsproperty-endian.patch
  41. # https://salsa.debian.org/gnome-team/mozjs60/blob/debian/master/debian/patches/tests-Skip-a-test-on-s390x.patch
  42. Patch17: tests-Skip-a-test-on-s390x.patch
  43. # https://salsa.debian.org/gnome-team/mozjs60/blob/debian/master/debian/patches/tests-Expect-a-test-to-fail-on-big-endian.patch
  44. Patch18: tests-Expect-a-test-to-fail-on-big-endian.patch
  45. # Patches from Fedora firefox package:
  46. Patch26: build-icu-big-endian.patch
  47. # aarch64 fixes for -O2
  48. Patch30: Save-x28-before-clobbering-it-in-the-regex-compiler.patch
  49. Patch31: Save-and-restore-non-volatile-x28-on-ARM64-for-generated-unboxed-object-constructor.patch
  50. BuildRequires: autoconf213
  51. BuildRequires: gcc
  52. BuildRequires: gcc-c++
  53. BuildRequires: perl
  54. BuildRequires: pkgconfig(libffi)
  55. BuildRequires: pkgconfig(zlib)
  56. BuildRequires: python-devel
  57. BuildRequires: python-rpm-macros
  58. BuildRequires: readline-devel
  59. BuildRequires: /usr/bin/zip
  60. %if 0%{?system_libatomic}
  61. BuildRequires: libatomic
  62. %endif
  63. # Firefox does not allow to build with system version of jemalloc
  64. Provides: bundled(jemalloc) = 4.3.1
  65. %description
  66. SpiderMonkey is the code-name for Mozilla Firefox's C++ implementation of
  67. JavaScript. It is intended to be embedded in other applications
  68. that provide host environments for JavaScript.
  69. %package devel
  70. Summary: Development files for %{name}
  71. Requires: %{name}%{?_isa} = %{version}-%{release}
  72. %description devel
  73. The %{name}-devel package contains libraries and header files for
  74. developing applications that use %{name}.
  75. %debug_package
  76. %prep
  77. %setup -q -n firefox-%{version}/js/src
  78. pushd ../..
  79. %patch0001 -p1
  80. %patch0002 -p1
  81. %patch0003 -p1
  82. %patch0008 -p1
  83. %patch0009 -p1
  84. %patch0010 -p1
  85. %patch0011 -p1
  86. %patch12 -p1
  87. %patch13 -p1
  88. %patch14 -p1
  89. # s390x fixes
  90. %patch15 -p1
  91. %patch16 -p1
  92. %patch17 -p1
  93. %patch18 -p1
  94. # Patch for big endian platforms only
  95. %if 0%{?big_endian}
  96. %patch26 -p1 -b .icu
  97. %endif
  98. # aarch64 -O2 fixes
  99. %ifarch aarch64
  100. %patch30 -p1
  101. %patch31 -p1
  102. %endif
  103. %ifarch %{ix86}
  104. %patch1000 -p1
  105. %endif
  106. # make sure we don't ever accidentally link against bundled security libs
  107. rm -rf security/
  108. popd
  109. # Remove zlib directory (to be sure using system version)
  110. rm -rf ../../modules/zlib
  111. %build
  112. # Enable LTO
  113. export AR=%{_bindir}/gcc-ar
  114. export RANLIB=%{_bindir}/gcc-ranlib
  115. export NM=%{_bindir}/gcc-nm
  116. export CFLAGS="%{optflags}"
  117. # workaround for ix86 (32bit)
  118. # https://bugzilla.mozilla.org/show_bug.cgi?id=1621900
  119. %ifarch %{ix86}
  120. export CFLAGS="$CFLAGS -mfpmath=sse -msse -msse2"
  121. %endif
  122. export CXXFLAGS="$CFLAGS"
  123. export LINKFLAGS="%{?__global_ldflags}"
  124. export PYTHON="%{__python}"
  125. autoconf-2.13
  126. %configure \
  127. --without-system-icu \
  128. --enable-posix-nspr-emulation \
  129. --with-system-zlib \
  130. --enable-tests \
  131. --disable-strip \
  132. --with-intl-api \
  133. --enable-readline \
  134. --enable-shared-js \
  135. --disable-optimize \
  136. --enable-pie \
  137. --disable-jemalloc \
  138. %if 0%{?big_endian}
  139. echo "Generate big endian version of config/external/icu/data/icud58l.dat"
  140. pushd ../..
  141. ./mach python intl/icu_sources_data.py .
  142. ls -l config/external/icu/data
  143. rm -f config/external/icu/data/icudt*l.dat
  144. popd
  145. %endif
  146. %make_build
  147. %install
  148. rm -rf %{buildroot}
  149. %make_install
  150. # Fix permissions
  151. chmod -x %{buildroot}%{_libdir}/pkgconfig/*.pc
  152. # Avoid multilib conflicts
  153. case `uname -i` in
  154. i386 | ppc | s390 | sparc )
  155. wordsize="32"
  156. ;;
  157. x86_64 | ppc64 | s390x | sparc64 )
  158. wordsize="64"
  159. ;;
  160. *)
  161. wordsize=""
  162. ;;
  163. esac
  164. if test -n "$wordsize"
  165. then
  166. mv %{buildroot}%{_includedir}/mozjs-60/js-config.h \
  167. %{buildroot}%{_includedir}/mozjs-60/js-config-$wordsize.h
  168. cat >%{buildroot}%{_includedir}/mozjs-60/js-config.h <<EOF
  169. #ifndef JS_CONFIG_H_MULTILIB
  170. #define JS_CONFIG_H_MULTILIB
  171. #include <bits/wordsize.h>
  172. #if __WORDSIZE == 32
  173. # include "js-config-32.h"
  174. #elif __WORDSIZE == 64
  175. # include "js-config-64.h"
  176. #else
  177. # error "unexpected value for __WORDSIZE macro"
  178. #endif
  179. #endif
  180. EOF
  181. fi
  182. # Remove unneeded files
  183. rm %{buildroot}%{_bindir}/js%{major}-config
  184. rm %{buildroot}%{_libdir}/libjs_static.ajs
  185. # Rename library and create symlinks, following fix-soname.patch
  186. mv %{buildroot}%{_libdir}/libmozjs-%{major}.so \
  187. %{buildroot}%{_libdir}/libmozjs-%{major}.so.0.0.0
  188. ln -s libmozjs-%{major}.so.0.0.0 %{buildroot}%{_libdir}/libmozjs-%{major}.so.0
  189. ln -s libmozjs-%{major}.so.0 %{buildroot}%{_libdir}/libmozjs-%{major}.so
  190. %check
  191. # Run SpiderMonkey tests
  192. %{__python} tests/jstests.py -d -s -t 1800 --no-progress ../../js/src/js/src/shell/js \
  193. %ifarch %{ix86} x86_64 %{arm} aarch64 ppc ppc64le s390x
  194. ;
  195. %else
  196. || :
  197. %endif
  198. # Run basic JIT tests
  199. %{__python} jit-test/jit_test.py -s -t 1800 --no-progress ../../js/src/js/src/shell/js basic \
  200. %ifarch %{ix86} x86_64 %{arm} aarch64 ppc ppc64le s390x
  201. ;
  202. %else
  203. || :
  204. %endif
  205. %post -p /sbin/ldconfig
  206. %postun -p /sbin/ldconfig
  207. %files
  208. %doc README.html
  209. %{_libdir}/libmozjs-%{major}.so.0*
  210. %files devel
  211. %{_bindir}/js%{major}
  212. %{_libdir}/libmozjs-%{major}.so
  213. %{_libdir}/pkgconfig/*.pc
  214. %{_includedir}/mozjs-%{major}/
  215. %changelog
  216. * Thu Mar 26 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 60.9.0-7
  217. - separated debuginfo.
  218. * Mon Mar 23 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 60.9.0-6
  219. - initial build for Vine Linux.
  220. - added Patch1000 for i686.
  221. * Mon Feb 17 2020 Kalev Lember <klember@redhat.com> - 60.9.0-5
  222. - Update enddianness.patch with more s390x fixes
  223. - Enable tests on s390x again
  224. * Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 60.9.0-4
  225. - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
  226. * Tue Sep 10 2019 Kalev Lember <klember@redhat.com> - 60.9.0-3
  227. - Fix multilib conflicts in js-config.h
  228. * Sat Sep 07 2019 Kalev Lember <klember@redhat.com> - 60.9.0-2
  229. - Backport patches for s390x support
  230. * Tue Sep 03 2019 Kalev Lember <klember@redhat.com> - 60.9.0-1
  231. - Update to 60.9.0
  232. * Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 60.8.0-3
  233. - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
  234. * Wed Jul 10 2019 Artem Polishchuk <ego.cordatus@gmail.com> - 60.8.0-2
  235. - Enable LTO
  236. * Tue Jul 09 2019 Frantisek Zatloukal <fzatlouk@redhat.com> - 60.8.0-1
  237. - Update to 60.8.0
  238. * Sat Jun 22 2019 Frantisek Zatloukal <fzatlouk@redhat.com> - 60.7.2-1
  239. - Update to 60.7.2
  240. * Wed Jun 19 2019 Frantisek Zatloukal <fzatlouk@redhat.com> - 60.7.1-1
  241. - Update to 60.7.1
  242. * Tue May 21 2019 Kalev Lember <klember@redhat.com> - 60.7.0-1
  243. - Update to 60.7.0
  244. * Mon Apr 15 2019 Frantisek Zatloukal <fzatlouk@redhat.com> - 60.6.1-2
  245. - Backport two Firefox 61 patches and allow compiler optimizations on aarch64
  246. * Sun Apr 14 2019 Frantisek Zatloukal <fzatlouk@redhat.com> - 60.6.1-1
  247. - Update to 60.6.1
  248. * Thu Feb 21 2019 Frantisek Zatloukal <fzatlouk@redhat.com> - 60.4.0-5
  249. - Re-enable null pointer gcc optimization
  250. * Sun Feb 17 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 60.4.0-4
  251. - Rebuild for readline 8.0
  252. * Thu Feb 14 2019 Frantisek Zatloukal <fzatlouk@redhat.com> - 60.4.0-3
  253. - Build aarch64 with -O0 because of rhbz#1676292
  254. * Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 60.4.0-2
  255. - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
  256. * Wed Jan 02 2019 Frantisek Zatloukal <fzatlouk@redhat.com> - 60.4.0-1
  257. - Update to 60.4.0
  258. * Mon Nov 12 2018 Kalev Lember <klember@redhat.com> - 60.3.0-1
  259. - Update to 60.3.0
  260. * Thu Oct 04 2018 Kalev Lember <klember@redhat.com> - 60.2.2-1
  261. - Update to 60.2.2
  262. * Fri Sep 28 2018 Kalev Lember <klember@redhat.com> - 60.2.1-1
  263. - Update to 60.2.1
  264. * Tue Sep 11 2018 Kalev Lember <klember@redhat.com> - 60.2.0-1
  265. - Update to 60.2.0
  266. * Tue Sep 04 2018 Frantisek Zatloukal <fzatlouk@redhat.com> - 60.1.0-1
  267. - Update to 60.1.0
  268. * Wed Jul 25 2018 Kalev Lember <klember@redhat.com> - 52.9.0-1
  269. - Update to 52.9.0
  270. * Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 52.8.0-3
  271. - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
  272. * Mon Jun 11 2018 Ray Strode <rstrode@redhat.com> - 52.8.0-2
  273. - safeguard against linking against bundled nss
  274. Related: #1563708
  275. * Fri May 11 2018 Kalev Lember <klember@redhat.com> - 52.8.0-1
  276. - Update to 52.8.0
  277. - Fix the build on ppc
  278. - Disable JS Helper threads on ppc64le (#1523121)
  279. * Sat Apr 07 2018 Kalev Lember <klember@redhat.com> - 52.7.3-1
  280. - Update to 52.7.3
  281. * Tue Mar 20 2018 Kalev Lember <klember@redhat.com> - 52.7.2-1
  282. - Update to 52.7.2
  283. - Switch to %%ldconfig_scriptlets
  284. * Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 52.6.0-2
  285. - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
  286. * Tue Jan 23 2018 Kalev Lember <klember@redhat.com> - 52.6.0-1
  287. - Update to 52.6.0
  288. * Fri Nov 24 2017 Björn Esser <besser82@fedoraproject.org> - 52.5.0-5
  289. - SpiderMonkey tests have regressions on %%{power64}, too
  290. * Fri Nov 24 2017 Björn Esser <besser82@fedoraproject.org> - 52.5.0-4
  291. - SpiderMonkey tests have regressions on big endian platforms
  292. * Fri Nov 24 2017 Björn Esser <besser82@fedoraproject.org> - 52.5.0-3
  293. - SpiderMonkey tests do not fail on any arch
  294. - Basic JIT tests are failing on s390 arches, only
  295. - Use macro for ppc64 arches
  296. - Run tests using Python2 explicitly
  297. - Simplify %%check
  298. - Use the %%{major} macro consequently
  299. - Replace %%define with %%global
  300. * Fri Nov 24 2017 Björn Esser <besser82@fedoraproject.org> - 52.5.0-2
  301. - Use macro for Python 2 interpreter
  302. - Use proper export and quoting
  303. * Tue Nov 14 2017 Kalev Lember <klember@redhat.com> - 52.5.0-1
  304. - Update to 52.5.0
  305. * Tue Oct 31 2017 Kalev Lember <klember@redhat.com> - 52.4.0-3
  306. - Include standalone /usr/bin/js52 interpreter
  307. * Tue Oct 31 2017 Kalev Lember <klember@redhat.com> - 52.4.0-2
  308. - Various secondary arch fixes
  309. * Thu Sep 28 2017 Kalev Lember <klember@redhat.com> - 52.4.0-1
  310. - Update to 52.4.0
  311. * Wed Sep 20 2017 Kalev Lember <klember@redhat.com> - 52.3.0-1
  312. - Initial Fedora packaging, based on earlier mozjs45 work