# Contributor: Bartłomiej Piotrowski # Contributor: Rasmus Thomsen # Maintainer: pkgname=lldb # Note: Update together with llvm. pkgver=16.0.6 pkgrel=2 _llvmver=${pkgver%%.*} pkgdesc="Next generation, high-performance debugger" # riscv64: https://github.com/llvm/llvm-project/issues/55383 arch="all !riscv64" url="https://llvm.org/" license="Apache-2.0" depends_dev="$pkgname=$pkgver-r$pkgrel" makedepends=" clang-dev>=$_llvmver clang-static>=$_llvmver cmake doxygen gtest-dev libedit-dev libffi-dev libxml2-dev linux-headers llvm$_llvmver-dev llvm$_llvmver-static ncurses-dev py3-sphinx python3-dev samurai swig xz " subpackages="$pkgname-dev $pkgname-doc py3-$pkgname-pyc py3-$pkgname:py3" source="https://github.com/llvm/llvm-project/releases/download/llvmorg-${pkgver//_/-}/lldb-${pkgver//_/}.src.tar.xz https://github.com/llvm/llvm-project/releases/download/llvmorg-${pkgver//_/-}/cmake-${pkgver//_/}.src.tar.xz atomic.patch fix-embedded_interpreter.patch " builddir="$srcdir/$pkgname-${pkgver//_/}.src" options="!check" # FIXME: enable tests prepare() { default_prepare mv "$srcdir"/cmake-${pkgver//_/}.src "$srcdir"/cmake } build() { export CC=clang export CXX=clang++ case "$CARCH" in arm*) # binutils bugs ;; *) export CFLAGS="$CFLAGS -flto" export CXXFLAGS="$CXXFLAGS -flto" ;; esac cmake -B build -G Ninja -Wno-dev \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_SKIP_RPATH=ON \ -DLLDB_BUILT_STANDALONE=ON \ -DLLDB_INCLUDE_TESTS="$(want_check && echo ON || echo OFF)" \ -DLLVM_ENABLE_SPHINX=ON \ -DLLVM_LINK_LLVM_DYLIB=ON \ -DCMAKE_POSITION_INDEPENDENT_CODE=ON cmake --build build --target all docs-lldb-man } check() { ninja -C build check-lldb } package() { # backtracing/debugging pretty much anything is going to need libc debug symbols # not everything, but the common case needs this, and it's a small dep in comparison depends="musl-dbg" DESTDIR="$pkgdir" cmake --install build install -Dm644 build/docs/man/lldb.1 -t "$pkgdir"/usr/share/man/man1 python3 -m compileall -fq "$pkgdir"/usr/lib/python3* } dev() { default_dev # move back main symlink, because py3-lldb links to it mv "$subpkgdir"/usr/lib/liblldb.so "$pkgdir"/usr/lib/ } py3() { pkgdesc="Python3 module for LLDB" depends="$pkgname=$pkgver-r$pkgrel python3" replaces="py-lldb" amove usr/lib/python3.* } sha512sums=" 85c611c362d96b302df9b981bb9c8bd754938d0b55c5e24220f333300b48ac9bd3b7eb708be1f3ba9dcfbebe621e6562841b38d8458110452e5cc06c714e8d10 lldb-16.0.6.src.tar.xz 52ecd941d2d85a5b668caa5d0d40480cb6a97b3bf1174e634c2a93e9ef6d03670ca7e96abb0a60cb33ba537b93d5788754dab1f2f45c1f623f788162717d088b cmake-16.0.6.src.tar.xz 6493c9bbcaf3f99ffbb56967147716bc93aa13b6c525214abc22723162bf42d6c25663ed1e2e11f432a8c1b246a528149e240eae027ce752bc20cc928ed57272 atomic.patch fcd3f06b5f901d635bfe8edffa3951d5af402738ee55b13a98c992725eb35db17b7a3ca566eb94d48cd699be899f7402ae41da0d2f1ed4611afc5858a0eec561 fix-embedded_interpreter.patch "