0
0
mirror of https://github.com/termux/termux-packages.git synced 2025-08-07 03:21:49 +00:00
Files
termux-packages/packages/typst/build.sh
Termux Github Actions 66c70de96b bump(main/typst): 0.13.0
This commit has been automatically submitted by Github Actions.
2025-02-24 08:30:04 +00:00

48 lines
1.7 KiB
Bash

TERMUX_PKG_HOMEPAGE=https://typst.app/
TERMUX_PKG_DESCRIPTION="A new markup-based typesetting system that is powerful and easy to learn"
TERMUX_PKG_LICENSE="Apache-2.0"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION="0.13.0"
TERMUX_PKG_SRCURL="https://github.com/typst/typst/archive/refs/tags/v${TERMUX_PKG_VERSION}.tar.gz"
TERMUX_PKG_SHA256=5a7224e32a555ac647ff202667a183b80d35539b685b3ce64bedf5d4e5a1a286
TERMUX_PKG_BUILD_IN_SRC=true
TERMUX_PKG_AUTO_UPDATE=true
TERMUX_PKG_UPDATE_VERSION_REGEXP="\d+\.\d+\.\d+"
TERMUX_PKG_DEPENDS="openssl"
termux_step_pre_configure() {
termux_setup_rust
: "${CARGO_HOME:=$HOME/.cargo}"
export CARGO_HOME
cargo vendor
echo "" >> Cargo.toml
echo '[patch.crates-io]' >> Cargo.toml
echo 'time = { path = "./vendor/time" }' >> Cargo.toml
}
termux_step_make() {
termux_setup_rust
export GEN_ARTIFACTS=artifacts
export OPENSSL_NO_VENDOR=1
cargo build --jobs $TERMUX_PKG_MAKE_PROCESSES -p typst-cli --target $CARGO_TARGET_NAME --release
}
termux_step_make_install() {
install -Dm700 -t $TERMUX_PREFIX/bin target/${CARGO_TARGET_NAME}/release/typst
local _artifacts="crates/typst-cli/artifacts"
install -Dm644 -t "${TERMUX_PREFIX}/share/man/man1/" "${_artifacts}/${TERMUX_PKG_NAME}"*.1
install -Dm644 -t "${TERMUX_PREFIX}/share/zsh/site-functions/" "${_artifacts}/_${TERMUX_PKG_NAME}"
install -Dm644 -t "${TERMUX_PREFIX}/share/fish/vendor_completions.d/" "${_artifacts}/${TERMUX_PKG_NAME}.fish"
install -Dm644 "${_artifacts}/${TERMUX_PKG_NAME}.bash" "${TERMUX_PREFIX}/share/bash-completion/completions/${TERMUX_PKG_NAME}"
}
termux_step_post_make_install() {
# Remove the vendor sources to save space
rm -rf "$TERMUX_PKG_SRCDIR"/vendor
}