Skip to content

Commit

Permalink
miniserve: revbump to rebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
licy183 committed Aug 27, 2024
1 parent 88bb2f4 commit c49d85b
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
16 changes: 16 additions & 0 deletions packages/miniserve/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ TERMUX_PKG_DESCRIPTION="Tool to serve files and dirs over HTTP"
TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION="0.27.1"
TERMUX_PKG_REVISION=1
TERMUX_PKG_SRCURL=https://github.com/svenstaro/miniserve/archive/v$TERMUX_PKG_VERSION.tar.gz
TERMUX_PKG_SHA256=b65580574ca624072b1a94d59ebf201ab664eacacb46a5043ef7b81ebb538f80
TERMUX_PKG_AUTO_UPDATE=true
Expand All @@ -11,6 +12,18 @@ TERMUX_PKG_BUILD_IN_SRC=true
termux_step_pre_configure() {
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

rm -f Makefile
}

Expand All @@ -22,6 +35,9 @@ termux_step_post_make_install() {

# manpage
install -Dm644 /dev/null "$TERMUX_PREFIX"/share/man/man1/miniserve.1

# remove the vendor sources to save space
rm -rf "$TERMUX_PKG_SRCDIR"/vendor
}

termux_step_create_debscripts() {
Expand Down
15 changes: 15 additions & 0 deletions packages/miniserve/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 c49d85b

Please sign in to comment.