1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-22 18:55:29 +03:00
aports/community/gitui/use-oniguruma.patch
2021-05-30 16:49:37 +02:00

37 lines
1.5 KiB
Diff

From: Jakub Jirutka <jakub@jirutka.cz>
Date: Sun, 30 May 2021 16:19:35 +0200
Subject: [PATCH] Build syntect with onig instead of fancy-regex
Replace pure Rust fancy-regex with onig linked against system-provided
oniguruma library.
From the syntect's Readme (https://github.com/trishume/syntect):
> The advantage of fancy-regex is that it does not require the onig crate
> which requires building and linking the Oniguruma C library. Many users
> experience difficulty building the onig crate, especially on Windows
> and Webassembly.
> As far as our tests can tell this new engine is just as correct, but it
> hasn't been tested as extensively in production. It also currently seems
> to be about half the speed of the default Oniguruma engine
Oniguruma engine is faster than the fancy-regex engine and the syntect
project chose the latter as the default only to avoid difficulties with
linking Oniguruma (C library) on some platforms. That's not our case.
Moreover, gitui built with Oniguruma instead of fancy-regex is smaller
(2.9 MiB x 3.8 MiB). libonig.so is 0.5 MiB, so we saved 0.4 MiB or 0.9 MiB,
if libonig.so is already installed for some other package.
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -46,7 +46,7 @@
easy-cast = "0.4"
bugreport = "0.4"
lazy_static = "1.4"
-syntect = { version = "4.5", default-features = false, features = ["metadata", "default-fancy"]}
+syntect = { version = "4.5", default-features = false, features = ["metadata", "default-onig"]}
[target.'cfg(all(target_family="unix",not(target_os="macos")))'.dependencies]
which = "4.1"