db-move: moved polari from [testing] to [extra] (x86_64)
[arch-packages.git] / js91 / trunk / PKGBUILD
blob6e728b35b83ccc2bae10bbce0b86db99f929484c
1 # Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
3 pkgname=js91
4 pkgver=91.13.0
5 pkgrel=1
6 pkgdesc="JavaScript interpreter and libraries - Version 91"
7 arch=(x86_64)
8 url="https://spidermonkey.dev/"
9 license=(MPL)
10 depends=(gcc-libs readline zlib sh)
11 makedepends=(zip autoconf2.13 python-setuptools python-psutil rustup llvm clang lld)
12 checkdepends=(mercurial git)
13 options=(!lto)
14 _relver=${pkgver}esr
15 source=(https://archive.mozilla.org/pub/firefox/releases/$_relver/source/firefox-$_relver.source.tar.xz{,.asc})
16 sha256sums=('53be2bcde0b5ee3ec106bd8ba06b8ae95e7d489c484e881dfbe5360e4c920762'
17             'SKIP')
18 validpgpkeys=('14F26682D0916CDD81E37B6D61B7B526D98F0353') # Mozilla Software Releases <release@mozilla.com>
20 # Make sure the duplication between bin and lib is found
21 COMPRESSZST+=(--long)
23 prepare() {
24   # packed_simd no longer builds with 1.63.0
25   rustup toolchain update --profile minimal 1.62.1
26   rustup default 1.62.1
28   mkdir mozbuild
29   cd firefox-$pkgver
31   cat >../mozconfig <<END
32 ac_add_options --enable-application=js
33 mk_add_options MOZ_OBJDIR=${PWD@Q}/obj
35 ac_add_options --prefix=/usr
36 ac_add_options --enable-release
37 ac_add_options --enable-hardening
38 ac_add_options --enable-optimize
39 ac_add_options --enable-rust-simd
40 ac_add_options --enable-linker=lld
41 ac_add_options --disable-bootstrap
42 ac_add_options --disable-debug
43 ac_add_options --disable-debug-symbols
44 ac_add_options --disable-jemalloc
45 ac_add_options --disable-strip
47 # System libraries
48 ac_add_options --with-system-zlib
49 ac_add_options --without-system-icu
51 # Features
52 ac_add_options --enable-readline
53 ac_add_options --enable-shared-js
54 ac_add_options --enable-tests
55 ac_add_options --with-intl-api
56 END
59 build() {
60   cd firefox-$pkgver
62   export MOZ_NOSPAM=1
63   export MOZBUILD_STATE_PATH="$srcdir/mozbuild"
64   export MACH_USE_SYSTEM_PYTHON=1
66   # Do 3-tier PGO
67   echo "Building instrumented JS..."
68   cat >.mozconfig ../mozconfig - <<END
69 ac_add_options --enable-profile-generate=cross
70 END
71   ./mach build
73   echo "Profiling instrumented JS..."
74   (
75     local js="$PWD/obj/dist/bin/js"
76     export LLVM_PROFILE_FILE="$PWD/js-%p-%m.profraw"
78     cd js/src/octane
79     "$js" run.js
81     cd ../../../third_party/webkit/PerformanceTests/ARES-6
82     "$js" cli.js
84     cd ../SunSpider/sunspider-0.9.1
85     "$js" sunspider-standalone-driver.js
86   )
88   llvm-profdata merge -o merged.profdata *.profraw
90   stat -c "Profile data found (%s bytes)" merged.profdata
91   test -s merged.profdata
93   echo "Removing instrumented JS..."
94   ./mach clobber
96   echo "Building optimized JS..."
97   cat >.mozconfig ../mozconfig - <<END
98 ac_add_options --enable-lto=cross
99 ac_add_options --enable-profile-use=cross
100 ac_add_options --with-pgo-profile-path=${PWD@Q}/merged.profdata
102   ./mach build
105 check() {
106   local jstests_extra_args=(
107     --format=none
108     --exclude-random
109     --wpt=disabled
110   ) jittest_extra_args=(
111     --format=none
112     --timeout 300
113   ) jittest_test_args=(
114     basic
115   )
117   cd firefox-$pkgver/obj
118   make -C js/src check-jstests check-jit-test \
119     JSTESTS_EXTRA_ARGS="${jstests_extra_args[*]}" \
120     JITTEST_EXTRA_ARGS="${jittest_extra_args[*]}" \
121     JITTEST_TEST_ARGS="${jittest_test_args[*]}"
124 package() {
125   cd firefox-$pkgver/obj
126   make DESTDIR="$pkgdir" install
127   rm "$pkgdir"/usr/lib/*.ajs
128   find "$pkgdir"/usr/{lib/pkgconfig,include} -type f -exec chmod -c a-x {} +
131 # vim:set sw=2 et: