summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: eae04f02f288110b0c24703ce3dd3c31718615f0 (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
# Maintainer: Fabian Bornschein <fabiscafe@archlinux.org>
# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Ionut Biru <ibiru@archlinux.org>

pkgname=gjs-nohammer
pkgver=1.82.1
pkgrel=2
epoch=2
pkgdesc="Javascript Bindings for GNOME"
url="https://wiki.gnome.org/Projects/Gjs"
arch=(x86_64)
license=(LGPL-2.0-or-later)
depends=(
  cairo
  dconf
  gcc-libs
  glib2
  glibc
  gobject-introspection-runtime
  js128
  libffi
  libgirepository
  libsysprof-capture
  libx11
  readline
)
makedepends=(
  dbus
  git
  gobject-introspection
  meson
)
checkdepends=(
  gtk3
  gtk4
  xorg-server-xvfb
)
provides=(libgjs.so gjs)
conflicts=(gjs)
source=("git+https://gitlab.gnome.org/GNOME/gjs.git#tag=$pkgver"
        "git+https://gitlab.gnome.org/GNOME/gobject-introspection-tests.git"
        nohammer.patch)
b2sums=('db5fa6aea38f73baddc27643ffc09154fec12aa135a2943e8c6fc782efd053c1787d8fd5251fb605aef96dedb94ea11d8de4707c11f790c3da7a6d7eacb471d2'
        'SKIP'
        'SKIP')

prepare() {
  cd gjs

  git submodule init
  git submodule set-url subprojects/gobject-introspection-tests "${srcdir}/gobject-introspection-tests"
  git -c protocol.file.allow=always -c protocol.allow=never submodule update
  
  patch -Np1 < ../nohammer.patch

  # printf() supports %I alternative int syntax
  ## Meson disables code optimization (sets -O0) during the dependency-check phase.
  ## This causes conflicts with the default Arch build flag -D_FORTIFY_SOURCE=3,
  ## leading to the following warning (and a failed dependency check due to -Werror):
  ##     # warning: _FORTIFY_SOURCE requires compiling with optimization (-O)
  ## This adjustment offers a workaround for the issue.
  ## https://gitlab.gnome.org/GNOME/gjs/-/issues/671
  sed -i "s/'-Werror'/'-Werror=format'/" meson.build
}

build() {
  local meson_options=(
    -D installed_tests=false
  )

  arch-meson gjs build "${meson_options[@]}"
  meson compile -C build
}

check() {
  dbus-run-session xvfb-run -s '-nolisten local' \
    meson test -C build --print-errorlogs
}

package() {
  depends+=(libreadline.so)
  meson install -C build --destdir "$pkgdir"
}

# vim:set sw=2 sts=-1 et: