Skip to content

Commit

Permalink
typst-lsp: revbump to rebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
licy183 committed Aug 25, 2024
1 parent 9d0b62f commit abd7900
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
19 changes: 19 additions & 0 deletions packages/typst-lsp/build.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
TERMUX_PKG_HOMEPAGE=https://github.com/nvarner/typst-lsp
TERMUX_PKG_DESCRIPTION="Language server for Typst"
TERMUX_PKG_LICENSE="MIT, Apache-2.0"
TERMUX_PKG_LICENSE_FILE="LICENSE-MIT.txt, LICENSE-Apache-2.0.txt"
TERMUX_PKG_MAINTAINER="Joshua Kahn @TomJo2000"
TERMUX_PKG_VERSION=0.13.0
TERMUX_PKG_REVISION=1
TERMUX_PKG_SRCURL=https://github.com/nvarner/typst-lsp/archive/refs/tags/v${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=860d56653b719402736b00ac9bc09e5e418dea2577cead30644252e85ab5d1a1
TERMUX_PKG_BUILD_IN_SRC=true
Expand All @@ -12,4 +14,21 @@ termux_step_pre_configure() {
# We're not shipping the VS Code plugin
rm -rf .vscode
termux_setup_rust

: "${CARGO_HOME:=$HOME/.cargo}"
export CARGO_HOME

cargo vendor
patch --silent -p1 \
-d ./vendor/time/ \
< "$TERMUX_PKG_BUILDER_DIR"/time-items-format_items.diff

echo "" >> Cargo.toml
echo '[patch.crates-io]' >> Cargo.toml
echo 'time = { path = "./vendor/time" }' >> Cargo.toml
}

termux_step_post_make_install() {
# Remove the vendor sources to save space
rm -rf "$TERMUX_PKG_SRCDIR"/vendor
}
15 changes: 15 additions & 0 deletions packages/typst-lsp/time-items-format_items.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
https://github.com/time-rs/time/pull/671

--- a/src/format_description/parse/mod.rs
+++ b/src/format_description/parse/mod.rs
@@ -80,9 +80,7 @@ pub fn parse_owned<const VERSION: usize>(
let mut lexed = lexer::lex::<VERSION>(s.as_bytes());
let ast = ast::parse::<_, VERSION>(&mut lexed);
let format_items = format_item::parse(ast);
- let items = format_items
- .map(|res| res.map(Into::into))
- .collect::<Result<Box<_>, _>>()?;
+ let items = format_items.collect::<Result<Box<_>, _>>()?;
Ok(items.into())
}

0 comments on commit abd7900

Please sign in to comment.