commit: b4fb1188ea012a20c19e6775ac1c81a4cdcb849d Author: odrling <florianbadie <AT> odrling <DOT> xyz> AuthorDate: Fri Dec 12 15:15:06 2025 +0000 Commit: Florian Badie <florianbadie <AT> mailbox <DOT> org> CommitDate: Fri Dec 12 15:20:46 2025 +0000 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=b4fb1188
app-text/typst: update live ebuild to support releases so we don’t have two slightly different versions of the same ebuild Signed-off-by: odrling <florianbadie <AT> odrling.xyz> app-text/typst/typst-9999.ebuild | 42 +++++++++++++++++++++++++++++++++++----- 1 file changed, 37 insertions(+), 5 deletions(-) diff --git a/app-text/typst/typst-9999.ebuild b/app-text/typst/typst-9999.ebuild index 46dc28243b..7f3bd38735 100644 --- a/app-text/typst/typst-9999.ebuild +++ b/app-text/typst/typst-9999.ebuild @@ -1,14 +1,25 @@ -# Copyright 2024 Gentoo Authors +# Copyright 2024-2025 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 +RUST_MIN_VER="1.89" + inherit cargo shell-completion -inherit git-r3 DESCRIPTION="A markup-based typesetting system for the sciences" HOMEPAGE="https://typst.app" -EGIT_REPO_URI="https://github.com/typst/typst.git" + +if [ ${PV} == 9999 ]; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/typst/typst.git" +else + SRC_URI=" + https://github.com/${PN}/${PN}/archive/v${PV}/${P}.tar.gz + https://github.com/odrling/typst/releases/download/v${PV}/typst-vendor.tar.xz -> ${P}-vendor.tar.xz + " + KEYWORDS="~amd64 ~arm64" +fi LICENSE="Apache-2.0" # Dependent crate licenses @@ -30,12 +41,33 @@ QA_FLAGS_IGNORED="usr/bin/typst" DOCS=( README.md ) +if [ ${PV} != 9999 ]; then + ECARGO_VENDOR="${WORKDIR}/vendor" +fi + src_unpack() { - git-r3_src_unpack - cargo_live_src_unpack + if [ ${PV} == 9999 ]; then + git-r3_src_unpack + cargo_live_src_unpack + else + cargo_src_unpack + fi +} + +src_prepare() { + if [ ${PV} != 9999 ]; then + # ignore git repo for typst-dev-assets when using a vendor tarball + sed -i 's/^typst-dev-assets.*$/typst-dev-assets = "*"/' Cargo.toml || die + fi + + default } src_compile() { + if [ ${PV} != 9999 ]; then + local GIT_HASH=$(gunzip < "${DISTDIR}/${P}.tar.gz" | git get-tar-commit-id) + export TYPST_VERSION="${PV} (${GIT_HASH::8})" + fi export GEN_ARTIFACTS="artifacts/" cargo_src_compile
