summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 79ba3a81a983fd5cd30cf8e41c2e7de9f68deb60 (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
# Maintainer: fossdd <fossdd@tutanota.com>
# Maintainer: Eric Engestrom <aur@engestrom.ch>

pkgname=muon-meson-git
_pkgname=${pkgname%-meson-git}
pkgver=0.2.0+13.gdc432474c0
pkgrel=1
pkgdesc='meson implementation in C'
url='https://sr.ht/~lattis/muon'
license=(GPL3)
arch=(x86_64)
depends=(pkgconf curl zlib libarchive)
makedepends=(git ninja python-yaml scdoc glib2-devel)
conflicts=(muon-meson)
provides=(muon)
source=("git+https://git.sr.ht/~lattis/muon")
sha256sums=('SKIP')

pkgver() {
  cd "${_pkgname}"
  set -o pipefail
  git describe --long --tags --abbrev=10 | sed 's/-/+/; s/-/./g'
}

build() {
  cd "$_pkgname"
  rm -rf build*

  msg2 "Building stage 1 (bootstrap)"
  ./bootstrap.sh build-stage1

  msg2 "Building stage 2 (muon from bootstrap)"
  build-stage1/muon setup build-stage2
  ninja -C build-stage2

  msg2 "Building stage 3 (muon from muon)"
  build-stage2/muon setup \
    -D prefix=/usr \
    -D b_lto=true \
    -D b_pie=true \
    build
  ninja -C build
}

check() {
  cd "$_pkgname/build"
  ./muon test
}

package() {
  cd "$_pkgname/build"
  DESTDIR="$pkgdir" ./muon install

  # remove this as the `meson` package also provides it
  # muon only has a `docs` option right now, so
  # downloading/generating/deleting is the only option :/
  rm "$pkgdir"/usr/share/man/man3/meson-reference.3
}