geany-plugins v2.1

This commit is contained in:
uglyside
2025-07-06 18:58:40 +03:00
parent 23b9d8bb91
commit d47f607cf0
6 changed files with 139 additions and 380 deletions
+5 -8
View File
@@ -9,18 +9,15 @@ from pisi.actionsapi import pisitools
from pisi.actionsapi import get
def setup():
pisitools.cflags.add("-Wno-deprecated-declarations")
autotools.configure("--prefix=/usr --libexecdir=/usr/lib")
autotools.configure("--prefix=/usr --libexecdir=/usr/lib")
def build():
autotools.make()
autotools.make()
def check():
pass
# autotools.make("check")
pass
def install():
autotools.rawInstall("DESTDIR=%s" % get.installDIR())
pisitools.dodoc("NEWS", "README")
autotools.rawInstall("DESTDIR=%s" % get.installDIR())
pisitools.dodoc("NEWS")
@@ -1,55 +0,0 @@
From 9497d829e1b207eb83575dc6f617feecfb89bc16 Mon Sep 17 00:00:00 2001
From: Dominik Schmidt <dominik@schm1dt.ch>
Date: Sun, 23 Feb 2020 19:15:30 +0100
Subject: [PATCH] Make libgit2 version preprocessor conditionals compatible
with libgit2-0.99
LIBGIT2_SOVERSION is defined as string literal, e.g. "0.99",
from libgit2-0.99 and beyond. Arithmetic checks against this
variable whill hence fail. This patch switches the checks to
compare against the LIBGIT2_VER_* family, which should be more stable.
---
git-changebar/src/gcb-plugin.c | 6 +++---
workbench/src/plugin_main.c | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/git-changebar/src/gcb-plugin.c b/git-changebar/src/gcb-plugin.c
index b7083199..a911815f 100644
--- a/git-changebar/src/gcb-plugin.c
+++ b/git-changebar/src/gcb-plugin.c
@@ -32,11 +32,11 @@
#include <geany.h>
#include <document.h>
-#if ! defined (LIBGIT2_SOVERSION) || LIBGIT2_SOVERSION < 22
+#if ! defined (LIBGIT2_VER_MINOR) || ( (LIBGIT2_VER_MAJOR == 0) && (LIBGIT2_VER_MINOR < 22) )
# define git_libgit2_init git_threads_init
# define git_libgit2_shutdown git_threads_shutdown
#endif
-#if ! defined (LIBGIT2_SOVERSION) || LIBGIT2_SOVERSION < 23
+#if ! defined (LIBGIT2_VER_MINOR) || ( (LIBGIT2_VER_MAJOR == 0) && (LIBGIT2_VER_MINOR < 23) )
/* 0.23 added @p binary_cb */
# define git_diff_buffers(old_buffer, old_len, old_as_path, \
new_buffer, new_len, new_as_path, options, \
@@ -45,7 +45,7 @@
new_buffer, new_len, new_as_path, options, \
file_cb, hunk_cb, line_cb, payload)
#endif
-#if ! defined (LIBGIT2_SOVERSION) || LIBGIT2_SOVERSION < 28
+#if ! defined (LIBGIT2_VER_MINOR) || ( (LIBGIT2_VER_MAJOR == 0) && (LIBGIT2_VER_MINOR < 28) )
# define git_buf_dispose git_buf_free
# define git_error_last giterr_last
#endif
diff --git a/workbench/src/plugin_main.c b/workbench/src/plugin_main.c
index 6fa6fc84..25ecdf6d 100644
--- a/workbench/src/plugin_main.c
+++ b/workbench/src/plugin_main.c
@@ -36,7 +36,7 @@
#include "tm_control.h"
-#if ! defined (LIBGIT2_SOVERSION) || LIBGIT2_SOVERSION < 22
+#if ! defined (LIBGIT2_VER_MINOR) || ( (LIBGIT2_VER_MAJOR == 0) && (LIBGIT2_VER_MINOR < 22))
# define git_libgit2_init git_threads_init
# define git_libgit2_shutdown git_threads_shutdown
#endif
@@ -1,121 +0,0 @@
From 5d9f1bc6d010e6b4c6a21af8a39b90922f89a82c Mon Sep 17 00:00:00 2001
From: Colomban Wendling <ban@herbesfolles.org>
Date: Sun, 5 Jun 2022 23:22:59 +0200
Subject: [PATCH] git-changebar: Add support for libgit2 1.4
The buffer API changed a lot in libgit2 1.4, so compatibility is a bit
nastier than one could hope for.
Fixes #1164.
---
git-changebar/src/gcb-plugin.c | 76 ++++++++++++++++++++++++----------
1 file changed, 54 insertions(+), 22 deletions(-)
diff --git a/git-changebar/src/gcb-plugin.c b/git-changebar/src/gcb-plugin.c
index bee8c865c..76208cd00 100644
--- a/git-changebar/src/gcb-plugin.c
+++ b/git-changebar/src/gcb-plugin.c
@@ -219,30 +219,19 @@ static const struct {
};
-/* workaround https://github.com/libgit2/libgit2/pull/3187 */
-static int
-gcb_git_buf_grow (git_buf *buf,
- size_t target_size)
-{
- if (buf->asize == 0) {
- if (target_size == 0) {
- target_size = buf->size;
- }
- if ((target_size & 7) == 0) {
- target_size++;
- }
- }
- return git_buf_grow (buf, target_size);
-}
-#define git_buf_grow gcb_git_buf_grow
-
static void
buf_zero (git_buf *buf)
{
if (buf) {
buf->ptr = NULL;
buf->size = 0;
+#if ! CHECK_LIBGIT2_VERSION(1, 4)
buf->asize = 0;
+#else
+ /* we don't really need this field, but the documentation states that all
+ * fields should be set to 0, so fill it as well */
+ buf->reserved = 0;
+#endif
}
}
@@ -256,6 +245,52 @@ clear_cached_blob_contents (void)
G_blob_contents_tag = 0;
}
+/* similar to old git_blob_filtered_content() but makes sure the caller owns
+ * the data in the output buffer -- and uses a boolean return */
+static gboolean
+get_blob_contents (git_buf *out,
+ git_blob *blob,
+ const char *as_path,
+ int check_for_binary_data)
+{
+/* libgit2 1.4 changed buffer API quite a bit */
+#if ! CHECK_LIBGIT2_VERSION(1, 4)
+ gboolean success = TRUE;
+
+ if (git_blob_filtered_content (out, blob, as_path,
+ check_for_binary_data) != 0)
+ return FALSE;
+
+ /* Workaround for https://github.com/libgit2/libgit2/pull/3187
+ * We want to own the buffer, which git_buf_grow(buf, 0) was supposed to do,
+ * but there is a corner case where it doesn't do what it should and
+ * truncates the buffer contents, so we fix this manually. */
+ if (out->asize == 0) {
+ size_t target_size = out->size;
+ if ((target_size & 7) == 0) {
+ target_size++;
+ }
+ success = (git_buf_grow (out, target_size) == 0);
+ }
+
+ return success;
+#else /* libgit2 >= 1.4 */
+ /* Here we can assume we will always get a buffer we own (at least as of
+ * 2022-06-05 it is the case), so there's no need for a pendent to the
+ * previous git_buf_grow() shenanigans.
+ * This code path does the same as the older git_blob_filtered_content()
+ * but with non-deprecated API */
+ git_blob_filter_options opts = GIT_BLOB_FILTER_OPTIONS_INIT;
+
+ if (check_for_binary_data)
+ opts.flags |= GIT_BLOB_FILTER_CHECK_FOR_BINARY;
+ else
+ opts.flags &= ~GIT_BLOB_FILTER_CHECK_FOR_BINARY;
+
+ return git_blob_filter(out, blob, as_path, &opts) == 0;
+#endif
+}
+
/* get the file blob for @relpath at HEAD */
static gboolean
repo_get_file_blob_contents (git_repository *repo,
@@ -279,11 +314,8 @@ repo_get_file_blob_contents (git_repository *repo,
git_blob *blob;
if (git_blob_lookup (&blob, repo, git_tree_entry_id (entry)) == 0) {
- if (git_blob_filtered_content (contents, blob, relpath,
- check_for_binary_data) == 0 &&
- git_buf_grow (contents, 0) == 0) {
- success = TRUE;
- }
+ success = get_blob_contents (contents, blob, relpath,
+ check_for_binary_data);
git_blob_free (blob);
}
git_tree_entry_free (entry);
@@ -1,46 +0,0 @@
From 668f5d07eef16e227402eab09141c738b315d94b Mon Sep 17 00:00:00 2001
From: Colomban Wendling <ban@herbesfolles.org>
Date: Sun, 5 Jun 2022 23:11:20 +0200
Subject: [PATCH] git-changebar: Simplify libgit2 version checks
Introduce a custom macro for libgit2 version checks for them to be both
easier to read and write.
---
git-changebar/src/gcb-plugin.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/git-changebar/src/gcb-plugin.c b/git-changebar/src/gcb-plugin.c
index f8ce20cd6..bee8c865c 100644
--- a/git-changebar/src/gcb-plugin.c
+++ b/git-changebar/src/gcb-plugin.c
@@ -32,11 +32,19 @@
#include <geany.h>
#include <document.h>
-#if ! defined (LIBGIT2_VER_MINOR) || ( (LIBGIT2_VER_MAJOR == 0) && (LIBGIT2_VER_MINOR < 22) )
+#ifdef LIBGIT2_VER_MINOR
+# define CHECK_LIBGIT2_VERSION(MAJOR, MINOR) \
+ ((LIBGIT2_VER_MAJOR == (MAJOR) && LIBGIT2_VER_MINOR >= (MINOR)) || \
+ LIBGIT2_VER_MAJOR > (MAJOR))
+#else /* ! defined(LIBGIT2_VER_MINOR) */
+# define CHECK_LIBGIT2_VERSION(MAJOR, MINOR) 0
+#endif
+
+#if ! CHECK_LIBGIT2_VERSION(0, 22)
# define git_libgit2_init git_threads_init
# define git_libgit2_shutdown git_threads_shutdown
#endif
-#if ! defined (LIBGIT2_VER_MINOR) || ( (LIBGIT2_VER_MAJOR == 0) && (LIBGIT2_VER_MINOR < 23) )
+#if ! CHECK_LIBGIT2_VERSION(0, 23)
/* 0.23 added @p binary_cb */
# define git_diff_buffers(old_buffer, old_len, old_as_path, \
new_buffer, new_len, new_as_path, options, \
@@ -45,7 +53,7 @@
new_buffer, new_len, new_as_path, options, \
file_cb, hunk_cb, line_cb, payload)
#endif
-#if ! defined (LIBGIT2_VER_MINOR) || ( (LIBGIT2_VER_MAJOR == 0) && (LIBGIT2_VER_MINOR < 28) )
+#if ! CHECK_LIBGIT2_VERSION(0, 28)
# define git_buf_dispose git_buf_free
# define git_error_last giterr_last
#endif
@@ -1,21 +0,0 @@
diff --git a/overview/overview/overviewscintilla.c b/overview/overview/overviewscintilla.c
index 41840638..7158179e 100644
--- a/overview/overview/overviewscintilla.c
+++ b/overview/overview/overviewscintilla.c
@@ -796,14 +796,14 @@ overview_scintilla_get_property (GObject *object,
break;
case PROP_OVERLAY_COLOR:
{
- OverviewColor color;
+ OverviewColor color = { 0 };
overview_scintilla_get_overlay_color (self, &color);
g_value_set_boxed (value, &color);
break;
}
case PROP_OVERLAY_OUTLINE_COLOR:
{
- OverviewColor color;
+ OverviewColor color = { 0 };
overview_scintilla_get_overlay_outline_color (self, &color);
g_value_set_boxed (value, &color);
break;
+134 -129
View File
@@ -1,81 +1,86 @@
<?xml version="1.0" ?>
<!DOCTYPE PISI SYSTEM "https://pisilinux.org/projeler/pisi/pisi-spec.dtd">
<PISI>
<Source>
<Name>geany-plugins</Name>
<Homepage>https://plugins.geany.org/</Homepage>
<Packager>
<Name>PisiLinux Community</Name>
<Email>admins@pisilinux.org</Email>
</Packager>
<License>GPL</License>
<IsA>library</IsA>
<Summary>Plugins for Geany</Summary>
<Description>Plugins for Geany</Description>
<Archive sha1sum="6a553834d9eaf3ea106c4eb1fc25d25a82ba788c" type="tarbz2">https://plugins.geany.org/geany-plugins/geany-plugins-2.0.tar.bz2</Archive>
<BuildDependencies>
<Dependency>intltool</Dependency>
<Dependency>cppcheck</Dependency>
<Dependency>vte-devel</Dependency>
<Dependency>vala-devel</Dependency>
<Dependency>ctpl-devel</Dependency>
<Dependency>check-devel</Dependency>
<Dependency>geany-devel</Dependency>
<Dependency>lua51-devel</Dependency>
<Dependency>gpgme-devel</Dependency>
<Dependency>python-devel</Dependency>
<Dependency>gnutls-devel</Dependency>
<Dependency>python3-devel</Dependency>
<Dependency>libsoup-devel</Dependency>
<Dependency>libgit2-devel</Dependency>
<Dependency>libpcre2-devel</Dependency>
<Dependency>enchant2-devel</Dependency>
<Dependency>gtkspell3-devel</Dependency>
<Dependency>webkit2gtk-devel</Dependency>
</BuildDependencies>
<Patches>
<!-- <Patch level="1">Add_support_for_libgit2_1_4.patch</Patch> -->
<!-- <Patch level="1">Simplify_libgit2_version_checks.patch</Patch> -->
<!-- <Patch level="1">missing.patch</Patch> -->
</Patches>
</Source>
<Source>
<Name>geany-plugins</Name>
<Homepage>https://plugins.geany.org/</Homepage>
<Packager>
<Name>PisiLinux Community</Name>
<Email>admins@pisilinux.org</Email>
</Packager>
<License>GPL</License>
<IsA>library</IsA>
<Summary>Plugins for Geany</Summary>
<Description>Plugins for Geany</Description>
<Archive sha1sum="6cf34aa723ea509a8700d4f09451154b3a2dc3ea" type="tarbz2">https://plugins.geany.org/geany-plugins/geany-plugins-2.1.tar.bz2</Archive>
<BuildDependencies>
<Dependency>intltool</Dependency>
<Dependency>cppcheck</Dependency>
<Dependency>vte-devel</Dependency>
<Dependency>vala-devel</Dependency>
<Dependency>ctpl-devel</Dependency>
<Dependency>check-devel</Dependency>
<Dependency>geany-devel</Dependency>
<Dependency>lua51-devel</Dependency>
<Dependency>gpgme-devel</Dependency>
<Dependency>python-devel</Dependency>
<Dependency>gnutls-devel</Dependency>
<Dependency>python3-devel</Dependency>
<Dependency>libgit2-devel</Dependency>
<Dependency>libsoup3-devel</Dependency>
<Dependency>libpcre2-devel</Dependency>
<Dependency>enchant2-devel</Dependency>
<Dependency>gtkspell3-devel</Dependency>
<Dependency>webkit2gtk-devel</Dependency>
</BuildDependencies>
<Patches>
<!-- <Patch level="1"></Patch> -->
</Patches>
</Source>
<Package>
<Name>geany-plugins</Name>
<RuntimeDependencies>
<Dependency>atk</Dependency>
<Dependency>vte</Dependency>
<Dependency>zlib</Dependency>
<Dependency>ctpl</Dependency>
<Dependency>gtk3</Dependency>
<Dependency>cairo</Dependency>
<Dependency>pango</Dependency>
<Dependency>glib2</Dependency>
<Dependency>geany</Dependency>
<Dependency>lua51</Dependency>
<Dependency>gpgme</Dependency>
<Dependency>gnutls</Dependency>
<Dependency>libsoup</Dependency>
<Dependency>libxml2</Dependency>
<Dependency>libgit2</Dependency>
<Dependency>harfbuzz</Dependency>
<Dependency>libpcre2</Dependency>
<Dependency>enchant2</Dependency>
<Dependency>gtkspell3</Dependency>
<Dependency>libassuan</Dependency>
<Dependency>gdk-pixbuf</Dependency>
<Dependency>webkit2gtk</Dependency>
<Dependency>libgpg-error</Dependency>
</RuntimeDependencies>
<Files>
<Path fileType="library">/usr/lib</Path>
<Path fileType="data">/usr/share</Path>
<Path fileType="localedata">/usr/share/locale</Path>
<Path fileType="doc">/usr/share/doc</Path>
</Files>
</Package>
<Package>
<Name>geany-plugins</Name>
<RuntimeDependencies>
<Dependency>atk</Dependency>
<Dependency>vte</Dependency>
<Dependency>zlib</Dependency>
<Dependency>ctpl</Dependency>
<Dependency>gtk3</Dependency>
<Dependency>cairo</Dependency>
<Dependency>pango</Dependency>
<Dependency>glib2</Dependency>
<Dependency>geany</Dependency>
<Dependency>lua51</Dependency>
<Dependency>gpgme</Dependency>
<Dependency>gnutls</Dependency>
<Dependency>libxml2</Dependency>
<Dependency>libgit2</Dependency>
<Dependency>libsoup3</Dependency>
<Dependency>harfbuzz</Dependency>
<Dependency>libpcre2</Dependency>
<Dependency>enchant2</Dependency>
<Dependency>gtkspell3</Dependency>
<Dependency>libassuan</Dependency>
<Dependency>gdk-pixbuf</Dependency>
<Dependency>webkit2gtk</Dependency>
<Dependency>libgpg-error</Dependency>
</RuntimeDependencies>
<Files>
<Path fileType="library">/usr/lib</Path>
<Path fileType="data">/usr/share</Path>
<Path fileType="localedata">/usr/share/locale</Path>
<Path fileType="doc">/usr/share/doc</Path>
</Files>
</Package>
<History>
<Update release="10">
<Date>2025-07-06</Date>
<Version>2.1</Version>
<Comment>Version bump.</Comment>
<Name>Mustafa Cinasal</Name>
<Email>muscnsl@gmail.com</Email>
</Update>
<Update release="9">
<Date>2023-11-01</Date>
<Version>2.0</Version>
@@ -83,61 +88,61 @@
<Name>Mustafa Cinasal</Name>
<Email>muscnsl@gmail.com</Email>
</Update>
<Update release="8">
<Date>2022-10-07</Date>
<Version>1.38</Version>
<Comment>Version bump</Comment>
<Name>fury</Name>
<Email>uglyside@yandex.ru</Email>
</Update>
<Update release="7">
<Date>2021-03-01</Date>
<Version>1.37</Version>
<Comment>Version bump.</Comment>
<Name>fury</Name>
<Email>uglyside@yandex.ru</Email>
</Update>
<Update release="6">
<Date>2020-09-22</Date>
<Version>1.36</Version>
<Comment>Rebuild libgit2.</Comment>
<Name>fury</Name>
<Email>uglyside@yandex.ru</Email>
</Update>
<Update release="5">
<Date>2020-09-22</Date>
<Version>1.36</Version>
<Comment>Rebuild.</Comment>
<Name>fury</Name>
<Email>uglyside@yandex.ru</Email>
</Update>
<Update release="4">
<Date>2019-12-18</Date>
<Version>1.36</Version>
<Comment>Rebuild with gtk3.</Comment>
<Name>fury</Name>
<Email>uglyside@yandex.ru</Email>
</Update>
<Update release="3">
<Date>2019-10-15</Date>
<Version>1.36</Version>
<Comment>Ver. bump</Comment>
<Name>fury</Name>
<Email>uglyside@yandex.ru</Email>
</Update>
<Update release="2">
<Date>2019-07-05</Date>
<Version>1.35</Version>
<Comment>Ver. bump</Comment>
<Name>fury</Name>
<Email>uglyside@yandex.ru</Email>
</Update>
<Update release="1">
<Date>2019-04-21</Date>
<Version>1.34</Version>
<Comment>build</Comment>
<Name>fury</Name>
<Email>uglyside@yandex.ru</Email>
</Update>
</History>
<Update release="8">
<Date>2022-10-07</Date>
<Version>1.38</Version>
<Comment>Version bump</Comment>
<Name>fury</Name>
<Email>uglyside@yandex.ru</Email>
</Update>
<Update release="7">
<Date>2021-03-01</Date>
<Version>1.37</Version>
<Comment>Version bump.</Comment>
<Name>fury</Name>
<Email>uglyside@yandex.ru</Email>
</Update>
<Update release="6">
<Date>2020-09-22</Date>
<Version>1.36</Version>
<Comment>Rebuild libgit2.</Comment>
<Name>fury</Name>
<Email>uglyside@yandex.ru</Email>
</Update>
<Update release="5">
<Date>2020-09-22</Date>
<Version>1.36</Version>
<Comment>Rebuild.</Comment>
<Name>fury</Name>
<Email>uglyside@yandex.ru</Email>
</Update>
<Update release="4">
<Date>2019-12-18</Date>
<Version>1.36</Version>
<Comment>Rebuild with gtk3.</Comment>
<Name>fury</Name>
<Email>uglyside@yandex.ru</Email>
</Update>
<Update release="3">
<Date>2019-10-15</Date>
<Version>1.36</Version>
<Comment>Ver. bump</Comment>
<Name>fury</Name>
<Email>uglyside@yandex.ru</Email>
</Update>
<Update release="2">
<Date>2019-07-05</Date>
<Version>1.35</Version>
<Comment>Ver. bump</Comment>
<Name>fury</Name>
<Email>uglyside@yandex.ru</Email>
</Update>
<Update release="1">
<Date>2019-04-21</Date>
<Version>1.34</Version>
<Comment>build</Comment>
<Name>fury</Name>
<Email>uglyside@yandex.ru</Email>
</Update>
</History>
</PISI>