From f38d938a2bf82ba37f779a207bb27fad29522645 Mon Sep 17 00:00:00 2001 From: madomado Date: Sat, 24 May 2025 20:41:07 +0800 Subject: [PATCH] add: typst (#4945) * add: typst * Update rust-typst.spec Signed-off-by: madomado * ? Signed-off-by: madomado * let's try this cursed way of packaging stuff * Update rust-typst.spec * a * Update rust-typst.spec Signed-off-by: madomado * remove crate file * no more devel Signed-off-by: madomado * no defasult devel Signed-off-by: madomado * Update rust-typst.spec Signed-off-by: madomado * Update rust-typst.spec Signed-off-by: madomado --------- Signed-off-by: madomado --- anda/langs/rust/typst/anda.hcl | 5 ++ anda/langs/rust/typst/rust-typst.spec | 114 ++++++++++++++++++++++++++ anda/langs/rust/typst/update.rhai | 1 + 3 files changed, 120 insertions(+) create mode 100644 anda/langs/rust/typst/anda.hcl create mode 100644 anda/langs/rust/typst/rust-typst.spec create mode 100644 anda/langs/rust/typst/update.rhai diff --git a/anda/langs/rust/typst/anda.hcl b/anda/langs/rust/typst/anda.hcl new file mode 100644 index 0000000000..def2098125 --- /dev/null +++ b/anda/langs/rust/typst/anda.hcl @@ -0,0 +1,5 @@ +project pkg { + rpm { + spec = "rust-typst.spec" + } +} diff --git a/anda/langs/rust/typst/rust-typst.spec b/anda/langs/rust/typst/rust-typst.spec new file mode 100644 index 0000000000..d6b435d967 --- /dev/null +++ b/anda/langs/rust/typst/rust-typst.spec @@ -0,0 +1,114 @@ +# Generated by rust2rpm 27 +%bcond check 0 + +%global crate typst + +Name: rust-typst +Version: 0.13.1 +Release: %autorelease +Summary: New markup-based typesetting system that is powerful and easy to learn + +License: Apache-2.0 +URL: https://typst.app +Source: https://github.com/typst/typst/archive/refs/tags/v%version.tar.gz +Packager: madonuko + +BuildRequires: anda-srpm-macros cargo-rpm-macros >= 24 +BuildRequires: pkgconfig(openssl) + +%global _description %{expand: +A new markup-based typesetting system that is powerful and easy to +learn.} + +%description %{_description} + +%package -n %crate +Summary: %{summary} +License: ((MIT OR Apache-2.0) AND Unicode-3.0) AND (0BSD OR MIT OR Apache-2.0) AND Apache-2.0 AND (Apache-2.0 OR BSL-1.0) AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND BSD-2-Clause AND (BSD-2-Clause OR Apache-2.0 OR MIT) AND BSD-3-Clause AND CC0-1.0 AND ISC AND MIT AND (MIT AND (MIT OR Apache-2.0)) AND (MIT OR Apache-2.0) AND (MIT OR Apache-2.0 OR CC0-1.0) AND (MIT OR Apache-2.0 OR Zlib) AND (MIT OR Zlib OR Apache-2.0) AND MPL-2.0 AND Unicode-3.0 AND (Unlicense OR MIT) AND Zlib AND (Zlib OR Apache-2.0 OR MIT) +Provides: %crate-cli = %version-%release + +%description -n %crate %{_description} + +%files -n %crate +%license LICENSE +%license LICENSE.dependencies +%doc README.md +%_bindir/typst +%_mandir/man1/typst-compile.1.gz +%_mandir/man1/typst-fonts.1.gz +%_mandir/man1/typst-init.1.gz +%_mandir/man1/typst-query.1.gz +%_mandir/man1/typst-update.1.gz +%_mandir/man1/typst-watch.1.gz +%_mandir/man1/typst.1.gz + + +%package bash-completion +Summary: Bash completion for %{crate} +Requires: %{crate} = %{version}-%{release} +Requires: bash-completion +Supplements: (%{crate} and bash-completion) + +%description bash-completion +Bash command line completion support for %{crate}. + +%package fish-completion +Summary: Fish completion for %{crate} +Requires: %{crate} = %{version}-%{release} +Requires: fish +Supplements: (%{crate} and fish) + +%description fish-completion +Fish command line completion support for %{crate}. + +%package zsh-completion +Summary: Zsh completion for %{crate} +Requires: %{crate} = %{version}-%{release} +Requires: zsh +Supplements: (%{crate} and zsh) + +%description zsh-completion +Zsh command line completion support for %{crate}. + + +%files bash-completion +%{bash_completions_dir}/%{crate} + +%files fish-completion +%{fish_completions_dir}/%{crate}.fish + +%files zsh-completion +%{zsh_completions_dir}/_%{crate} + + +%prep +%autosetup -n %{crate}-%{version} -p1 +%cargo_prep_online +pushd crates/%{crate}-cli +%cargo_prep_online +popd + +%build +pushd crates/%{crate}-cli +%{cargo_license_summary_online} +%{cargo_license_online} > ../../LICENSE.dependencies +popd +export TYPST_VERSION="%version" +export GEN_ARTIFACTS=artifacts/ +export OPENSSL_NO_VENDOR=true +%{cargo_build} -p typst-cli + +%install +#? https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=typst-git#n60 +_artifacts='crates/typst-cli/artifacts' +install -Dm755 -t %buildroot%_bindir target/rpm/%crate +install -Dm644 -t %buildroot%_mandir/man1 $_artifacts/%{crate}*.1 +install -Dm644 -t %buildroot%zsh_completions_dir $_artifacts/_%crate +install -Dm644 -t %buildroot%fish_completions_dir $_artifacts/%crate.fish +# no .bash suffix +install -Dm644 $_artifacts/%crate.bash %buildroot%bash_completions_dir/%crate + +%if %{with check} +%check +%cargo_test +%endif diff --git a/anda/langs/rust/typst/update.rhai b/anda/langs/rust/typst/update.rhai new file mode 100644 index 0000000000..be8c5fed1d --- /dev/null +++ b/anda/langs/rust/typst/update.rhai @@ -0,0 +1 @@ +rpm.version(crates("typst"));