archrelease: copy trunk to extra-x86_64
[arch-packages.git] / js102 / repos / extra-x86_64 / PKGBUILD
blob05c086d6eb47f4a9d9dbffa25f674b09f18d80f7
1 # Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
3 pkgname=js102 
4 pkgver=102.11.0
5 pkgrel=1
6 pkgdesc="JavaScript interpreter and libraries - Version 102"
7 url="https://spidermonkey.dev/"
8 arch=(x86_64)
9 license=(MPL)
10 depends=(
11   gcc-libs
12   readline
13   sh
14   zlib
16 makedepends=(
17   autoconf2.13
18   clang
19   lld
20   llvm
21   python-psutil
22   python-setuptools
23   rust
24   zip
26 checkdepends=(
27   git
28   mercurial
30 options=(!lto)
31 _relver=${pkgver}esr
32 source=(
33   https://archive.mozilla.org/pub/firefox/releases/$_relver/source/firefox-$_relver.source.tar.xz{,.asc}
35 b2sums=('b19db1b35e6c652e2cd44ec5219bd5c42aacd55987962dbcaf50b5ec54d2ac5066290264f938ba3d45ef111779b9f27b06736ae7df11fa62478ab2179acfe723'
36         'SKIP')
37 validpgpkeys=(
38   14F26682D0916CDD81E37B6D61B7B526D98F0353  # Mozilla Software Releases <release@mozilla.com>
41 # Make sure the duplication between bin and lib is found
42 COMPRESSZST+=(--long)
44 prepare() {
45   mkdir mozbuild
46   cd firefox-$pkgver
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
64 # System libraries
65 ac_add_options --with-system-zlib
66 ac_add_options --without-system-icu
68 # Features
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
73 END
76 build() {
77   cd firefox-$pkgver
79   export MOZ_NOSPAM=1
80   export MOZBUILD_STATE_PATH="$srcdir/mozbuild"
81   export MACH_USE_SYSTEM_PYTHON=1
83   # Do 3-tier PGO
84   echo "Building instrumented JS..."
85   cat >.mozconfig ../mozconfig - <<END
86 ac_add_options --enable-profile-generate=cross
87 END
88   ./mach build
90   echo "Profiling instrumented JS..."
91   (
92     local js="$PWD/obj/dist/bin/js"
93     export LLVM_PROFILE_FILE="$PWD/js-%p-%m.profraw"
95     cd js/src/octane
96     "$js" run.js
98     cd ../../../third_party/webkit/PerformanceTests/ARES-6
99     "$js" cli.js
101     cd ../SunSpider/sunspider-0.9.1
102     "$js" sunspider-standalone-driver.js
103   )
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..."
111   ./mach clobber
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
119   ./mach build
122 check() {
123   local jstests_extra_args=(
124     --format=none
125     --exclude-random
126     --wpt=disabled
127   ) jittest_extra_args=(
128     --format=none
129     --timeout 300
130   ) jittest_test_args=(
131     basic
132   )
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[*]}"
141 package() {
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: