summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 7f3f59e0324de9177592b0674ba0e75537cf1e1b (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
# Maintainer: Peter Jung ptr1337 <admin@ptr1337.dev>

pkgname=mold-git
pkgver=v2.1.0_109_g9e09e74d
pkgrel=1
pkgdesc="A Modern Linker"
arch=(x86_64)
url="https://github.com/rui314/mold"
license=("AGPL3")
# xxhash is bundled
depends=('gcc-libs' 'mimalloc' 'openssl' 'zlib' 'tbb')
makedepends=('git' 'python' 'cmake' 'mold')
checkdepends=('clang' 'libdwarf')
source=("mold::git+https://github.com/rui314/mold")
sha256sums=('SKIP')
provides=("mold=$pkgver")
conflicts=("mold")
_reponame="mold"

pkgver() {
    cd "$_reponame"
    git describe --long --tags | sed "s/-/_/g"
}


build() {
  cmake \
  -S "$_reponame" \
  -B build \
  -DCMAKE_BUILD_TYPE='None' \
  -DCMAKE_INSTALL_PREFIX='/usr' \
  -DCMAKE_INSTALL_LIBEXECDIR='lib' \
  -DMOLD_USE_SYSTEM_MIMALLOC=ON \
  -DMOLD_USE_SYSTEM_TBB=ON \
  -DMOLD_USE_MOLD=ON \
  -DMOLD_LTO=ON

  cmake --build build
}


check() {
  ctest --test-dir build --output-on-failure
}

package() {
  DESTDIR="$pkgdir" cmake --install build
}