From aa1aa2d6ae5044a27a8e625588afb7da7df1f97e Mon Sep 17 00:00:00 2001 From: Juniper <67175453+Ultrasquid9@users.noreply.github.com> Date: Mon, 5 May 2025 10:35:07 -0400 Subject: [PATCH] Make `syntect` use `fancy-regex` instead of `onig` The Oniguruma C library is archived, and fails to build correctly on many systems. Fancy-regex is Rust based and still actively updated, and is able to be built just fine. --- Cargo.lock | 35 ++++++++++++----------------------- Cargo.toml | 2 +- 2 files changed, 13 insertions(+), 24 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9b0feb46..c10f0d13 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1511,6 +1511,17 @@ dependencies = [ "zune-inflate", ] +[[package]] +name = "fancy-regex" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "998b056554fbe42e03ae0e152895cd1a7e1002aec800fdc6635d20270260c46f" +dependencies = [ + "bit-set", + "regex-automata", + "regex-syntax", +] + [[package]] name = "fast-srgb8" version = "1.0.0" @@ -3927,28 +3938,6 @@ version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" -[[package]] -name = "onig" -version = "6.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "336b9c63443aceef14bea841b899035ae3abe89b7c486aaf4c5bd8aafedac3f0" -dependencies = [ - "bitflags 2.10.0", - "libc", - "once_cell", - "onig_sys", -] - -[[package]] -name = "onig_sys" -version = "69.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7f86c6eef3d6df15f23bcfb6af487cbd2fed4e5581d58d5bf1f5f8b7f6727dc" -dependencies = [ - "cc", - "pkg-config", -] - [[package]] name = "oorandom" version = "11.1.5" @@ -5620,10 +5609,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "656b45c05d95a5704399aeef6bd0ddec7b2b3531b7c9e900abbf7c4d2190c925" dependencies = [ "bincode 1.3.3", + "fancy-regex", "flate2", "fnv", "once_cell", - "onig", "plist", "regex-syntax", "serde", diff --git a/Cargo.toml b/Cargo.toml index 1d90052a..dfdc1f69 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -221,7 +221,7 @@ sipper = "0.1" smol = "2" smol_str = "0.2" softbuffer = { version = "0.4", default-features = false } -syntect = "5.1" +syntect = { version = "5", default-features = false, features = ["default-fancy"] } sysinfo = "0.33" thiserror = "2" tiny-skia = "0.11"