mirror of
https://github.com/termux/termux-packages
synced 2024-06-18 17:19:45 +00:00
new package: mdbook-cat-prep
This commit is contained in:
parent
63aa5d4e0d
commit
44d663143d
43
packages/mdbook-cat-prep/build.sh
Normal file
43
packages/mdbook-cat-prep/build.sh
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
TERMUX_PKG_HOMEPAGE=https://github.com/gjk-cat/cat-prep
|
||||||
|
TERMUX_PKG_DESCRIPTION="A preprocessor for mdbook which provides teacher, subject, material and tag functionality"
|
||||||
|
TERMUX_PKG_LICENSE="Fair"
|
||||||
|
TERMUX_PKG_LICENSE_FILE="LICENSE"
|
||||||
|
TERMUX_PKG_MAINTAINER="@termux"
|
||||||
|
_COMMIT=fbf5ca360337452ca5ef7437d64c2efd7d891aec
|
||||||
|
TERMUX_PKG_VERSION=1.0.9
|
||||||
|
TERMUX_PKG_SRCURL=https://github.com/gjk-cat/cat-prep.git
|
||||||
|
TERMUX_PKG_GIT_BRANCH=master
|
||||||
|
TERMUX_PKG_BUILD_IN_SRC=true
|
||||||
|
|
||||||
|
termux_step_post_get_source() {
|
||||||
|
git fetch --unshallow
|
||||||
|
git checkout $_COMMIT
|
||||||
|
|
||||||
|
local ver=$(sed -En 's/^version = "([^"]+)".*/\1/p' Cargo.toml)
|
||||||
|
if [ "${ver}" != "${TERMUX_PKG_VERSION#*:}" ]; then
|
||||||
|
termux_error_exit "Version string '$TERMUX_PKG_VERSION' does not seem to be correct."
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
termux_step_pre_configure() {
|
||||||
|
termux_setup_rust
|
||||||
|
|
||||||
|
: "${CARGO_HOME:=$HOME/.cargo}"
|
||||||
|
export CARGO_HOME
|
||||||
|
|
||||||
|
cargo fetch --target "${CARGO_TARGET_NAME}"
|
||||||
|
|
||||||
|
local _patch=$TERMUX_PKG_BUILDER_DIR/mdbook-src-renderer-html_handlebars-helpers-navigation.rs.diff
|
||||||
|
local d
|
||||||
|
for d in $CARGO_HOME/registry/src/github.com-*/mdbook-*; do
|
||||||
|
patch --silent -p1 -d ${d} < ${_patch} || :
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
termux_step_make() {
|
||||||
|
cargo build --jobs $TERMUX_MAKE_PROCESSES --target $CARGO_TARGET_NAME --release
|
||||||
|
}
|
||||||
|
|
||||||
|
termux_step_make_install() {
|
||||||
|
install -Dm700 -t $TERMUX_PREFIX/bin target/${CARGO_TARGET_NAME}/release/mdbook-cat-prep
|
||||||
|
}
|
|
@ -0,0 +1,37 @@
|
||||||
|
https://github.com/rust-lang/mdBook/commit/8f01d0234f708042ea8d0dc5cac63859b3f14cb1
|
||||||
|
|
||||||
|
From 13035baeae417e41ce98f49c072220de0e6e4075 Mon Sep 17 00:00:00 2001
|
||||||
|
From: mitchmindtree <mail@mitchellnordine.com>
|
||||||
|
Date: Fri, 22 Jul 2022 15:10:05 +1000
|
||||||
|
Subject: [PATCH] Workaround rust nightly borrowcheck error (#1860)
|
||||||
|
|
||||||
|
Surprisingly, this fixes the error filed at #1860!
|
||||||
|
|
||||||
|
This seems suspicious, perhaps indicative of a bug in Rust's non-lexical
|
||||||
|
lifetime handling?
|
||||||
|
|
||||||
|
The lifetimes in the `handlebars::Renderable::render` method signature
|
||||||
|
are quite complicated, and its unclear to me whether or not Rust is
|
||||||
|
catching some new safety edge-case that wasn't previously handled
|
||||||
|
correctly...
|
||||||
|
|
||||||
|
Possibly related to `drop` order, which I *think* is related to the
|
||||||
|
order of binding statements?
|
||||||
|
---
|
||||||
|
src/renderer/html_handlebars/helpers/navigation.rs | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/src/renderer/html_handlebars/helpers/navigation.rs b/src/renderer/html_handlebars/helpers/navigation.rs
|
||||||
|
index d3f6ca9086..65929bbfc1 100644
|
||||||
|
--- a/src/renderer/html_handlebars/helpers/navigation.rs
|
||||||
|
+++ b/src/renderer/html_handlebars/helpers/navigation.rs
|
||||||
|
@@ -149,8 +149,8 @@ fn render(
|
||||||
|
_h.template()
|
||||||
|
.ok_or_else(|| RenderError::new("Error with the handlebars template"))
|
||||||
|
.and_then(|t| {
|
||||||
|
- let mut local_rc = rc.clone();
|
||||||
|
let local_ctx = Context::wraps(&context)?;
|
||||||
|
+ let mut local_rc = rc.clone();
|
||||||
|
t.render(r, &local_ctx, &mut local_rc, out)
|
||||||
|
})?;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user