From 54dab203604e8a705ac6f9dc9a15241f9c99fc71 Mon Sep 17 00:00:00 2001 From: Yifei Sun Date: Fri, 27 Dec 2024 11:28:53 -0500 Subject: [PATCH] libfm: fix build taken from https://github.com/ravenports/ravensource/tree/ad0d95339e569e69acfdd3e80cbe0bf4b9de1982/bucket_09/libfm/patches closes #368573 --- pkgs/by-name/li/libfm/0001-fm-load-all-actions.patch | 11 +++++++++++ .../li/libfm/0002-exo-icon-view-key-press-event.patch | 11 +++++++++++ pkgs/by-name/li/libfm/0003-ask-action-on-drop.patch | 11 +++++++++++ pkgs/by-name/li/libfm/0004-create-icon-view.patch | 11 +++++++++++ pkgs/by-name/li/libfm/package.nix | 7 +++++++ 5 files changed, 51 insertions(+) create mode 100644 pkgs/by-name/li/libfm/0001-fm-load-all-actions.patch create mode 100644 pkgs/by-name/li/libfm/0002-exo-icon-view-key-press-event.patch create mode 100644 pkgs/by-name/li/libfm/0003-ask-action-on-drop.patch create mode 100644 pkgs/by-name/li/libfm/0004-create-icon-view.patch diff --git a/pkgs/by-name/li/libfm/0001-fm-load-all-actions.patch b/pkgs/by-name/li/libfm/0001-fm-load-all-actions.patch new file mode 100644 index 000000000000..997300c07e3f --- /dev/null +++ b/pkgs/by-name/li/libfm/0001-fm-load-all-actions.patch @@ -0,0 +1,11 @@ +--- a/src/actions/action.c ++++ b/src/actions/action.c +@@ -2047,7 +2047,7 @@ + gchar* _tmp9_ = NULL; + _tmp0_ = fm_all_actions; + g_hash_table_remove_all (_tmp0_); +- _tmp2_ = _tmp1_ = g_get_system_data_dirs (); ++ _tmp2_ = _tmp1_ = (gchar **)g_get_system_data_dirs (); + dirs = _tmp2_; + dirs_length1 = _vala_array_length (_tmp1_); + _dirs_size_ = dirs_length1; diff --git a/pkgs/by-name/li/libfm/0002-exo-icon-view-key-press-event.patch b/pkgs/by-name/li/libfm/0002-exo-icon-view-key-press-event.patch new file mode 100644 index 000000000000..6f0965430112 --- /dev/null +++ b/pkgs/by-name/li/libfm/0002-exo-icon-view-key-press-event.patch @@ -0,0 +1,11 @@ +--- a/src/gtk/exo/exo-icon-view.c ++++ b/src/gtk/exo/exo-icon-view.c +@@ -2819,7 +2819,7 @@ + /* allocate a new event to forward */ + new_event = gdk_event_copy ((GdkEvent *) event); + g_object_unref (G_OBJECT (new_event->key.window)); +- new_event->key.window = g_object_ref (G_OBJECT (gtk_widget_get_window (icon_view->priv->search_entry))); ++ new_event->key.window = (GdkWindow *)g_object_ref (G_OBJECT (gtk_widget_get_window (icon_view->priv->search_entry))); + + /* send the event to the search entry. If the "preedit-changed" signal is + * emitted during this event, priv->search_imcontext_changed will be set. diff --git a/pkgs/by-name/li/libfm/0003-ask-action-on-drop.patch b/pkgs/by-name/li/libfm/0003-ask-action-on-drop.patch new file mode 100644 index 000000000000..6106ec9280f5 --- /dev/null +++ b/pkgs/by-name/li/libfm/0003-ask-action-on-drop.patch @@ -0,0 +1,11 @@ +--- a/src/gtk/fm-dnd-dest.c ++++ b/src/gtk/fm-dnd-dest.c +@@ -458,7 +458,7 @@ + gtk_action_set_sensitive(act, FALSE); + } + } +- ri.menu = g_object_ref(gtk_ui_manager_get_widget(ui, "/popup")); ++ ri.menu = (GtkMenu *)g_object_ref(gtk_ui_manager_get_widget(ui, "/popup")); + g_signal_connect(ri.menu, "selection-done", G_CALLBACK(gtk_widget_destroy), NULL); + unmap_handler = g_signal_connect(ri.menu, "unmap", + G_CALLBACK(run_unmap_handler), &ri); diff --git a/pkgs/by-name/li/libfm/0004-create-icon-view.patch b/pkgs/by-name/li/libfm/0004-create-icon-view.patch new file mode 100644 index 000000000000..6a16b6446c89 --- /dev/null +++ b/pkgs/by-name/li/libfm/0004-create-icon-view.patch @@ -0,0 +1,11 @@ +--- a/src/gtk/fm-standard-view.c ++++ b/src/gtk/fm-standard-view.c +@@ -637,7 +637,7 @@ + "text", FM_FOLDER_MODEL_COL_NAME ); + if(fv->renderer_text) + g_object_unref(fv->renderer_text); +- fv->renderer_text = g_object_ref_sink(render); ++ fv->renderer_text = (FmCellRendererText *)g_object_ref_sink(render); + exo_icon_view_set_search_column((ExoIconView*)fv->view, FM_FOLDER_MODEL_COL_NAME); + g_signal_connect(fv->view, "item-activated", G_CALLBACK(on_icon_view_item_activated), fv); + g_signal_connect(fv->view, "selection-changed", G_CALLBACK(on_sel_changed), fv); diff --git a/pkgs/by-name/li/libfm/package.nix b/pkgs/by-name/li/libfm/package.nix index 8ce1a0b2ccfe..d762036a22d0 100644 --- a/pkgs/by-name/li/libfm/package.nix +++ b/pkgs/by-name/li/libfm/package.nix @@ -27,6 +27,13 @@ stdenv.mkDerivation rec { sha256 = "sha256-pQQmMDBM+OXYz/nVZca9VG8ii0jJYBU+02ajTofK0eU="; }; + patches = [ + ./0001-fm-load-all-actions.patch + ./0002-exo-icon-view-key-press-event.patch + ./0003-ask-action-on-drop.patch + ./0004-create-icon-view.patch + ]; + nativeBuildInputs = [ vala pkg-config