upgpkg: sbcl 2.3.1-1
[arch-packages.git] / js52 / trunk / PKGBUILD
blob9f798582f76574651b5358fd9d1fdac5fb7b9588
1 # Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
3 pkgname=js52
4 pkgver=52.9.0
5 pkgrel=4
6 pkgdesc="JavaScript interpreter and libraries - Version 52"
7 arch=(x86_64)
8 url="https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey"
9 license=(MPL)
10 depends=(gcc-libs readline zlib sh)
11 makedepends=(python2 zip autoconf2.13)
12 _relver=${pkgver}esr
13 source=(https://archive.mozilla.org/pub/firefox/releases/$_relver/source/firefox-$_relver.source.tar.xz
14         mozjs52-copy-headers.patch
15         mozjs52-disable-mozglue.patch
16         mozjs52-disable-wformat.patch)
17 sha256sums=('c01d09658c53c1b3a496e353a24dad03b26b81d3b1d099abc26a06f81c199dd6'
18             'c5b3a88e4d10ef149aba6fc48d431db54ff266323fa22a5d549028fd794423cc'
19             '5a84f02521f37de873991dd360a4c4bfdbdd2fb4a218e11be73f9cbbf02050e8'
20             '4c5a1662e36c6a5a11db0263bb264d104ff801789d5b6bc6a6104439457afb90')
22 # Make sure the duplication between bin and lib is found
23 COMPRESSZST+=(--long)
25 prepare() {
26   cd firefox-$_relver
27   mkdir obj
29   # https://salsa.debian.org/gnome-team/mozjs52/tree/debian/master/debian/patches
30   patch -Np1 -i ../mozjs52-copy-headers.patch
31   patch -Np1 -i ../mozjs52-disable-mozglue.patch
33   # New errors in test code as of GCC 9
34   patch -Np1 -i ../mozjs52-disable-wformat.patch
37 build() {
38   local configure_args=(
39     --prefix=/usr
40     --disable-debug
41     --disable-debug-symbols
42     --disable-jemalloc
43     --disable-strip
44     --enable-gold
45     --enable-optimize="-O2"
46     --enable-pie
47     --enable-posix-nspr-emulation
48     --enable-readline
49     --enable-release
50     --enable-shared-js
51     --enable-tests
52     --with-intl-api
53     --with-system-zlib
54     --without-system-icu
55   ) flags=(
56     -fno-delete-null-pointer-checks
57     -fno-strict-aliasing
58     -fno-tree-vrp
59   )
61   cd firefox-$_relver/obj
63   unset CPPFLAGS
64   CFLAGS+=" ${flags[*]}"
65   CXXFLAGS+=" ${flags[*]}"
66   export CC=gcc CXX=g++ PYTHON=/usr/bin/python2
68   sh ../js/src/configure "${configure_args[@]}"
69   make
72 check() {
73   local jstests_extra_args=(
74     --format=none
75     --exclude-random
76   ) jittest_extra_args=(
77     --format=none
78     --timeout 300
79   ) jittest_test_args=(
80     basic
81   )
83   cd firefox-$_relver/obj
84   make -C js/src check-jstests check-jit-test \
85     JSTESTS_EXTRA_ARGS="${jstests_extra_args[*]}" \
86     JITTEST_EXTRA_ARGS="${jittest_extra_args[*]}" \
87     JITTEST_TEST_ARGS="${jittest_test_args[*]}"
90 package() {
91   cd firefox-$_relver/obj
92   make DESTDIR="$pkgdir" install
93   rm "$pkgdir"/usr/lib/*.ajs
94   find "$pkgdir"/usr/{lib/pkgconfig,include} -type f -exec chmod -c a-x {} +
97 # vim:set ts=2 sw=2 et: