1 # Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
6 pkgdesc="JavaScript interpreter and libraries - Version 102"
7 url="https://spidermonkey.dev/"
33 https://archive.mozilla.org/pub/firefox/releases/$_relver/source/firefox-$_relver.source.tar.xz{,.asc}
35 b2sums=('b19db1b35e6c652e2cd44ec5219bd5c42aacd55987962dbcaf50b5ec54d2ac5066290264f938ba3d45ef111779b9f27b06736ae7df11fa62478ab2179acfe723'
38 14F26682D0916CDD81E37B6D61B7B526D98F0353 # Mozilla Software Releases <release@mozilla.com>
41 # Make sure the duplication between bin and lib is found
48 cat >../mozconfig <<END
49 ac_add_options --enable-application=js
50 mk_add_options MOZ_OBJDIR=${PWD@Q}/obj
52 ac_add_options --prefix=/usr
53 ac_add_options --enable-release
54 ac_add_options --enable-hardening
55 ac_add_options --enable-optimize
56 ac_add_options --enable-rust-simd
57 ac_add_options --enable-linker=lld
58 ac_add_options --disable-bootstrap
59 ac_add_options --disable-debug
60 ac_add_options --disable-jemalloc
61 ac_add_options --disable-strip
62 ac_add_options --disable-unified-build
65 ac_add_options --with-system-zlib
66 ac_add_options --without-system-icu
69 ac_add_options --enable-readline
70 ac_add_options --enable-shared-js
71 ac_add_options --enable-tests
72 ac_add_options --with-intl-api
80 export MOZBUILD_STATE_PATH="$srcdir/mozbuild"
81 export MACH_USE_SYSTEM_PYTHON=1
84 echo "Building instrumented JS..."
85 cat >.mozconfig ../mozconfig - <<END
86 ac_add_options --enable-profile-generate=cross
90 echo "Profiling instrumented JS..."
92 local js="$PWD/obj/dist/bin/js"
93 export LLVM_PROFILE_FILE="$PWD/js-%p-%m.profraw"
98 cd ../../../third_party/webkit/PerformanceTests/ARES-6
101 cd ../SunSpider/sunspider-0.9.1
102 "$js" sunspider-standalone-driver.js
105 llvm-profdata merge -o merged.profdata *.profraw
107 stat -c "Profile data found (%s bytes)" merged.profdata
108 test -s merged.profdata
110 echo "Removing instrumented JS..."
113 echo "Building optimized JS..."
114 cat >.mozconfig ../mozconfig - <<END
115 ac_add_options --enable-lto=cross
116 ac_add_options --enable-profile-use=cross
117 ac_add_options --with-pgo-profile-path=${PWD@Q}/merged.profdata
123 local jstests_extra_args=(
127 ) jittest_extra_args=(
130 ) jittest_test_args=(
134 cd firefox-$pkgver/obj
135 make -C js/src check-jstests check-jit-test \
136 JSTESTS_EXTRA_ARGS="${jstests_extra_args[*]}" \
137 JITTEST_EXTRA_ARGS="${jittest_extra_args[*]}" \
138 JITTEST_TEST_ARGS="${jittest_test_args[*]}"
142 cd firefox-$pkgver/obj
143 make DESTDIR="$pkgdir" install
144 rm "$pkgdir"/usr/lib/*.ajs
145 find "$pkgdir"/usr/{lib/pkgconfig,include} -type f -exec chmod -c a-x {} +
148 # vim:set sw=2 sts=-1 et: