summaryrefslogtreecommitdiffstats
path: root/abs/extra/js52/PKGBUILD
blob: 9f798582f76574651b5358fd9d1fdac5fb7b9588 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>

pkgname=js52
pkgver=52.9.0
pkgrel=4
pkgdesc="JavaScript interpreter and libraries - Version 52"
arch=(x86_64)
url="https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey"
license=(MPL)
depends=(gcc-libs readline zlib sh)
makedepends=(python2 zip autoconf2.13)
_relver=${pkgver}esr
source=(https://archive.mozilla.org/pub/firefox/releases/$_relver/source/firefox-$_relver.source.tar.xz
        mozjs52-copy-headers.patch
        mozjs52-disable-mozglue.patch
        mozjs52-disable-wformat.patch)
sha256sums=('c01d09658c53c1b3a496e353a24dad03b26b81d3b1d099abc26a06f81c199dd6'
            'c5b3a88e4d10ef149aba6fc48d431db54ff266323fa22a5d549028fd794423cc'
            '5a84f02521f37de873991dd360a4c4bfdbdd2fb4a218e11be73f9cbbf02050e8'
            '4c5a1662e36c6a5a11db0263bb264d104ff801789d5b6bc6a6104439457afb90')

# Make sure the duplication between bin and lib is found
COMPRESSZST+=(--long)

prepare() {
  cd firefox-$_relver
  mkdir obj

  # https://salsa.debian.org/gnome-team/mozjs52/tree/debian/master/debian/patches
  patch -Np1 -i ../mozjs52-copy-headers.patch
  patch -Np1 -i ../mozjs52-disable-mozglue.patch

  # New errors in test code as of GCC 9
  patch -Np1 -i ../mozjs52-disable-wformat.patch
}

build() {
  local configure_args=(
    --prefix=/usr
    --disable-debug
    --disable-debug-symbols
    --disable-jemalloc
    --disable-strip
    --enable-gold
    --enable-optimize="-O2"
    --enable-pie
    --enable-posix-nspr-emulation
    --enable-readline
    --enable-release
    --enable-shared-js
    --enable-tests
    --with-intl-api
    --with-system-zlib
    --without-system-icu
  ) flags=(
    -fno-delete-null-pointer-checks
    -fno-strict-aliasing
    -fno-tree-vrp
  )

  cd firefox-$_relver/obj

  unset CPPFLAGS
  CFLAGS+=" ${flags[*]}"
  CXXFLAGS+=" ${flags[*]}"
  export CC=gcc CXX=g++ PYTHON=/usr/bin/python2

  sh ../js/src/configure "${configure_args[@]}"
  make
}

check() {
  local jstests_extra_args=(
    --format=none
    --exclude-random
  ) jittest_extra_args=(
    --format=none
    --timeout 300
  ) jittest_test_args=(
    basic
  )

  cd firefox-$_relver/obj
  make -C js/src check-jstests check-jit-test \
    JSTESTS_EXTRA_ARGS="${jstests_extra_args[*]}" \
    JITTEST_EXTRA_ARGS="${jittest_extra_args[*]}" \
    JITTEST_TEST_ARGS="${jittest_test_args[*]}"
}

package() {
  cd firefox-$_relver/obj
  make DESTDIR="$pkgdir" install
  rm "$pkgdir"/usr/lib/*.ajs
  find "$pkgdir"/usr/{lib/pkgconfig,include} -type f -exec chmod -c a-x {} +
}

# vim:set ts=2 sw=2 et: