From f064de4d88431ecda13cf2000af8ad0cde97bebe Mon Sep 17 00:00:00 2001 From: TheRealKeto Date: Sat, 27 May 2023 18:50:00 -0400 Subject: [PATCH 1/5] bat: Update to 0.23.0 Signed-off-by: TheRealKeto --- makefiles/bat.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/makefiles/bat.mk b/makefiles/bat.mk index 691939c83c..76de512963 100644 --- a/makefiles/bat.mk +++ b/makefiles/bat.mk @@ -3,8 +3,8 @@ $(error Use the main Makefile) endif SUBPROJECTS += bat -BAT_VERSION := 0.21.0 -DEB_BAT_V ?= $(BAT_VERSION)-1 +BAT_VERSION := 0.23.0 +DEB_BAT_V ?= $(BAT_VERSION) bat-setup: setup $(call GITHUB_ARCHIVE,sharkdp,bat,$(BAT_VERSION),v$(BAT_VERSION)) From 0ecef07a58f2a904912da6dd99f6bc2db63fc239 Mon Sep 17 00:00:00 2001 From: TheRealKeto Date: Sat, 27 May 2023 18:52:00 -0400 Subject: [PATCH 2/5] bat: Update patches Signed-off-by: TheRealKeto --- build_patch/bat/{thing.patch => use-git2-fork.patch} | 8 ++++++-- makefiles/bat.mk | 2 -- 2 files changed, 6 insertions(+), 4 deletions(-) rename build_patch/bat/{thing.patch => use-git2-fork.patch} (54%) diff --git a/build_patch/bat/thing.patch b/build_patch/bat/use-git2-fork.patch similarity index 54% rename from build_patch/bat/thing.patch rename to build_patch/bat/use-git2-fork.patch index 0f3a7d2376..a49ad12d48 100644 --- a/build_patch/bat/thing.patch +++ b/build_patch/bat/use-git2-fork.patch @@ -1,12 +1,16 @@ +Use different git2 fork. See link below for more info. + +https://github.com/rust-lang/git2-rs/pull/859 +=================================================================== diff --git a/Cargo.toml b/Cargo.toml index f0eb26c0..4d88f27a 100644 --- a/Cargo.toml +++ b/Cargo.toml -@@ -67,7 +67,7 @@ +@@ -68,7 +68,7 @@ bytesize = { version = "1.1.0" } [dependencies.git2] --version = "0.14" +-version = "0.16" +git = "https://github.com/Teutates/git2-rs" optional = true default-features = false diff --git a/makefiles/bat.mk b/makefiles/bat.mk index 76de512963..2d0efa3992 100644 --- a/makefiles/bat.mk +++ b/makefiles/bat.mk @@ -9,8 +9,6 @@ DEB_BAT_V ?= $(BAT_VERSION) bat-setup: setup $(call GITHUB_ARCHIVE,sharkdp,bat,$(BAT_VERSION),v$(BAT_VERSION)) $(call EXTRACT_TAR,bat-$(BAT_VERSION).tar.gz,bat-$(BAT_VERSION),bat) -# Remove after https://github.com/rust-lang/git2-rs/pull/859 is merged. -# If said pull request is denied, move to maintaining fork from upstream. $(call DO_PATCH,bat,bat,-p1) ifneq ($(wildcard $(BUILD_WORK)/bat/.build_complete),) From 9ab8c2a6c7c0a21c1edee0ace6ca20531c8a9468 Mon Sep 17 00:00:00 2001 From: TheRealKeto Date: Sat, 27 May 2023 19:14:00 -0400 Subject: [PATCH 3/5] bat: Remove false claim in control file Signed-off-by: TheRealKeto --- build_info/bat.control | 3 --- 1 file changed, 3 deletions(-) diff --git a/build_info/bat.control b/build_info/bat.control index 9cbd78c336..518592894a 100644 --- a/build_info/bat.control +++ b/build_info/bat.control @@ -13,9 +13,6 @@ Description: cat(1) clone with syntax highlighting and git integration * automatic paging; * a user-friendly command-line interface. . - In this package the executable and its manpage have been renamed from ‘bat’ to - ‘batcat’ because of a file name clash with another Debian package. - . This package contains the following binaries built from the Rust crate "bat": - bat From 968c373fd89623fdf232c5146c273cadb7161810 Mon Sep 17 00:00:00 2001 From: TheRealKeto Date: Sun, 28 May 2023 19:05:00 -0400 Subject: [PATCH 4/5] bat: Disable commit hash with bugreport bat shouldn't be reporting any commit hashes, since we're using a tarball, not the git repository directly. Signed-off-by: TheRealKeto --- makefiles/bat.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/makefiles/bat.mk b/makefiles/bat.mk index 2d0efa3992..2d5ab5a78a 100644 --- a/makefiles/bat.mk +++ b/makefiles/bat.mk @@ -10,6 +10,7 @@ bat-setup: setup $(call GITHUB_ARCHIVE,sharkdp,bat,$(BAT_VERSION),v$(BAT_VERSION)) $(call EXTRACT_TAR,bat-$(BAT_VERSION).tar.gz,bat-$(BAT_VERSION),bat) $(call DO_PATCH,bat,bat,-p1) + sed -i "20d;63d" $(BUILD_WORK)/bat/Cargo.toml ifneq ($(wildcard $(BUILD_WORK)/bat/.build_complete),) bat: From 625125034fbc18016e2ec49430f4fee9eeb65ab2 Mon Sep 17 00:00:00 2001 From: Keto Date: Sun, 3 Sep 2023 01:34:00 -0400 Subject: [PATCH 5/5] bat: Add detailed explanation to patch, fix build Signed-off-by: Keto --- build_patch/bat/use-git2-fork.patch | 12 ++++++++++-- makefiles/bat.mk | 1 - 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/build_patch/bat/use-git2-fork.patch b/build_patch/bat/use-git2-fork.patch index a49ad12d48..cd7ef06076 100644 --- a/build_patch/bat/use-git2-fork.patch +++ b/build_patch/bat/use-git2-fork.patch @@ -1,7 +1,15 @@ -Use different git2 fork. See link below for more info. +Use different git2 fork when building. + +The git2-rs maintainers do not understand the difference +between ABI and API changes and ruin our system library +linking. This forces us (the Procursus Team) to patch +their mistakes to support projects that depend on their +work. + +See the link below for more info. https://github.com/rust-lang/git2-rs/pull/859 -=================================================================== +================================================= diff --git a/Cargo.toml b/Cargo.toml index f0eb26c0..4d88f27a 100644 --- a/Cargo.toml diff --git a/makefiles/bat.mk b/makefiles/bat.mk index 2d5ab5a78a..99bf24e7c4 100644 --- a/makefiles/bat.mk +++ b/makefiles/bat.mk @@ -17,7 +17,6 @@ bat: @echo "Using previously built bat." else bat: bat-setup libgit2 - cd $(BUILD_WORK)/bat && cargo update cd $(BUILD_WORK)/bat && $(DEFAULT_RUST_FLAGS) cargo build \ --release \ --target=$(RUST_TARGET)