Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libgit2: Update to 1.9.0 #23050

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions mingw-w64-bat/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ _realname=bat
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=0.25.0
pkgrel=1
pkgrel=2
pkgdesc="Cat clone with syntax highlighting and git integration (mingw-w64)"
arch=('any')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
Expand Down Expand Up @@ -32,7 +32,8 @@ sha256sums=('d3f4ee9ca8ea0f5927901dc3e41875a1cb68b44959d7b8be0a210010d4434bc5')
prepare() {
cd "${_realname}"

cargo update -p cc
# bump git2 crate (also updates cc)
git cherry-pick -n 01680e444ba4273b17d2d6d85a19f7a5e7046820
cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
}

Expand Down
30 changes: 15 additions & 15 deletions mingw-w64-cargo-generate/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ _realname=cargo-generate
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=0.22.1
pkgrel=1
pkgrel=2
pkgdesc="Use pre-existing git repositories as templates (mingw-w64)"
arch=('any')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
Expand All @@ -19,40 +19,40 @@ makedepends=("${MINGW_PACKAGE_PREFIX}-rust"
"${MINGW_PACKAGE_PREFIX}-mdbook"
"${MINGW_PACKAGE_PREFIX}-pkgconf"
"${MINGW_PACKAGE_PREFIX}-openssl")
source=("${url}/archive/v${pkgver}/${_realname}-${pkgver}.tar.gz")
sha256sums=('f912f1c172a5a51ac7a693f44acaef99f5b9278723aa4daaeb96278807e025bd')
source=("${url}/archive/v${pkgver}/${_realname}-${pkgver}.tar.gz"
"https://github.com/cargo-generate/cargo-generate/commit/be2237177ee7ae996e2991189b07a5d211cd0d01.patch")
sha256sums=('f912f1c172a5a51ac7a693f44acaef99f5b9278723aa4daaeb96278807e025bd'
'1e3d113bb77975abe3984247219ddc3499c634f21e34b861181077e476efd50c')

prepare() {
cd "${srcdir}/${_realname}-${pkgver}"
cd "${_realname}-${pkgver}"

# bump git2 crate
patch -Np1 -i ../be2237177ee7ae996e2991189b07a5d211cd0d01.patch

export LIBSSH2_SYS_USE_PKG_CONFIG=1
export LIBGIT2_NO_VENDOR=1
export LIBZ_SYS_STATIC=0
export OPENSSL_NO_VENDOR=1
cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
}

build() {
cd "${srcdir}/${_realname}-${pkgver}"
cd "${_realname}-${pkgver}"

"${MINGW_PREFIX}/bin/cargo.exe" build \
--release \
--frozen
cargo build --release --frozen

cd guide
"${MINGW_PREFIX}/bin/mdbook.exe" build
mdbook build
}

check() {
cd "${srcdir}/${_realname}-${pkgver}"
cd "${_realname}-${pkgver}"

"${MINGW_PREFIX}/bin/cargo.exe" test \
--release \
--locked
cargo test --release --locked
}

