bageljr: I fixed the PKGBUILD. The binary was failing because it couldn't find liblldb.so
(that is solved by creating a directory structure such that ../lldb/lib/liblldb.so
exists, in our case this is done with a symlink) and libcodelldb.so
(the binary itself is just a small entry point that loads the dylib and calls the real main function from there). There are also a few Python scripts that needed packaging, and I removed -DCMAKE_BUILD_TYPE=None
because it was preventing the Rust program from being built with the --release
flag (and debug builds are massive). Anyway, the diff:
diff --git a/PKGBUILD b/PKGBUILD
index 2f794ce..de2d6b5 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,24 +1,44 @@
-#Maintainer: bageljr <bageljr 897 at protonmail dot com>
+#Maintainer: bageljr <bageljr 897 at protonmail dot com>
pkgname=codelldb
_reponame=vscode-lldb
-pkgdesc="also known as vscode-lldb (NOT lldb-vscode). A native debugger extension for VSCode based on LLDB"
+pkgdesc="A native debugger extension for VSCode based on LLDB. Also known as vscode-lldb (NOT lldb-vscode)."
pkgver=1.7.0
-pkgrel=1
-url=https://github.com/vadimcn/vscode-lldb
-arch=("x86_64")
-license=("MIT")
+pkgrel=2
+url="https://github.com/vadimcn/$_reponame"
+arch=("x86_64" "aarch64" "arm7h")
+license=("custom:MIT")
options=(!debug strip) #Debug package is broken
source=("$_reponame.tar.gz::https://github.com/vadimcn/$_reponame/archive/refs/tags/v$pkgver.tar.gz")
sha256sums=("275dac810e6b20584f1b82b785fdee28539eda1b9f8b9395dd74441b43f11b3b")
depends=(lldb)
makedepends=(cmake cargo npm python)
+
build() {
- export CFLAGS=""
- mkdir -p build
- cmake $_reponame-$pkgver -B build -DLLDB_PACKAGE=/usr -DCMAKE_BUILD_TYPE=None -DCMAKE_INSTALL_PREFIX=/usr -Wno-dev
- cd build
- make codelldb
+ cd "$_reponame-$pkgver"
+ cmake -B build -DLLDB_PACKAGE=/usr -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -Wno-dev
+ cmake --build build --target codelldb
}
+
package() {
- install -D build/adapter/codelldb $pkgdir/usr/bin/codelldb
+ local reset_shopt="$(shopt -p globstar)"
+ shopt -s globstar
+
+ cd "$_reponame-$pkgver"
+ local _lib_dir="$pkgdir/usr/lib/codelldb"
+
+ # <https://github.com/vadimcn/vscode-lldb/blob/v1.7.0/CMakeLists.txt#L173-L186>
+ install -Dm644 -t "$_lib_dir" build/platform.ok
+ install -Dm755 -t "$_lib_dir"/adapter build/adapter/{codelldb,*.so}
+ install -Dm644 -t "$_lib_dir"/adapter build/adapter/*.py
+ install -Dm644 -t "$_lib_dir"/formatters build/formatters/**/*.py
+
+ install -d "$_lib_dir"/lldb
+ ln -s -t "$_lib_dir"/lldb /usr/{bin,lib}
+
+ install -d "$pkgdir"/usr/bin
+ ln -s -t "$pkgdir"/usr/bin "$_lib_dir"/adapter/codelldb
+
+ install -Dm644 -t "$pkgdir"/usr/share/licenses/"$pkgname" LICENSE
+
+ eval "$reset_shopt"
}
Pinned Comments
mahor1221 commented on 2022-10-05 15:51 (UTC) (edited on 2022-10-15 11:51 (UTC) by mahor1221)
After hours of searching I couldn't build the custom LLDB this package depends on (only needed when debugging Rust binaries). It's a rabbit hole which I don't want to step into it.
I suggest installing codelldb-bin to debug Rust programs