kak-lsp: add package

This commit is contained in:
Butta 2021-08-19 01:12:20 +05:30 committed by buttaface
parent aa5e737530
commit 7e5fdc0c7d
2 changed files with 32 additions and 0 deletions

19
packages/kak-lsp/build.sh Normal file
View File

@ -0,0 +1,19 @@
TERMUX_PKG_HOMEPAGE=https://github.com/kak-lsp/kak-lsp
TERMUX_PKG_DESCRIPTION="Language Server Protocol Client for the Kakoune editor"
TERMUX_PKG_LICENSE="MIT, Unlicense"
TERMUX_PKG_MAINTAINER="@buttaface"
TERMUX_PKG_VERSION=10.0.0
TERMUX_PKG_SRCURL=https://github.com/kak-lsp/kak-lsp/archive/v$TERMUX_PKG_VERSION.tar.gz
TERMUX_PKG_SHA256=6e674c2299a11938474100a15ce2c1052320d32b7b7cd1817fe8428b23bf3a18
TERMUX_PKG_BUILD_IN_SRC=true
termux_step_pre_configure() {
rm Makefile
}
termux_step_post_make_install() {
rm -rf $TERMUX_PREFIX/share/kak-lsp
mkdir -p $TERMUX_PREFIX/share/kak-lsp/examples
cp $TERMUX_PKG_SRCDIR/kak-lsp.toml $TERMUX_PREFIX/share/kak-lsp/examples
cp -r $TERMUX_PKG_SRCDIR/rc $TERMUX_PREFIX/share/kak-lsp
}

View File

@ -0,0 +1,13 @@
diff --git a/src/text_edit.rs b/src/text_edit.rs
index 78797ef..6de790c 100644
--- a/src/text_edit.rs
+++ b/src/text_edit.rs
@@ -108,7 +108,7 @@ pub fn apply_text_edits_to_file(
apply_text_edits_to_file_impl(text, temp_file, text_edits, offset_encoding)
.and_then(|_| std::fs::rename(&temp_path, filename))
.map(|_| unsafe {
- libc::chmod(path.as_ptr(), stat.st_mode);
+ libc::chmod(path.as_ptr(), stat.st_mode as libc::mode_t);
})
.map_err(|e| {
let _ = std::fs::remove_file(&temp_path);