diff options
author | Tobias Ribizel <mail@ribizel.de> | 2024-11-01 00:05:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-01 00:05:00 +0100 |
commit | b4b3320f71d22d6475b70a50056d6eb1fd1057d2 (patch) | |
tree | 424d84e498e0d9d82a43d02ee29666b2cb9bca94 /var | |
parent | e35bc1f82d826513896e92dc429c885dbdb44856 (diff) | |
download | spack-b4b3320f71d22d6475b70a50056d6eb1fd1057d2.tar.gz spack-b4b3320f71d22d6475b70a50056d6eb1fd1057d2.tar.bz2 spack-b4b3320f71d22d6475b70a50056d6eb1fd1057d2.tar.xz spack-b4b3320f71d22d6475b70a50056d6eb1fd1057d2.zip |
typst: new package (#47293)
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/typst/package.py | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/typst/package.py b/var/spack/repos/builtin/packages/typst/package.py new file mode 100644 index 0000000000..b495b89482 --- /dev/null +++ b/var/spack/repos/builtin/packages/typst/package.py @@ -0,0 +1,37 @@ +# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +import re + +from spack.package import * + + +class Typst(CargoPackage): + """Typst is a new markup-based typesetting system for the sciences.""" + + homepage = "https://typst.app" + git = "https://github.com/typst/typst" + executables = ["^typst$"] + + maintainers("upsj") + + license("Apache-2.0", checked_by="upsj") + + version("0.12.0", commit="737895d769188f6fc154523e67a9102bc24c872e", tag="v0.12.0") + + depends_on("rust@1.81.0:") + depends_on("openssl") + depends_on("pkgconf", type="build") + + @classmethod + def determine_version(cls, exe): + output = Executable(exe)("--version", output=str, error=str) + match = re.search(r"typst ([0-9.]+)", output) + return match.group(1) if match else None + + def build(self, spec, prefix): + # The cargopackage installer doesn't allow for an option to install from a subdir + # see: https://github.com/rust-lang/cargo/issues/7599 + cargo("install", "--root", "out", "--path", "crates/typst-cli") |