Files
termux-packages/x11-packages/codelldb/code-oss-extension-codelldb.subpackage.sh
termux-pacman-bot d610e90ed7 addpkg(x11/codelldb): split from vsix-package-codelldb
- Originally, in https://github.com/termux/termux-packages/pull/24716, I implemented only the `.vsix` package because that is what is required for using codelldb with `code-oss`, which is the only way that I personally use it. However, I did not realize at the time that it was possible to use codelldb with **non-VSCode-based editors**, and that people who use it outside of any VSCode-based editor **need to directly execute the binary**, making it important for that binary to be available in `$TERMUX_PREFIX/bin`.

- **This PR implements the following three commands that do _not_ currently work/exist in Termux**:
  - `pkg install codelldb`
  - `codelldb`
  - `python -c "import codelldb"`

- This heavily patches and organizes the package in such a way that the needs of @BenVella, the user of codelldb in Termux, are better met - for their case, using codelldb inside NeoVIM: https://github.com/vadimcn/codelldb/discussions/1278#discussioncomment-14059990

- All of the the preexisting functionality of both the `vsix-package-codelldb` package and the `code-oss-extension-codelldb` package should remain working and available after this reorganization.

- Also, properly marks the subpackage as **not** platform-independent by inheritance of the property from its dependencies. For more information, see: https://github.com/termux/termux-packages/pull/25306
2025-08-13 18:44:03 +00:00

26 lines
815 B
Bash

TERMUX_SUBPKG_DESCRIPTION="A native debugger extension for code-oss based on LLDB"
TERMUX_SUBPKG_INCLUDE="share/doc/code-oss-extension-codelldb"
TERMUX_SUBPKG_DEPENDS="code-oss, vsix-package-codelldb"
# depends on vsix-package-codelldb,
# which depends on codelldb,
# which depends on lldb,
# which does not exist on 32-bit
TERMUX_SUBPKG_PLATFORM_INDEPENDENT=false
termux_step_create_subpkg_debscripts() {
cat <<-EOF >./postinst
#!${TERMUX_PREFIX}/bin/sh
code-oss --install-extension "$TERMUX_PREFIX/opt/vsix-packages/codelldb-$TERMUX_PKG_FULLVERSION.vsix"
exit 0
EOF
cat <<-EOF >./prerm
#!${TERMUX_PREFIX}/bin/sh
if [ "$TERMUX_PACKAGE_FORMAT" = "debian" ] && [ "\$1" != "remove" ]; then
exit 0
fi
code-oss --uninstall-extension vadimcn.vscode-lldb
exit 0
EOF
chmod +x ./postinst ./prerm
}