summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 34602d7519a2723dc9bb21ec4806cdddfea3a8bc (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
# Maintainer: Aikawa Yataro <aikawayataro at protonmail dot com>
# Contributor: Evangelos Foutras <foutrelis@archlinux.org>
# Contributor: Jan "heftig" Steffens <jan.steffens@gmail.com>

# This package is based on extra/lldb

pkgname=lldb-zig-git
pkgver=r525112.d95039d
pkgrel=2
pkgdesc="Next generation, high-performance debugger (jacobly0 Zig patch)"
arch=('x86_64')
url="https://lldb.llvm.org/"
license=('Apache-2.0 WITH LLVM-exception')
depends=('gcc-libs' 'zlib' 'xz' 'libedit' 'ncurses'
         'libxml2' 'python')
makedepends=('cmake' 'ninja' 'swig')
source=('jacobly0-llvm-project::git+https://github.com/jacobly0/llvm-project.git#branch=lldb-zig')
sha256sums=('SKIP')

pkgver() {
  cd jacobly0-llvm-project
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
}

prepare() {
  mkdir jacobly0-llvm-project/build -p
}

build() {
  cd jacobly0-llvm-project/build

  # Build only minimal debug info to reduce size
  CFLAGS=${CFLAGS/-g /-g1 }
  CXXFLAGS=${CXXFLAGS/-g /-g1 }

  local cmake_args=(
    -G Ninja
    -DLLVM_ENABLE_PROJECTS="clang;lldb"
    -DCMAKE_BUILD_TYPE=Release
    -DCMAKE_INSTALL_PREFIX=/usr/lib/lldb-zig
    -DCLANG_LINK_CLANG_DYLIB=ON
    -DLLVM_LINK_LLVM_DYLIB=ON
  )
  cmake "${cmake_args[@]}" ../llvm
  ninja lldb lldb-server
}

package() {
  cd jacobly0-llvm-project/build

  DESTDIR="$pkgdir" ninja install
  install -d "$pkgdir/usr/bin"
  ln -sf /usr/lib/lldb-zig/bin/lldb "$pkgdir/usr/bin/lldb-zig"
  ln -sf /usr/lib/lldb-zig/bin/lldb-server "$pkgdir/usr/bin/lldb-server-zig"

  install -Dm644 ../LICENSE.TXT "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

  # Compile Python scripts
  python -m compileall -d /usr/lib "$pkgdir/usr/lib"
  python -O -m compileall -d /usr/lib "$pkgdir/usr/lib"
  python -OO -m compileall -d /usr/lib "$pkgdir/usr/lib"
}

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