summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Wong <wongandj@icloud.com>2025-06-06 13:46:44 -0400
committerHilton Chain <hako@ultrarare.space>2025-07-29 21:32:22 +0800
commit48470baef1152fa685954b711d748c49b6b48fbd (patch)
tree76b8aacaf8a62a1d379359e347868f5ed8a33070
parentd4f21203bd88a2e93bd6965f216b89ae8fcde250 (diff)
gnu: Add rust-hypher-0.1.
* gnu/packages/rust-sources.scm (rust-hypher-0.1): New variable. Change-Id: I4021e515c7b3d730850a139816a822521ef7df56 Signed-off-by: Hilton Chain <hako@ultrarare.space> Modified-by: Hilton Chain <hako@ultrarare.space>
-rw-r--r--gnu/packages/rust-sources.scm43
1 files changed, 43 insertions, 0 deletions
diff --git a/gnu/packages/rust-sources.scm b/gnu/packages/rust-sources.scm
index 709d728b07..bb8f0bc125 100644
--- a/gnu/packages/rust-sources.scm
+++ b/gnu/packages/rust-sources.scm
@@ -123,6 +123,49 @@
transliterating them. It supports Emoji and Chinese.")
(license license:bsd-3))))
+(define-public rust-hypher-0.1
+ (hidden-package
+ (package
+ (name "rust-hypher")
+ (version "0.1.5")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/typst/hypher")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "1r01hhgxp5fmz1bgy11ilajd67lgfh7kqvd258c58c6y3w3rxpjq"))
+ (modules '((guix build utils)))
+ ;; Pre-generated.
+ (snippet '(for-each delete-file (find-files "tries")))))
+ (build-system cargo-build-system)
+ (arguments
+ (list
+ #:skip-build? #t
+ #:cargo-package-crates ''("hypher")
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'regenerate
+ (lambda _
+ ;; Stop the attempted dependency retrieval for a bench-marking
+ ;; tool.
+ (substitute* "Cargo.toml" (("^members.+$") ""))
+ ;; --no-default-features lets us avoid using the upstream
+ ;; source's pre-generated tries when running the
+ ;; trie-regenerating "generate" test. We are throwing library
+ ;; binary away, anyways, because we only want the source.
+ ;; See also: <https://github.com/typst/hypher/issues/19>.
+ (false-if-exception
+ (invoke "cargo" "test" "--test" "generate"
+ "--no-default-features"))
+ (delete-file-recursively "target"))))))
+ (home-page "https://github.com/typst/hypher")
+ (synopsis "Separate words into syllables")
+ (description "@code{hypher} is a Rust library for syllabification.")
+ (license (list license:expat license:asl2.0)))))
+
(define-public rust-pcre2-utf32-0.2
(hidden-package
(package