libgit2-glib-1.2.0-libgit2_1.8.patch 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. From a76fdf96c3af9ce9d21a3985c4be8a1aa6eea661 Mon Sep 17 00:00:00 2001
  2. From: Dominique Leuenberger <dimstar@opensuse.org>
  3. Date: Fri, 5 Apr 2024 10:28:16 +0200
  4. Subject: [PATCH] build: Fix build against, and require, libgit2 1.8.0
  5. ---
  6. libgit2-glib/ggit-clone-options.c | 1 +
  7. libgit2-glib/ggit-cred-ssh-interactive.c | 2 +-
  8. libgit2-glib/ggit-remote-callbacks.h | 1 +
  9. libgit2-glib/ggit-repository.c | 4 ++--
  10. libgit2-glib/ggit-types.h | 3 ++-
  11. meson.build | 2 +-
  12. 6 files changed, 8 insertions(+), 5 deletions(-)
  13. diff --git a/libgit2-glib/ggit-clone-options.c b/libgit2-glib/ggit-clone-options.c
  14. index b47fdb1..30c7d86 100644
  15. --- a/libgit2-glib/ggit-clone-options.c
  16. +++ b/libgit2-glib/ggit-clone-options.c
  17. @@ -19,6 +19,7 @@
  18. */
  19. #include <git2.h>
  20. +#include <git2/sys/errors.h>
  21. #include <gio/gio.h>
  22. #include "ggit-clone-options.h"
  23. diff --git a/libgit2-glib/ggit-cred-ssh-interactive.c b/libgit2-glib/ggit-cred-ssh-interactive.c
  24. index 4f60f8b..0bdca95 100644
  25. --- a/libgit2-glib/ggit-cred-ssh-interactive.c
  26. +++ b/libgit2-glib/ggit-cred-ssh-interactive.c
  27. @@ -191,7 +191,7 @@ callback_wrapper (const char *name,
  28. {
  29. gchar *text;
  30. - text = g_strndup (prompts[i].text, prompts[i].length);
  31. + text = g_strndup ((const gchar *)prompts[i].text, prompts[i].length);
  32. wprompts[i] = ggit_cred_ssh_interactive_prompt_new (wname,
  33. winstruction,
  34. diff --git a/libgit2-glib/ggit-remote-callbacks.h b/libgit2-glib/ggit-remote-callbacks.h
  35. index 3005ff4..2340712 100644
  36. --- a/libgit2-glib/ggit-remote-callbacks.h
  37. +++ b/libgit2-glib/ggit-remote-callbacks.h
  38. @@ -24,6 +24,7 @@
  39. #include <glib-object.h>
  40. #include <git2.h>
  41. +#include <git2/sys/errors.h>
  42. #include <libgit2-glib/ggit-cred.h>
  43. G_BEGIN_DECLS
  44. diff --git a/libgit2-glib/ggit-repository.c b/libgit2-glib/ggit-repository.c
  45. index bf099f6..936c6fc 100644
  46. --- a/libgit2-glib/ggit-repository.c
  47. +++ b/libgit2-glib/ggit-repository.c
  48. @@ -3182,7 +3182,7 @@ ggit_repository_create_commit (GgitRepository *repository,
  49. message,
  50. _ggit_native_get (tree),
  51. parent_count,
  52. - (const git_commit **)parents_native);
  53. + (gpointer)parents_native);
  54. g_free (parents_native);
  55. @@ -3323,7 +3323,7 @@ ggit_repository_create_commit_buffer(GgitRepository *repository,
  56. message,
  57. _ggit_tree_get_tree (tree),
  58. parent_count,
  59. - (git_commit const **)parents_native);
  60. + (gpointer)parents_native);
  61. g_free (parents_native);
  62. diff --git a/libgit2-glib/ggit-types.h b/libgit2-glib/ggit-types.h
  63. index 7e28975..2a2ed99 100644
  64. --- a/libgit2-glib/ggit-types.h
  65. +++ b/libgit2-glib/ggit-types.h
  66. @@ -355,7 +355,8 @@ typedef enum
  67. GGIT_CONFIG_LEVEL_XDG = 3,
  68. GGIT_CONFIG_LEVEL_GLOBAL = 4,
  69. GGIT_CONFIG_LEVEL_LOCAL = 5,
  70. - GGIT_CONFIG_LEVEL_APP = 6,
  71. + GGIT_CONFIG_LEVEL_WORKTREE = 6,
  72. + GGIT_CONFIG_LEVEL_APP = 7,
  73. GGIT_CONFIG_LEVEL_HIGHEST = -1
  74. } GgitConfigLevel;
  75. diff --git a/meson.build b/meson.build
  76. index e54a8b4..c21107d 100644
  77. --- a/meson.build
  78. +++ b/meson.build
  79. @@ -126,7 +126,7 @@ glib_dep = dependency('glib-2.0', version: '>=' + glib_req)
  80. gobject_dep = dependency('gobject-2.0', version: '>=' + glib_req)
  81. gio_dep = dependency('gio-2.0', version: '>=' + glib_req)
  82. -libgit2_dep = dependency('libgit2', version: '>= 0.25.0')
  83. +libgit2_dep = dependency('libgit2', version: '>= 1.8.0')
  84. # XXX: Not nice, but probably our best option
  85. enable_gir = get_option('introspection') and find_program('g-ir-scanner', required: false).found()
  86. --
  87. GitLab