diff --git a/community/gitui/APKBUILD b/community/gitui/APKBUILD index 69f6f995ddcf66110ed05b797595c72777196d34..660626c692e4d3c6ff47292f1e890f52106698cf 100644 --- a/community/gitui/APKBUILD +++ b/community/gitui/APKBUILD @@ -1,19 +1,26 @@ # Contributor: Jakub Jirutka <jakub@jirutka.cz> # Maintainer: Jakub Jirutka <jakub@jirutka.cz> pkgname=gitui -pkgver=0.15.0 +# NOTE: If update-lockfile.patch is not applicable after bumping, apply only +# the previous patches, copy Cargo.lock to Cargo.lock.orig, run +# `cargo build --release`, interrupt it (^C) right after it starts building +# and generate a new diff (`diff -u Cargo.lock.orig Cargo.lock`). +pkgver=0.16.0 pkgrel=0 pkgdesc="Blazing fast terminal client for git" url="https://github.com/extrawurst/gitui" arch="x86_64 armv7 armhf aarch64 x86 ppc64le" # limited by rust/cargo license="MIT" -makedepends="cargo libgit2-dev openssl-dev zlib-dev" +makedepends="cargo libgit2-dev oniguruma-dev openssl-dev zlib-dev" source="https://github.com/extrawurst/gitui/archive/v$pkgver/$pkgname-$pkgver.tar.gz use-system-openssl.patch + use-oniguruma.patch + update-lockfile.patch " export LIBGIT2_SYS_USE_PKG_CONFIG=1 # use system libgit2 export LIBSSH2_SYS_USE_PKG_CONFIG=1 # use system libssh2 +export RUSTONIG_DYNAMIC_LIBONIG=1 # use system libonig build() { cargo build --release --locked @@ -28,5 +35,9 @@ package() { rm "$pkgdir"/usr/.crates* } -sha512sums="41f01265f6a20e597db306bde382bcaf1a0a6623dfd711c959ad1bf960d91628ac5f03d73074e617e3f4adbbc09d9d36ef0f6f12f36f1c7fc5e8c801de695d02 gitui-0.15.0.tar.gz -e36a5f73bb9331c257a84acfaac11b3c88624f61205cc139dbe5c710d3200ec66991ac76beb5a77ded7f04af6e32b7d2a53b780ee550529618bcb3b184987918 use-system-openssl.patch" +sha512sums=" +37430f5a8ab4477d6961ca5c9d058f222be47384e4966dd871e019113e75d773224ef829754306532bdcbccc1827ea47ddbbf05dc19748fdab34b81cd3cd89bf gitui-0.16.0.tar.gz +9b41b32968d4ec81ffd1e0b3aa6535afbdd3b8422c156e7fc74571235e9609a5af65702e48071e2954c80a0aaea914c1d8a15234504900b0733139e1387a43e4 use-system-openssl.patch +cd27d664b415c13ecbe424825e3bdd913c10c647c11c5e57d5f62d822fa4397a8f463dba35a963696c191ca860d0b014b38c0ee2f106c673de62bdd92dd9dbbf use-oniguruma.patch +096302bacd89af7f48d9526bbf56fc46b62e21c375aa540a00b0b4f150421afb15978a0d514d3939ae864fc672be52120cdcbf486e79633d0383fd7e4b31e031 update-lockfile.patch +" diff --git a/community/gitui/update-lockfile.patch b/community/gitui/update-lockfile.patch new file mode 100644 index 0000000000000000000000000000000000000000..708f850fdbbf68b414b01300d084f6bffdbb1054 --- /dev/null +++ b/community/gitui/update-lockfile.patch @@ -0,0 +1,139 @@ +Update Cargo.lock after applying use-system-openssl.patch and use-oniguruma.patch. + +--- a/Cargo.lock ++++ b/Cargo.lock +@@ -27,15 +27,6 @@ + ] + + [[package]] +-name = "aho-corasick" +-version = "0.7.18" +-source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" +-dependencies = [ +- "memchr", +-] +- +-[[package]] + name = "ansi_term" + version = "0.12.1" + source = "registry+https://github.com/rust-lang/crates.io-index" +@@ -126,21 +117,6 @@ + ] + + [[package]] +-name = "bit-set" +-version = "0.5.2" +-source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "6e11e16035ea35e4e5997b393eacbf6f63983188f7a2ad25bfb13465f5ad59de" +-dependencies = [ +- "bit-vec", +-] +- +-[[package]] +-name = "bit-vec" +-version = "0.6.3" +-source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" +- +-[[package]] + name = "bitflags" + version = "1.2.1" + source = "registry+https://github.com/rust-lang/crates.io-index" +@@ -363,16 +339,6 @@ + checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" + + [[package]] +-name = "fancy-regex" +-version = "0.3.5" +-source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "ae91abf6555234338687bb47913978d275539235fcb77ba9863b779090b42b14" +-dependencies = [ +- "bit-set", +- "regex", +-] +- +-[[package]] + name = "filetreelist" + version = "0.1.1" + dependencies = [ +@@ -828,21 +794,34 @@ + checksum = "af8b08b04175473088b46763e51ee54da5f9a164bc162f615b91bc179dbf15a3" + + [[package]] +-name = "openssl-probe" +-version = "0.1.4" ++name = "onig" ++version = "6.1.1" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "28988d872ab76095a6e6ac88d99b54fd267702734fd7ffe610ca27f533ddb95a" ++checksum = "30b46fd9edbc018f0be4e366c24c46db44fac49cd01c039ae85308088b089dd5" ++dependencies = [ ++ "bitflags", ++ "lazy_static", ++ "libc", ++ "onig_sys", ++] + + [[package]] +-name = "openssl-src" +-version = "111.15.0+1.1.1k" ++name = "onig_sys" ++version = "69.6.0" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "b1a5f6ae2ac04393b217ea9f700cd04fa9bf3d93fae2872069f3d15d908af70a" ++checksum = "ed063c96cf4c0f2e5d09324409d158b38a0a85a7b90fbd68c8cad75c495d5775" + dependencies = [ + "cc", ++ "pkg-config", + ] + + [[package]] ++name = "openssl-probe" ++version = "0.1.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++checksum = "28988d872ab76095a6e6ac88d99b54fd267702734fd7ffe610ca27f533ddb95a" ++ ++[[package]] + name = "openssl-sys" + version = "0.9.63" + source = "registry+https://github.com/rust-lang/crates.io-index" +@@ -851,7 +830,6 @@ + "autocfg", + "cc", + "libc", +- "openssl-src", + "pkg-config", + "vcpkg", + ] +@@ -1058,17 +1036,6 @@ + ] + + [[package]] +-name = "regex" +-version = "1.5.4" +-source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461" +-dependencies = [ +- "aho-corasick", +- "memchr", +- "regex-syntax", +-] +- +-[[package]] + name = "regex-syntax" + version = "0.6.25" + source = "registry+https://github.com/rust-lang/crates.io-index" +@@ -1298,11 +1265,11 @@ + dependencies = [ + "bincode", + "bitflags", +- "fancy-regex", + "flate2", + "fnv", + "lazy_static", + "lazycell", ++ "onig", + "plist", + "regex-syntax", + "serde", diff --git a/community/gitui/use-oniguruma.patch b/community/gitui/use-oniguruma.patch new file mode 100644 index 0000000000000000000000000000000000000000..a94072eeeb0c9b8fd06723f8601f80254bd022ed --- /dev/null +++ b/community/gitui/use-oniguruma.patch @@ -0,0 +1,37 @@ +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" + diff --git a/community/gitui/use-system-openssl.patch b/community/gitui/use-system-openssl.patch index 0b5df0cfaccff38d3f92f68fa8d8206d8bd8daf4..3de8ddd20facf88c9e82c2ad8959e25fe9a15faa 100644 --- a/community/gitui/use-system-openssl.patch +++ b/community/gitui/use-system-openssl.patch @@ -6,32 +6,6 @@ scopetime = { path = "../scopetime", version = "0.1" } -git2 = { version = "0.13", features = ["vendored-openssl"] } +git2 = { version = "0.13" } + # git2 = { path = "../../github/git2-rs", features = ["vendored-openssl"]} + # git2 = { git="https://github.com/extrawurst/git2-rs.git", rev="513a8c9", features = ["vendored-openssl"]} rayon-core = "1.9" - crossbeam-channel = "0.5" - log = "0.4" ---- a/Cargo.lock -+++ b/Cargo.lock -@@ -686,15 +686,6 @@ - checksum = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" - - [[package]] --name = "openssl-src" --version = "111.15.0+1.1.1k" --source = "registry+https://github.com/rust-lang/crates.io-index" --checksum = "b1a5f6ae2ac04393b217ea9f700cd04fa9bf3d93fae2872069f3d15d908af70a" --dependencies = [ -- "cc", --] -- --[[package]] - name = "openssl-sys" - version = "0.9.60" - source = "registry+https://github.com/rust-lang/crates.io-index" -@@ -703,7 +694,6 @@ - "autocfg", - "cc", - "libc", -- "openssl-src", - "pkg-config", - "vcpkg", - ]