package() {
cd "${srcdir}/${_realname}-${pkgver}"
cd "${_realname}-${pkgver}"

install -Dm755 "target/release/${_realname}.exe" "${pkgdir}${MINGW_PREFIX}/bin/${_realname}.exe"
install -d "${pkgdir}${MINGW_PREFIX}/share/doc/${_realname}"
Expand Down
5 changes: 1 addition & 4 deletions mingw-w64-eza/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ _realname=eza
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=0.20.16
pkgrel=1
pkgrel=2
pkgdesc="A modern, maintained replacement for ls (mingw-w64)"
arch=('any')
mingw_arch=('ucrt64' 'clang64' 'clangarm64' 'mingw64')
Expand Down Expand Up @@ -36,9 +36,6 @@ _env() {
prepare() {
cd "${_realname}"

# revert git2 update to support libgit2 1.8.x
patch -R -p1 -i ../7241ea4d128ca47b8f5e756a65fa3d4f1d5b5ce7.patch

rm rust-toolchain.toml
cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
}
Expand Down
2 changes: 1 addition & 1 deletion mingw-w64-fritzing/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ _realname=fritzing
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=0.9.9
pkgrel=6
pkgrel=7
pkgdesc="Electronic Design Automation software with a low entry barrier, suited for the needs of makers and hobbyists (mingw-w64)"
arch=('any')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
Expand Down
4 changes: 2 additions & 2 deletions mingw-w64-geany-plugins/PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributor (MSYS2): David Macek <[email protected]>
# Maintainer (Arch Linux): Alexander Rødseth <[email protected]>
# Contributor (Arch Linux): Angel 'angvp' Velasquez <angvp[at]archlinux.com.ve>
# Contributor (Arch Linux): Angel 'angvp' Velasquez <angvp[at]archlinux.com.ve>
# Contributor (Arch Linux): djgera
# Contributor (Arch Linux): Patrick Melo <[email protected]>

Expand All @@ -9,7 +9,7 @@ _realpkgver=2.0.0
pkgbase="mingw-w64-${_realname}"
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=${_realpkgver%.*}
pkgrel=2
pkgrel=3
pkgdesc='Plugins for Geany (mingw-w64)'
arch=('any')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
Expand Down
2 changes: 1 addition & 1 deletion mingw-w64-kicad/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ _realname=kicad
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
pkgver=8.0.6
pkgrel=3
pkgrel=4
pkgdesc="Software for the creation of electronic schematic diagrams and printed circuit board artwork (mingw-w64)"
arch=(any)
mingw_arch=('mingw64' 'ucrt64' 'clang64')
Expand Down
2 changes: 1 addition & 1 deletion mingw-w64-ktexteditor-qt5/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ _variant=-${KF5_VARIANT:-shared}
source "$(dirname ${BASH_SOURCE[0]})"/../mingw-w64-PKGBUILD-common/kde-frameworks5
_kde_f5_init_package "${_variant}" "ktexteditor"
pkgver=5.116.0
pkgrel=1
pkgrel=2
arch=('any')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
msys2_references=(
Expand Down
35 changes: 35 additions & 0 deletions mingw-w64-libgit2-glib/0001-Unbreak-micro-version.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "Jan Alexander Steffens (heftig)" <[email protected]>
Date: Sun, 5 Jan 2025 01:37:29 +0100
Subject: [PATCH] Unbreak micro version

---
libgit2-glib/ggit-version.h.in | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libgit2-glib/ggit-version.h.in b/libgit2-glib/ggit-version.h.in
index 4b251855a435..ab9b1b613774 100644
--- a/libgit2-glib/ggit-version.h.in
+++ b/libgit2-glib/ggit-version.h.in
@@ -35,19 +35,19 @@
*
* libgit2-glib micro version component (e.g. 3 if %GGIT_VERSION is 1.2.3)
*/
-#define GGIT_MINOR_VERSION (@MICRO_VERSION@)
+#define GGIT_MICRO_VERSION (@MICRO_VERSION@)

#define GGIT_ENCODE_VERSION(major,minor,micro) \
((major) << 24 | (minor) << 16 | (micro) << 8)

/**
* GGIT_VERSION_HEX:
*
* libgit2-glib version, encoded as an hexadecimal number, useful for
* integer comparisons.
*/
#define GGIT_VERSION_HEX \
- (GGIT_ENCODE_VERSION (GGIT_MAJOR_VERSION, GGIT_MINOR_VERSION, 0))
+ (GGIT_ENCODE_VERSION (GGIT_MAJOR_VERSION, GGIT_MINOR_VERSION, GGIT_MICRO_VERSION))

/**
* GGIT_BUILD_TYPE:
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Dominique Leuenberger <[email protected]>
Date: Fri, 5 Apr 2024 10:28:16 +0200
Subject: [PATCH] build: Fix build against, and require, libgit2 1.8.0

---
libgit2-glib/ggit-clone-options.c | 1 +
libgit2-glib/ggit-cred-ssh-interactive.c | 2 +-
libgit2-glib/ggit-remote-callbacks.h | 1 +
libgit2-glib/ggit-repository.c | 4 ++--
libgit2-glib/ggit-types.h | 3 ++-
meson.build | 2 +-
6 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/libgit2-glib/ggit-clone-options.c b/libgit2-glib/ggit-clone-options.c
index b47fdb17b3d7..30c7d860d8bc 100644
--- a/libgit2-glib/ggit-clone-options.c
+++ b/libgit2-glib/ggit-clone-options.c
@@ -19,6 +19,7 @@
*/

#include <git2.h>
+#include <git2/sys/errors.h>
#include <gio/gio.h>

#include "ggit-clone-options.h"
diff --git a/libgit2-glib/ggit-cred-ssh-interactive.c b/libgit2-glib/ggit-cred-ssh-interactive.c
index 4f60f8bd548b..0bdca95f7d60 100644
--- a/libgit2-glib/ggit-cred-ssh-interactive.c
+++ b/libgit2-glib/ggit-cred-ssh-interactive.c
@@ -191,7 +191,7 @@ callback_wrapper (const char *name,
{
gchar *text;

- text = g_strndup (prompts[i].text, prompts[i].length);
+ text = g_strndup ((const gchar *)prompts[i].text, prompts[i].length);

wprompts[i] = ggit_cred_ssh_interactive_prompt_new (wname,
winstruction,
diff --git a/libgit2-glib/ggit-remote-callbacks.h b/libgit2-glib/ggit-remote-callbacks.h
index 3005ff4c4966..2340712a7ba3 100644
--- a/libgit2-glib/ggit-remote-callbacks.h
+++ b/libgit2-glib/ggit-remote-callbacks.h
@@ -24,6 +24,7 @@

#include <glib-object.h>
#include <git2.h>
+#include <git2/sys/errors.h>
#include <libgit2-glib/ggit-cred.h>

G_BEGIN_DECLS
diff --git a/libgit2-glib/ggit-repository.c b/libgit2-glib/ggit-repository.c
index bf099f6c8a9a..936c6fcff79f 100644
--- a/libgit2-glib/ggit-repository.c
+++ b/libgit2-glib/ggit-repository.c
@@ -3182,7 +3182,7 @@ ggit_repository_create_commit (GgitRepository *repository,
message,
_ggit_native_get (tree),
parent_count,
- (const git_commit **)parents_native);
+ (gpointer)parents_native);

g_free (parents_native);

@@ -3323,7 +3323,7 @@ ggit_repository_create_commit_buffer(GgitRepository *repository,
message,
_ggit_tree_get_tree (tree),
parent_count,
- (git_commit const **)parents_native);
+ (gpointer)parents_native);

g_free (parents_native);

diff --git a/libgit2-glib/ggit-types.h b/libgit2-glib/ggit-types.h
index 7e28975b3d96..2a2ed99e5511 100644
--- a/libgit2-glib/ggit-types.h
+++ b/libgit2-glib/ggit-types.h
@@ -355,7 +355,8 @@ typedef enum
GGIT_CONFIG_LEVEL_XDG = 3,
GGIT_CONFIG_LEVEL_GLOBAL = 4,
GGIT_CONFIG_LEVEL_LOCAL = 5,
- GGIT_CONFIG_LEVEL_APP = 6,
+ GGIT_CONFIG_LEVEL_WORKTREE = 6,
+ GGIT_CONFIG_LEVEL_APP = 7,
GGIT_CONFIG_LEVEL_HIGHEST = -1
} GgitConfigLevel;

diff --git a/meson.build b/meson.build
index e54a8b431d7b..c21107d5cab5 100644
--- a/meson.build
+++ b/meson.build
@@ -126,7 +126,7 @@ glib_dep = dependency('glib-2.0', version: '>=' + glib_req)
gobject_dep = dependency('gobject-2.0', version: '>=' + glib_req)
gio_dep = dependency('gio-2.0', version: '>=' + glib_req)

-libgit2_dep = dependency('libgit2', version: '>= 0.25.0')
+libgit2_dep = dependency('libgit2', version: '>= 1.8.0')

# XXX: Not nice, but probably our best option
enable_gir = get_option('introspection') and find_program('g-ir-scanner', required: false).found()
79 changes: 79 additions & 0 deletions mingw-w64-libgit2-glib/0003-Adjust-API-for-libgit2-1.9.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "Jan Alexander Steffens (heftig)" <[email protected]>
Date: Sun, 5 Jan 2025 01:37:27 +0100
Subject: [PATCH] Adjust API for libgit2 1.9.0

---
libgit2-glib/ggit-types.c | 4 +++-
libgit2-glib/ggit-types.h | 6 ++++--
2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/libgit2-glib/ggit-types.c b/libgit2-glib/ggit-types.c
index df8ed6e56ad1..3b3c8bc96b85 100644
--- a/libgit2-glib/ggit-types.c
+++ b/libgit2-glib/ggit-types.c
@@ -250,26 +250,28 @@ ASSERT_ENUM (GGIT_ATTRIBUTE_CHECK_NO_SYSTEM, GIT_ATTR_CHECK_NO_SYSTEM);
ASSERT_ENUM (GGIT_PACKBUILDER_STAGE_ADDING_OBJECTS, GIT_PACKBUILDER_ADDING_OBJECTS);
ASSERT_ENUM (GGIT_PACKBUILDER_STAGE_DELTAFICATION, GIT_PACKBUILDER_DELTAFICATION);

-ASSERT_ENUM (GGIT_CHECKOUT_NONE, GIT_CHECKOUT_NONE);
ASSERT_ENUM (GGIT_CHECKOUT_SAFE, GIT_CHECKOUT_SAFE);
ASSERT_ENUM (GGIT_CHECKOUT_FORCE, GIT_CHECKOUT_FORCE);
ASSERT_ENUM (GGIT_CHECKOUT_RECREATE_MISSING, GIT_CHECKOUT_RECREATE_MISSING);
ASSERT_ENUM (GGIT_CHECKOUT_ALLOW_CONFLICTS, GIT_CHECKOUT_ALLOW_CONFLICTS);
ASSERT_ENUM (GGIT_CHECKOUT_REMOVE_UNTRACKED, GIT_CHECKOUT_REMOVE_UNTRACKED);
ASSERT_ENUM (GGIT_CHECKOUT_REMOVE_IGNORED, GIT_CHECKOUT_REMOVE_IGNORED);
ASSERT_ENUM (GGIT_CHECKOUT_UPDATE_ONLY, GIT_CHECKOUT_UPDATE_ONLY);
ASSERT_ENUM (GGIT_CHECKOUT_DONT_UPDATE_INDEX, GIT_CHECKOUT_DONT_UPDATE_INDEX);
ASSERT_ENUM (GGIT_CHECKOUT_NO_REFRESH, GIT_CHECKOUT_NO_REFRESH);
ASSERT_ENUM (GGIT_CHECKOUT_SKIP_UNMERGED, GIT_CHECKOUT_SKIP_UNMERGED);
ASSERT_ENUM (GGIT_CHECKOUT_USE_OURS, GIT_CHECKOUT_USE_OURS);
ASSERT_ENUM (GGIT_CHECKOUT_USE_THEIRS, GIT_CHECKOUT_USE_THEIRS);
ASSERT_ENUM (GGIT_CHECKOUT_DISABLE_PATHSPEC_MATCH, GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH);
ASSERT_ENUM (GGIT_CHECKOUT_SKIP_LOCKED_DIRECTORIES, GIT_CHECKOUT_SKIP_LOCKED_DIRECTORIES);
ASSERT_ENUM (GGIT_CHECKOUT_DONT_OVERWRITE_IGNORED, GIT_CHECKOUT_DONT_OVERWRITE_IGNORED);
ASSERT_ENUM (GGIT_CHECKOUT_CONFLICT_STYLE_MERGE, GIT_CHECKOUT_CONFLICT_STYLE_MERGE);
ASSERT_ENUM (GGIT_CHECKOUT_CONFLICT_STYLE_DIFF3, GIT_CHECKOUT_CONFLICT_STYLE_DIFF3);
ASSERT_ENUM (GGIT_CHECKOUT_DONT_REMOVE_EXISTING, GIT_CHECKOUT_DONT_REMOVE_EXISTING);
ASSERT_ENUM (GGIT_CHECKOUT_DONT_WRITE_INDEX, GIT_CHECKOUT_DONT_WRITE_INDEX);
+ASSERT_ENUM (GGIT_CHECKOUT_DRY_RUN, GIT_CHECKOUT_DRY_RUN);
+ASSERT_ENUM (GGIT_CHECKOUT_CONFLICT_STYLE_ZDIFF3, GIT_CHECKOUT_CONFLICT_STYLE_ZDIFF3);
+ASSERT_ENUM (GGIT_CHECKOUT_NONE, GIT_CHECKOUT_NONE);
ASSERT_ENUM (GGIT_CHECKOUT_UPDATE_SUBMODULES, GIT_CHECKOUT_UPDATE_SUBMODULES);
ASSERT_ENUM (GGIT_CHECKOUT_UPDATE_SUBMODULES_IF_CHANGED, GIT_CHECKOUT_UPDATE_SUBMODULES_IF_CHANGED);

diff --git a/libgit2-glib/ggit-types.h b/libgit2-glib/ggit-types.h
index 2a2ed99e5511..8cf932a854a8 100644
--- a/libgit2-glib/ggit-types.h
+++ b/libgit2-glib/ggit-types.h
@@ -990,26 +990,28 @@ typedef enum

typedef enum
{
- GGIT_CHECKOUT_NONE = 0,
- GGIT_CHECKOUT_SAFE = (1u << 0),
+ GGIT_CHECKOUT_SAFE = 0,
GGIT_CHECKOUT_FORCE = (1u << 1),
GGIT_CHECKOUT_RECREATE_MISSING = (1u << 2),
GGIT_CHECKOUT_ALLOW_CONFLICTS = (1u << 4),
GGIT_CHECKOUT_REMOVE_UNTRACKED = (1u << 5),
GGIT_CHECKOUT_REMOVE_IGNORED = (1u << 6),
GGIT_CHECKOUT_UPDATE_ONLY = (1u << 7),
GGIT_CHECKOUT_DONT_UPDATE_INDEX = (1u << 8),
GGIT_CHECKOUT_NO_REFRESH = (1u << 9),
GGIT_CHECKOUT_SKIP_UNMERGED = (1u << 10),
GGIT_CHECKOUT_USE_OURS = (1u << 11),
GGIT_CHECKOUT_USE_THEIRS = (1u << 12),
GGIT_CHECKOUT_DISABLE_PATHSPEC_MATCH = (1u << 13),
GGIT_CHECKOUT_SKIP_LOCKED_DIRECTORIES = (1u << 18),
GGIT_CHECKOUT_DONT_OVERWRITE_IGNORED = (1u << 19),
GGIT_CHECKOUT_CONFLICT_STYLE_MERGE = (1u << 20),
GGIT_CHECKOUT_CONFLICT_STYLE_DIFF3 = (1u << 21),
GGIT_CHECKOUT_DONT_REMOVE_EXISTING = (1u << 22),
GGIT_CHECKOUT_DONT_WRITE_INDEX = (1u << 23),
+ GGIT_CHECKOUT_DRY_RUN = (1u << 24),
+ GGIT_CHECKOUT_CONFLICT_STYLE_ZDIFF3 = (1u << 25),
+ GGIT_CHECKOUT_NONE = (1u << 30),
GGIT_CHECKOUT_UPDATE_SUBMODULES = (1u << 16),
GGIT_CHECKOUT_UPDATE_SUBMODULES_IF_CHANGED = (1u << 17)
} GgitCheckoutStrategy;
Loading
Loading