Skip to content
Snippets Groups Projects
Commit 400da981 authored by mio's avatar mio Committed by Ariadne Conill
Browse files

community/rofi-file-browser-extended: fix build with gcc 14

parent d627ebc3
No related branches found
No related tags found
1 merge request!71629community/rofi-file-browser-extended: fix build with gcc 14
Pipeline #257416 skipped
......@@ -2,7 +2,7 @@
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=rofi-file-browser-extended
pkgver=1.3.1
pkgrel=0
pkgrel=1
pkgdesc="Use rofi to quickly open files"
url="https://github.com/marvinkreis/rofi-file-browser-extended"
arch="all"
......@@ -10,7 +10,9 @@ license="MIT"
depends="cmd:rofi"
makedepends="cmake rofi-dev"
subpackages="$pkgname-doc"
source="https://github.com/marvinkreis/rofi-file-browser-extended/archive/$pkgver/rofi-file-browser-extended-$pkgver.tar.gz"
source="https://github.com/marvinkreis/rofi-file-browser-extended/archive/$pkgver/rofi-file-browser-extended-$pkgver.tar.gz
gcc14.patch
gcc14-32-bit.patch"
options="!check" # no tests provided
build() {
......@@ -32,4 +34,6 @@ package() {
sha512sums="
269e33d62e5fdf7f6c48763ae4309fac53873d53af4ebf78f731b709ac6ff41d8f8cf21de917866fe5a80f4949d70d3be6e516c3825a8768106c706438a5b3d1 rofi-file-browser-extended-1.3.1.tar.gz
6a68e6fb1b11af206c711fe1f9d63306c39f8adf695130ce177c212565820d7cb2af532186f3e4d10dc4a2e763901151793912bf01d2eadc149887601567544b gcc14.patch
822512ef5d063d5f084451ecbd4b6c1453479bf79c9b04a54cf950e189e672665595098833a169bbeaf60c51c472e87b389c5f4c0f2ed0a5cc789a7cc44106aa gcc14-32-bit.patch
"
Source: https://github.com/marvinkreis/rofi-file-browser-extended/pull/54/commits/27cb7d6e92de5cd48c2a70e3bd095fac905d5b7f
--
From 27cb7d6e92de5cd48c2a70e3bd095fac905d5b7f Mon Sep 17 00:00:00 2001
From: Brahmajit Das <brahmajit.xyz@gmail.com>
Date: Tue, 30 Apr 2024 11:39:59 +0530
Subject: [PATCH] Fix building with GCC 14 on i686
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
GCC 14 (and above) have enabled certain compiler flags such as
Wincompatible-pointer-types that causes build time errors such as
rofi-file-browser-extended-1.3.1/src/icons.c:52:57: error: passing argument 2 of ‘g_array_steal’ from incompatible pointer type [-Wincompatible-pointer-types]
52 | char** icon_names_raw = g_array_steal ( icon_names, &num_icon_names );
| ^~~~~~~~~~~~~~~
| |
| long unsigned int *
In file included from /usr/include/glib-2.0/glib.h:33,
from /usr/include/glib-2.0/gmodule.h:30,
from /var/tmp/portage/x11-misc/rofi-file-browser-extended-1.3.1-r1/work/rofi-file-browser-extended-1.3.1/src/icons.c:1:
/usr/include/glib-2.0/glib/garray.h:86:54: note: expected ‘gsize *’ {aka ‘unsigned int *’} but argument is of type ‘long unsigned int *’
86 | gsize *len);
| ~~~~~~~~~~~~~~~~~~^~~
My patch attempts to fix this error and some other C99 related warnings.
First reported on Gentoo linux, please reffer
https://bugs.gentoo.org/928491 for more details
Signed-off-by: Brahmajit Das <brahmajit.xyz@gmail.com>
---
src/files.c | 2 +-
src/icons.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/files.c b/src/files.c
index 29a5f9c..663a5f4 100644
--- a/src/files.c
+++ b/src/files.c
@@ -167,7 +167,7 @@ static bool match_glob_patterns ( const char *basename, FileBrowserFileData *fd
{
int len = strlen ( basename );
for ( int i = 0; i < fd->num_exclude_patterns; i++ ) {
- if ( g_pattern_match ( fd->exclude_patterns[i], len, basename, NULL ) ) {
+ if ( g_pattern_spec_match ( fd->exclude_patterns[i], len, basename, NULL ) ) {
return false;
}
}
diff --git a/src/icons.c b/src/icons.c
index eee00a4..ae476de 100644
--- a/src/icons.c
+++ b/src/icons.c
@@ -48,7 +48,7 @@ void request_icons_for_file ( FBFile *fbfile, int icon_size, FileBrowserIconData
}
}
- unsigned long num_icon_names;
+ gsize num_icon_names;
char** icon_names_raw = g_array_steal ( icon_names, &num_icon_names );
/* Create icon fetcher requests. */
Source: https://github.com/marvinkreis/rofi-file-browser-extended/pull/49
--
From 4d402e599e209a072492cc8c0e35a5e039e7bfd6 Mon Sep 17 00:00:00 2001
From: Florian Schmaus <flo@geekplace.eu>
Date: Fri, 11 Nov 2022 15:13:22 +0100
Subject: [PATCH] Check that 'height' is within INT_MAX
---
src/filebrowser.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/filebrowser.c b/src/filebrowser.c
index 59f0140..3060cd2 100644
--- a/src/filebrowser.c
+++ b/src/filebrowser.c
@@ -2,6 +2,7 @@
#include <stdio.h>
#include <gmodule.h>
#include <cairo.h>
+#include <limits.h>
#include <rofi/mode.h>
#include <rofi/helper.h>
#include <rofi/mode-private.h>
@@ -265,6 +266,13 @@ static char *file_browser_get_display_value ( const Mode *sw, unsigned int selec
static cairo_surface_t *file_browser_get_icon ( const Mode *sw, unsigned int selected_line, unsigned int height )
{
+ // We receive 'height' as unsinged int but later pass it to
+ // functions that take it as int, so check that the given value
+ // does not exceed INT_MAX.
+ if (height > INT_MAX) {
+ abort();
+ }
+
FileBrowserModePrivateData *pd = ( FileBrowserModePrivateData * ) mode_get_private_data ( sw );
FileBrowserFileData *fd = &pd->file_data;
FileBrowserIconData *id = &pd->icon_data;
---
From 6f62a2d0784a6937d35ac8f6df2e22c23bbfc8f4 Mon Sep 17 00:00:00 2001
From: Florian Schmaus <flo@geekplace.eu>
Date: Fri, 11 Nov 2022 15:03:32 +0100
Subject: [PATCH] Fix function pointer initialization
Fix
src/filebrowser.c:380:27: warning: incompatible function pointer types initializing '_mode_get_icon' (aka 'struct _cairo_surface *(*)(const struct rofi_mode *, unsigned int, unsigned int)') with an expression of type 'cairo_surface_t *(const Mode *, unsigned int, int)' (aka 'struct _cairo_surface *(const struct rofi_mode *, unsigned int, int)') [-Wincompatible-function-pointer-types]
._get_icon = file_browser_get_icon,
^~~~~~~~~~~~~~~~~~~~~
See also https://bugs.gentoo.org/880985
---
src/filebrowser.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/filebrowser.c b/src/filebrowser.c
index a5a19af..59f0140 100644
--- a/src/filebrowser.c
+++ b/src/filebrowser.c
@@ -263,7 +263,7 @@ static char *file_browser_get_display_value ( const Mode *sw, unsigned int selec
}
}
-static cairo_surface_t *file_browser_get_icon ( const Mode *sw, unsigned int selected_line, int height )
+static cairo_surface_t *file_browser_get_icon ( const Mode *sw, unsigned int selected_line, unsigned int height )
{
FileBrowserModePrivateData *pd = ( FileBrowserModePrivateData * ) mode_get_private_data ( sw );
FileBrowserFileData *fd = &pd->file_data;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment