[patchs] Let thunar support plugin search patchs and add some thunar plugins.

  • Done
  • quality assurance status badge
Details
4 participants
  • ???
  • Liliana Marie Prikler
  • Ludovic Courtès
  • Feng Shu
Owner
unassigned
Submitted by
Feng Shu
Severity
normal
Merged with
F
F
Feng Shu wrote on 22 Mar 2022 21:32
(address . bug-guix@gnu.org)
875yo5pw3i.fsf@163.com
--
T
T
tumashu wrote on 22 Mar 2022 21:49
[PATCH 1/5] gnu: Add thunar-archive-plugin.
(address . 54525@debbugs.gnu.org)(name . Feng Shu)(address . tumashu@163.com)
20220322204942.9624-1-tumashu@163.com
From: Feng Shu <tumashu@163.com>

* gnu/packages/xfce.scm (thunar-archive-plugin): New variable.
---
gnu/packages/xfce.scm | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)

Toggle diff (34 lines)
diff --git a/gnu/packages/xfce.scm b/gnu/packages/xfce.scm
index b58a517257..9de3db3cc4 100644
--- a/gnu/packages/xfce.scm
+++ b/gnu/packages/xfce.scm
@@ -792,6 +792,27 @@ (define-public thunar-volman
and import the new pictures from your camera.")
(license gpl2+)))
+(define-public thunar-archive-plugin
+ (package
+ (name "thunar-archive-plugin")
+ (version "0.4.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append "https://archive.xfce.org/src/thunar-plugins/"
+ name "/" (version-major+minor version)
+ "/" name "-" version ".tar.bz2"))
+ (sha256
+ (base32 "059ikda4hig1iqk0g5kqc4p95chj0z1ljhl5qjrlw4l8lf3gm0mz"))))
+ (build-system gnu-build-system)
+ (native-inputs (list pkg-config intltool))
+ (inputs (list exo thunar gtk+))
+ (home-page "https://www.xfce.org/")
+ (synopsis "Archive plugin for Thunar file manager")
+ (description "The Thunar Archive Plugin allows you to create and extract
+archive files using the file context menus in the Thunar file manager.")
+ (license gpl2+)))
+
(define-public xfwm4
(package
(name "xfwm4")
--
2.34.0
T
T
tumashu wrote on 22 Mar 2022 21:49
[PATCH 2/5] gnu: Add thunar-shares-plugin.
(address . 54525@debbugs.gnu.org)(name . Feng Shu)(address . tumashu@163.com)
20220322204942.9624-2-tumashu@163.com
From: Feng Shu <tumashu@163.com>

* gnu/packages/xfce.scm (thunar-shares-plugin): New variable.
---
gnu/packages/xfce.scm | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)

Toggle diff (35 lines)
diff --git a/gnu/packages/xfce.scm b/gnu/packages/xfce.scm
index 9de3db3cc4..ba4e51a2f3 100644
--- a/gnu/packages/xfce.scm
+++ b/gnu/packages/xfce.scm
@@ -813,6 +813,28 @@ (define-public thunar-archive-plugin
archive files using the file context menus in the Thunar file manager.")
(license gpl2+)))
+(define-public thunar-shares-plugin
+ (package
+ (name "thunar-shares-plugin")
+ (version "0.3.1")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append "https://archive.xfce.org/src/thunar-plugins/"
+ name "/" (version-major+minor version)
+ "/" name "-" version ".tar.bz2"))
+ (sha256
+ (base32 "182j8jl91735004hbl0i2xxga4r6fk03srfl6g87czkjm9y8q7fw"))))
+ (build-system gnu-build-system)
+ (native-inputs (list pkg-config intltool))
+ (inputs (list thunar gtk+))
+ (home-page "https://www.xfce.org/")
+ (synopsis "Folder share plugin for Thunar file manager")
+ (description
+ "The Thunar Shares Plugin allows you to quickly share a folder using
+Samba from Thunar (the Xfce file manager) without requiring root access.")
+ (license gpl2+)))
+
(define-public xfwm4
(package
(name "xfwm4")
--
2.34.0
T
T
tumashu wrote on 22 Mar 2022 21:49
[PATCH 3/5] gnu: Add thunar-media-tags-plugin.
(address . 54525@debbugs.gnu.org)(name . Feng Shu)(address . tumashu@163.com)
20220322204942.9624-3-tumashu@163.com
From: Feng Shu <tumashu@163.com>

* gnu/packages/xfce.scm (thunar-media-tags-plugin): New variable.
---
gnu/packages/xfce.scm | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)

Toggle diff (43 lines)
diff --git a/gnu/packages/xfce.scm b/gnu/packages/xfce.scm
index ba4e51a2f3..083e890cc7 100644
--- a/gnu/packages/xfce.scm
+++ b/gnu/packages/xfce.scm
@@ -52,6 +52,7 @@ (define-module (gnu packages xfce)
#:use-module (gnu packages libcanberra)
#:use-module (gnu packages linux)
#:use-module (gnu packages mate)
+ #:use-module (gnu packages mp3)
#:use-module (gnu packages pcre)
#:use-module (gnu packages pdf)
#:use-module (gnu packages photo)
@@ -835,6 +836,28 @@ (define-public thunar-shares-plugin
Samba from Thunar (the Xfce file manager) without requiring root access.")
(license gpl2+)))
+(define-public thunar-media-tags-plugin
+ (package
+ (name "thunar-media-tags-plugin")
+ (version "0.3.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append "https://archive.xfce.org/src/thunar-plugins/"
+ name "/" (version-major+minor version)
+ "/" name "-" version ".tar.bz2"))
+ (sha256
+ (base32 "06sr7b4p9f585gian8vpx7j0pkzg0vvwcrjmrhvh7i5sb90w8rg2"))))
+ (build-system gnu-build-system)
+ (native-inputs (list pkg-config intltool))
+ (inputs (list exo gtk+ thunar taglib))
+ (home-page "https://www.xfce.org/")
+ (synopsis "Media tags plugin for Thunar file manager")
+ (description
+ "Media tags plugin allows tags editing from Thunar file manager and
+tags-based file renaming from inside Thunar Bulk Renamer.")
+ (license gpl2+)))
+
(define-public xfwm4
(package
(name "xfwm4")
--
2.34.0
T
T
tumashu wrote on 22 Mar 2022 21:49
[PATCH 4/5] gnu: Add thunar-vcs-plugin.
(address . 54525@debbugs.gnu.org)(name . Feng Shu)(address . tumashu@163.com)
20220322204942.9624-4-tumashu@163.com
From: Feng Shu <tumashu@163.com>

* gnu/packages/xfce.scm (thunar-vcs-plugin): New variable.
---
gnu/packages/xfce.scm | 37 +++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)

Toggle diff (64 lines)
diff --git a/gnu/packages/xfce.scm b/gnu/packages/xfce.scm
index 083e890cc7..d3a414ec15 100644
--- a/gnu/packages/xfce.scm
+++ b/gnu/packages/xfce.scm
@@ -35,6 +35,7 @@
(define-module (gnu packages xfce)
#:use-module (gnu artwork)
#:use-module (gnu packages)
+ #:use-module (gnu packages apr)
#:use-module (gnu packages base)
#:use-module (gnu packages calendar)
#:use-module (gnu packages cdrom)
@@ -63,6 +64,8 @@ (define-module (gnu packages xfce)
#:use-module (gnu packages python-xyz)
#:use-module (gnu packages pulseaudio)
#:use-module (gnu packages search)
+ #:use-module (gnu packages textutils)
+ #:use-module (gnu packages version-control)
#:use-module (gnu packages web)
#:use-module (gnu packages wm)
#:use-module (gnu packages xml)
@@ -858,6 +861,40 @@ (define-public thunar-media-tags-plugin
tags-based file renaming from inside Thunar Bulk Renamer.")
(license gpl2+)))
+(define-public thunar-vcs-plugin
+ (package
+ (name "thunar-vcs-plugin")
+ (version "0.2.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append "https://archive.xfce.org/src/thunar-plugins/"
+ name "/" (version-major+minor version)
+ "/" name "-" version ".tar.bz2"))
+ (sha256
+ (base32 "1f2d1dwfyi6xv3qkd8l8xh0vhz8wh0601cyigjzn426lqga1d29n"))))
+ (build-system gnu-build-system)
+ (arguments
+ (list #:configure-flags
+ #~(list (string-append "CPPFLAGS=-I" #$apr-util "/include/apr-1"))))
+ (native-inputs (list pkg-config intltool utf8proc))
+ (inputs
+ (list exo
+ gtk+
+ thunar
+ libxfce4util
+ apr
+ apr-util
+ subversion
+ git))
+ (home-page "https://www.xfce.org/")
+ (synopsis "VCS plugin for Thunar file manager")
+ (description
+ "Thunar VCS Plugin (formerly known as Thunar SVN Plugin) gives SVN and
+GIT integration to Thunar, it adds Subversion and GIT actions to the context
+menu.")
+ (license gpl2+)))
+
(define-public xfwm4
(package
(name "xfwm4")
--
2.34.0
T
T
tumashu wrote on 22 Mar 2022 21:49
[PATCH 5/5] gnu: thunar: Add search path for "THUNARX_DIRS".
(address . 54525@debbugs.gnu.org)(name . Feng Shu)(address . tumashu@163.com)
20220322204942.9624-5-tumashu@163.com
From: Feng Shu <tumashu@163.com>

* gnu/packages/xfce.scm (thunar)[native-search-paths]: new field.
[source]: Add thunar-search-paths.patch.
---
.../patches/thunar-search-paths.patch | 211 ++++++++++++++++++
gnu/packages/xfce.scm | 12 +-
2 files changed, 222 insertions(+), 1 deletion(-)
create mode 100644 gnu/packages/patches/thunar-search-paths.patch

Toggle diff (256 lines)
diff --git a/gnu/packages/patches/thunar-search-paths.patch b/gnu/packages/patches/thunar-search-paths.patch
new file mode 100644
index 0000000000..fcf55ba14f
--- /dev/null
+++ b/gnu/packages/patches/thunar-search-paths.patch
@@ -0,0 +1,211 @@
+From 848f1dfb2d2f404efa5371817285236d33b32a5c Mon Sep 17 00:00:00 2001
+From: tumashu <tumashu@163.com>
+Date: Tue, 22 Mar 2022 20:16:19 +0000
+Subject: [PATCH] Look for thunar plugins at $THUNARX_DIRS (Issue #748)
+
+THUNARX_DIRS is a list of directories where thunar plugins are looked
+for. It is needed for distributions like NixOS/GuixOS that do not
+install all plugins in the same directory. In NixOS/GuixOS each
+package is installed in a self contained directory.
+
+MR !197
+---
+ thunarx/thunarx-provider-factory.c | 86 +++++++++++++++++-------------
+ thunarx/thunarx-provider-module.c | 68 ++++++++++++++---------
+ 2 files changed, 91 insertions(+), 63 deletions(-)
+
+diff --git a/thunarx/thunarx-provider-factory.c b/thunarx/thunarx-provider-factory.c
+index 94b11545..386c3417 100644
+--- a/thunarx/thunarx-provider-factory.c
++++ b/thunarx/thunarx-provider-factory.c
+@@ -154,54 +154,66 @@ thunarx_provider_factory_load_modules (ThunarxProviderFactory *factory)
+ GList *modules = NULL;
+ GList *lp;
+ GDir *dp;
++ gchar *dirs_string;
++ gchar **dirs;
+
+- dp = g_dir_open (THUNARX_DIRECTORY, 0, NULL);
+- if (G_LIKELY (dp != NULL))
++ dirs_string = (gchar *) g_getenv ("THUNARX_DIRS");
++ if (!dirs_string)
++ dirs_string = THUNARX_DIRECTORY;
++ dirs = g_strsplit (dirs_string, G_SEARCHPATH_SEPARATOR_S, 0);
++
++ for (int i = 0; dirs[i] != NULL; i++)
+ {
+- /* determine the types for all existing plugins */
+- for (;;)
+- {
+- /* read the next entry from the directory */
+- name = g_dir_read_name (dp);
+- if (G_UNLIKELY (name == NULL))
+- break;
+
+- /* check if this is a valid plugin file */
+- if (g_str_has_suffix (name, "." G_MODULE_SUFFIX))
+- {
+- /* check if we already have that module */
+- for (lp = thunarx_provider_modules; lp != NULL; lp = lp->next)
+- if (g_str_equal (G_TYPE_MODULE (lp->data)->name, name))
+- break;
++ dp = g_dir_open (dirs[i], 0, NULL);
+
+- /* use or allocate a new module for the file */
+- if (G_UNLIKELY (lp != NULL))
+- {
+- /* just use the existing module */
+- module = THUNARX_PROVIDER_MODULE (lp->data);
+- }
+- else
+- {
+- /* allocate the new module and add it to our list */
+- module = thunarx_provider_module_new (name);
+- thunarx_provider_modules = g_list_prepend (thunarx_provider_modules, module);
+- }
++ if (G_LIKELY (dp != NULL))
++ {
++ /* determine the types for all existing plugins */
++ for (;;)
++ {
++ /* read the next entry from the directory */
++ name = g_dir_read_name (dp);
++ if (G_UNLIKELY (name == NULL))
++ break;
+
+- /* try to load the module */
+- if (g_type_module_use (G_TYPE_MODULE (module)))
++ /* check if this is a valid plugin file */
++ if (g_str_has_suffix (name, "." G_MODULE_SUFFIX))
+ {
+- /* add the types provided by the module */
+- thunarx_provider_factory_add (factory, module);
+-
+- /* add the module to our list */
+- modules = g_list_prepend (modules, module);
++ /* check if we already have that module */
++ for (lp = thunarx_provider_modules; lp != NULL; lp = lp->next)
++ if (g_str_equal (G_TYPE_MODULE (lp->data)->name, name))
++ break;
++
++ /* use or allocate a new module for the file */
++ if (G_UNLIKELY (lp != NULL))
++ {
++ continue;
++ }
++ else
++ {
++ /* allocate the new module and add it to our list */
++ module = thunarx_provider_module_new (name);
++ thunarx_provider_modules = g_list_prepend (thunarx_provider_modules, module);
++ }
++
++ /* try to load the module */
++ if (g_type_module_use (G_TYPE_MODULE (module)))
++ {
++ /* add the types provided by the module */
++ thunarx_provider_factory_add (factory, module);
++
++ /* add the module to our list */
++ modules = g_list_prepend (modules, module);
++ }
+ }
+ }
+- }
+
+- g_dir_close (dp);
++ g_dir_close (dp);
++ }
+ }
+
++ g_strfreev (dirs);
+ return modules;
+ }
+
+diff --git a/thunarx/thunarx-provider-module.c b/thunarx/thunarx-provider-module.c
+index 023ad2ae..5ddf38b2 100644
+--- a/thunarx/thunarx-provider-module.c
++++ b/thunarx/thunarx-provider-module.c
+@@ -175,37 +175,53 @@ thunarx_provider_module_load (GTypeModule *type_module)
+ {
+ ThunarxProviderModule *module = THUNARX_PROVIDER_MODULE (type_module);
+ gchar *path;
++ gchar *dirs_string;
++ gchar **dirs;
++ gboolean found;
+
+- /* load the module using the runtime link editor */
+- path = g_build_filename (THUNARX_DIRECTORY, type_module->name, NULL);
+- module->library = g_module_open (path, G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL);
+- g_free (path);
++ dirs_string = (gchar *) g_getenv ("THUNARX_DIRS");
++ if (!dirs_string)
++ dirs_string = THUNARX_DIRECTORY;
++ dirs = g_strsplit (dirs_string, G_SEARCHPATH_SEPARATOR_S, 0);
+
+- /* check if the load operation was successfull */
+- if (G_UNLIKELY (module->library == NULL))
+- {
+- g_printerr ("Thunar :Failed to load plugin `%s': %s\n", type_module->name, g_module_error ());
+- return FALSE;
+- }
++ found = FALSE;
+
+- /* verify that all required public symbols are present in the plugin's symbol table */
+- if (!g_module_symbol (module->library, "thunar_extension_shutdown", (gpointer) &module->shutdown)
+- || !g_module_symbol (module->library, "thunar_extension_initialize", (gpointer) &module->initialize)
+- || !g_module_symbol (module->library, "thunar_extension_list_types", (gpointer) &module->list_types))
++ for (int i = 0; !found && dirs[i] != NULL; i++)
+ {
+- g_printerr ("Thunar :Plugin `%s' lacks required symbols.\n", type_module->name);
+- g_module_close (module->library);
+- return FALSE;
++ /* load the module using the runtime link editor */
++ path = g_build_filename (dirs[i], type_module->name, NULL);
++
++ module->library = g_module_open (path, G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL);
++ g_free (path);
++
++ /* check if the load operation was successfull */
++ if (G_UNLIKELY (module->library == NULL))
++ {
++ g_printerr ("Thunar :Failed to load plugin `%s' from `%s': %s\n", type_module->name, path, g_module_error ());
++ continue;
++ }
++
++ /* verify that all required public symbols are present in the plugin's symbol table */
++ if (!g_module_symbol (module->library, "thunar_extension_shutdown", (gpointer) &module->shutdown)
++ || !g_module_symbol (module->library, "thunar_extension_initialize", (gpointer) &module->initialize)
++ || !g_module_symbol (module->library, "thunar_extension_list_types", (gpointer) &module->list_types))
++ {
++ g_printerr ("Thunar :Plugin `%s' in `%s' lacks required symbols.\n", type_module->name, path);
++ g_module_close (module->library);
++ continue;
++ }
++
++ /* initialize the plugin */
++ (*module->initialize) (module);
++
++ /* ensure that the module will never be unloaded if it requests to be kept in memory */
++ if (G_UNLIKELY (module->resident))
++ g_module_make_resident (module->library);
++
++ found = TRUE;
+ }
+-
+- /* initialize the plugin */
+- (*module->initialize) (module);
+-
+- /* ensure that the module will never be unloaded if it requests to be kept in memory */
+- if (G_UNLIKELY (module->resident))
+- g_module_make_resident (module->library);
+-
+- return TRUE;
++ g_strfreev (dirs);
++ return found;
+ }
+
+
+--
+2.34.0
+
diff --git a/gnu/packages/xfce.scm b/gnu/packages/xfce.scm
index d3a414ec15..bdeb1e9583 100644
--- a/gnu/packages/xfce.scm
+++ b/gnu/packages/xfce.scm
@@ -16,6 +16,7 @@
;;; Copyright © 2020, 2021, 2022 Michael Rohleder <mike@rohleder.de>
;;; Copyright © 2021 Brendan Tildesley <mail@brendan.scot>
;;; Copyright © 2021 André A. Gomes <andremegafone@gmail.com>
+;;; Copyright © 2022 Feng Shu <tumashu@163.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -747,7 +748,12 @@ (define-public thunar
"thunar-" version ".tar.bz2"))
(sha256
(base32
- "14lwi4ax0wj77980kkfhdf18b97339b17y8qc8gl2365mgswh1gi"))))
+ "14lwi4ax0wj77980kkfhdf18b97339b17y8qc8gl2365mgswh1gi"))
+ (patches
+ (search-patches
+ ;; NOTE: This patch is backported from thunar.git, it should
+ ;; be removed when update to thunar-4.18.
+ "thunar-search-paths.patch"))))
(build-system gnu-build-system)
(native-inputs
(list pkg-config intltool))
@@ -762,6 +768,10 @@ (define-public thunar
pcre
xfce4-panel
startup-notification))
+ (native-search-paths
+ (list (search-path-specification
+ (variable "THUNARX_DIRS")
+ (files (list "lib/thunarx-3")))))
(home-page "https://www.xfce.org/")
(synopsis "Xfce file manager")
(description
--
2.34.0
L
L
Liliana Marie Prikler wrote on 23 Mar 2022 21:52
Re: Processed (with 1 errors): your mail
(name . GNU bug tracker automated control server)(address . control@debbugs.gnu.org)
2c5ceb4b399f7e182ffd34be08914a46e26cab47.camel@gmail.com
reassign 54525 guix-patches
merge 54525 54526
thanks
L
L
Ludovic Courtès wrote on 29 Mar 2022 11:45
Re: bug#54525: [patchs] Let thunar support plugin search patchs and add some thunar plugins.
(address . tumashu@163.com)(address . 54525@debbugs.gnu.org)
87o81p2itr.fsf_-_@gnu.org
Hi,

tumashu@163.com skribis:

Toggle quote (5 lines)
> From: Feng Shu <tumashu@163.com>
>
> * gnu/packages/xfce.scm (thunar)[native-search-paths]: new field.
> [source]: Add thunar-search-paths.patch.

Please add the patch to gnu/local.mk.

Toggle quote (14 lines)
> +++ b/gnu/packages/patches/thunar-search-paths.patch
> @@ -0,0 +1,211 @@
> +From 848f1dfb2d2f404efa5371817285236d33b32a5c Mon Sep 17 00:00:00 2001
> +From: tumashu <tumashu@163.com>
> +Date: Tue, 22 Mar 2022 20:16:19 +0000
> +Subject: [PATCH] Look for thunar plugins at $THUNARX_DIRS (Issue #748)
> +
> +THUNARX_DIRS is a list of directories where thunar plugins are looked
> +for. It is needed for distributions like NixOS/GuixOS that do not
> +install all plugins in the same directory. In NixOS/GuixOS each
> +package is installed in a self contained directory.
> +
> +MR !197

There is no such thing as “GuixOS”, it’s called “Guix System”. :-)

Is this going to be included upstream? If yes, could you add the URL of
the upstream discussion or merge request?

(If it’s not included upstream, I would suggest “THUNARX_PLUGIN_PATH” or
“THUNARX_PLUGIN_DIRECTORIES” for the environment variable name.)

Apart from that, this patch and the previous ones LGTM.

Could you send a v2 based on that?

Thanks,
Ludo’.
T
T
tumashu wrote on 29 Mar 2022 15:03
[patch v2 2/5] gnu: Add thunar-shares-plugin.
(address . 54525@debbugs.gnu.org)(name . Feng Shu)(address . tumashu@163.com)
20220329130402.26022-2-tumashu@163.com
From: Feng Shu <tumashu@163.com>

* gnu/packages/xfce.scm (thunar-shares-plugin): New variable.
---
gnu/packages/xfce.scm | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)

Toggle diff (35 lines)
diff --git a/gnu/packages/xfce.scm b/gnu/packages/xfce.scm
index 1b0e262735..8bfa3a9422 100644
--- a/gnu/packages/xfce.scm
+++ b/gnu/packages/xfce.scm
@@ -813,6 +813,28 @@ (define-public thunar-archive-plugin
archive files using the file context menus in the Thunar file manager.")
(license gpl2+)))
+(define-public thunar-shares-plugin
+ (package
+ (name "thunar-shares-plugin")
+ (version "0.3.1")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append "https://archive.xfce.org/src/thunar-plugins/"
+ name "/" (version-major+minor version)
+ "/" name "-" version ".tar.bz2"))
+ (sha256
+ (base32 "182j8jl91735004hbl0i2xxga4r6fk03srfl6g87czkjm9y8q7fw"))))
+ (build-system gnu-build-system)
+ (native-inputs (list pkg-config intltool))
+ (inputs (list thunar gtk+))
+ (home-page "https://www.xfce.org/")
+ (synopsis "Folder share plugin for Thunar file manager")
+ (description
+ "The Thunar Shares Plugin allows you to quickly share a folder using
+Samba from Thunar (the Xfce file manager) without requiring root access.")
+ (license gpl2+)))
+
(define-public xfwm4
(package
(name "xfwm4")
--
2.34.0
T
T
tumashu wrote on 29 Mar 2022 15:03
[patch v2 1/5] gnu: Add thunar-archive-plugin.
(address . 54525@debbugs.gnu.org)(name . Feng Shu)(address . tumashu@163.com)
20220329130402.26022-1-tumashu@163.com
From: Feng Shu <tumashu@163.com>

* gnu/packages/xfce.scm (thunar-archive-plugin): New variable.
---
gnu/packages/xfce.scm | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)

Toggle diff (34 lines)
diff --git a/gnu/packages/xfce.scm b/gnu/packages/xfce.scm
index 90f7467cef..1b0e262735 100644
--- a/gnu/packages/xfce.scm
+++ b/gnu/packages/xfce.scm
@@ -792,6 +792,27 @@ (define-public thunar-volman
and import the new pictures from your camera.")
(license gpl2+)))
+(define-public thunar-archive-plugin
+ (package
+ (name "thunar-archive-plugin")
+ (version "0.4.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append "https://archive.xfce.org/src/thunar-plugins/"
+ name "/" (version-major+minor version)
+ "/" name "-" version ".tar.bz2"))
+ (sha256
+ (base32 "059ikda4hig1iqk0g5kqc4p95chj0z1ljhl5qjrlw4l8lf3gm0mz"))))
+ (build-system gnu-build-system)
+ (native-inputs (list pkg-config intltool))
+ (inputs (list exo thunar gtk+))
+ (home-page "https://www.xfce.org/")
+ (synopsis "Archive plugin for Thunar file manager")
+ (description "The Thunar Archive Plugin allows you to create and extract
+archive files using the file context menus in the Thunar file manager.")
+ (license gpl2+)))
+
(define-public xfwm4
(package
(name "xfwm4")
--
2.34.0
T
T
tumashu wrote on 29 Mar 2022 15:04
[patch v2 3/5] gnu: Add thunar-media-tags-plugin.
(address . 54525@debbugs.gnu.org)(name . Feng Shu)(address . tumashu@163.com)
20220329130402.26022-3-tumashu@163.com
From: Feng Shu <tumashu@163.com>

* gnu/packages/xfce.scm (thunar-media-tags-plugin): New variable.
---
gnu/packages/xfce.scm | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)

Toggle diff (43 lines)
diff --git a/gnu/packages/xfce.scm b/gnu/packages/xfce.scm
index 8bfa3a9422..44d34cab8f 100644
--- a/gnu/packages/xfce.scm
+++ b/gnu/packages/xfce.scm
@@ -52,6 +52,7 @@ (define-module (gnu packages xfce)
#:use-module (gnu packages libcanberra)
#:use-module (gnu packages linux)
#:use-module (gnu packages mate)
+ #:use-module (gnu packages mp3)
#:use-module (gnu packages pcre)
#:use-module (gnu packages pdf)
#:use-module (gnu packages photo)
@@ -835,6 +836,28 @@ (define-public thunar-shares-plugin
Samba from Thunar (the Xfce file manager) without requiring root access.")
(license gpl2+)))
+(define-public thunar-media-tags-plugin
+ (package
+ (name "thunar-media-tags-plugin")
+ (version "0.3.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append "https://archive.xfce.org/src/thunar-plugins/"
+ name "/" (version-major+minor version)
+ "/" name "-" version ".tar.bz2"))
+ (sha256
+ (base32 "06sr7b4p9f585gian8vpx7j0pkzg0vvwcrjmrhvh7i5sb90w8rg2"))))
+ (build-system gnu-build-system)
+ (native-inputs (list pkg-config intltool))
+ (inputs (list exo gtk+ thunar taglib))
+ (home-page "https://www.xfce.org/")
+ (synopsis "Media tags plugin for Thunar file manager")
+ (description
+ "Media tags plugin allows tags editing from Thunar file manager and
+tags-based file renaming from inside Thunar Bulk Renamer.")
+ (license gpl2+)))
+
(define-public xfwm4
(package
(name "xfwm4")
--
2.34.0
T
T
tumashu wrote on 29 Mar 2022 15:04
[patch v2 5/5] gnu: thunar: Add search path for "THUNARX_DIRS".
(address . 54525@debbugs.gnu.org)(name . Feng Shu)(address . tumashu@163.com)
20220329130402.26022-5-tumashu@163.com
From: Feng Shu <tumashu@163.com>

* gnu/packages/xfce.scm (thunar)[native-search-paths]: new field.
[source]: Add thunar-search-paths.patch.
* gnu/local.mk: Add thunar-search-paths.patch.
---
gnu/local.mk | 1 +
.../patches/thunar-search-paths.patch | 214 ++++++++++++++++++
gnu/packages/xfce.scm | 12 +-
3 files changed, 226 insertions(+), 1 deletion(-)
create mode 100644 gnu/packages/patches/thunar-search-paths.patch

Toggle diff (271 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index a704161abc..f715ec564a 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1845,6 +1845,7 @@ dist_patch_DATA = \
%D%/packages/patches/texi2html-document-encoding.patch \
%D%/packages/patches/texi2html-i18n.patch \
%D%/packages/patches/thefuck-test-environ.patch \
+ %D%/packages/patches/thunar-search-paths.patch \
%D%/packages/patches/tidy-CVE-2015-5522+5523.patch \
%D%/packages/patches/tinyxml-use-stl.patch \
%D%/packages/patches/tipp10-disable-downloader.patch \
diff --git a/gnu/packages/patches/thunar-search-paths.patch b/gnu/packages/patches/thunar-search-paths.patch
new file mode 100644
index 0000000000..31f54cbdc0
--- /dev/null
+++ b/gnu/packages/patches/thunar-search-paths.patch
@@ -0,0 +1,214 @@
+From 848f1dfb2d2f404efa5371817285236d33b32a5c Mon Sep 17 00:00:00 2001
+From: tumashu <tumashu@163.com>
+Date: Tue, 22 Mar 2022 20:16:19 +0000
+Subject: [PATCH] Look for thunar plugins at $THUNARX_DIRS (Issue #748)
+
+THUNARX_DIRS is a list of directories where thunar plugins are looked for. It
+is needed for distributions like NixOS or Guix System that do not install all
+plugins in the same directory. In NixOS or Guix System each package is
+installed in a self contained directory.
+
+This patch has been merged into thunar master:
+1. Issue: https://gitlab.xfce.org/xfce/thunar/-/issues/748
+2. Merge Request: https://gitlab.xfce.org/xfce/thunar/-/merge_requests/197
+
+---
+ thunarx/thunarx-provider-factory.c | 86 +++++++++++++++++-------------
+ thunarx/thunarx-provider-module.c | 68 ++++++++++++++---------
+ 2 files changed, 91 insertions(+), 63 deletions(-)
+
+diff --git a/thunarx/thunarx-provider-factory.c b/thunarx/thunarx-provider-factory.c
+index 94b11545..386c3417 100644
+--- a/thunarx/thunarx-provider-factory.c
++++ b/thunarx/thunarx-provider-factory.c
+@@ -154,54 +154,66 @@ thunarx_provider_factory_load_modules (ThunarxProviderFactory *factory)
+ GList *modules = NULL;
+ GList *lp;
+ GDir *dp;
++ gchar *dirs_string;
++ gchar **dirs;
+
+- dp = g_dir_open (THUNARX_DIRECTORY, 0, NULL);
+- if (G_LIKELY (dp != NULL))
++ dirs_string = (gchar *) g_getenv ("THUNARX_DIRS");
++ if (!dirs_string)
++ dirs_string = THUNARX_DIRECTORY;
++ dirs = g_strsplit (dirs_string, G_SEARCHPATH_SEPARATOR_S, 0);
++
++ for (int i = 0; dirs[i] != NULL; i++)
+ {
+- /* determine the types for all existing plugins */
+- for (;;)
+- {
+- /* read the next entry from the directory */
+- name = g_dir_read_name (dp);
+- if (G_UNLIKELY (name == NULL))
+- break;
+
+- /* check if this is a valid plugin file */
+- if (g_str_has_suffix (name, "." G_MODULE_SUFFIX))
+- {
+- /* check if we already have that module */
+- for (lp = thunarx_provider_modules; lp != NULL; lp = lp->next)
+- if (g_str_equal (G_TYPE_MODULE (lp->data)->name, name))
+- break;
++ dp = g_dir_open (dirs[i], 0, NULL);
+
+- /* use or allocate a new module for the file */
+- if (G_UNLIKELY (lp != NULL))
+- {
+- /* just use the existing module */
+- module = THUNARX_PROVIDER_MODULE (lp->data);
+- }
+- else
+- {
+- /* allocate the new module and add it to our list */
+- module = thunarx_provider_module_new (name);
+- thunarx_provider_modules = g_list_prepend (thunarx_provider_modules, module);
+- }
++ if (G_LIKELY (dp != NULL))
++ {
++ /* determine the types for all existing plugins */
++ for (;;)
++ {
++ /* read the next entry from the directory */
++ name = g_dir_read_name (dp);
++ if (G_UNLIKELY (name == NULL))
++ break;
+
+- /* try to load the module */
+- if (g_type_module_use (G_TYPE_MODULE (module)))
++ /* check if this is a valid plugin file */
++ if (g_str_has_suffix (name, "." G_MODULE_SUFFIX))
+ {
+- /* add the types provided by the module */
+- thunarx_provider_factory_add (factory, module);
+-
+- /* add the module to our list */
+- modules = g_list_prepend (modules, module);
++ /* check if we already have that module */
++ for (lp = thunarx_provider_modules; lp != NULL; lp = lp->next)
++ if (g_str_equal (G_TYPE_MODULE (lp->data)->name, name))
++ break;
++
++ /* use or allocate a new module for the file */
++ if (G_UNLIKELY (lp != NULL))
++ {
++ continue;
++ }
++ else
++ {
++ /* allocate the new module and add it to our list */
++ module = thunarx_provider_module_new (name);
++ thunarx_provider_modules = g_list_prepend (thunarx_provider_modules, module);
++ }
++
++ /* try to load the module */
++ if (g_type_module_use (G_TYPE_MODULE (module)))
++ {
++ /* add the types provided by the module */
++ thunarx_provider_factory_add (factory, module);
++
++ /* add the module to our list */
++ modules = g_list_prepend (modules, module);
++ }
+ }
+ }
+- }
+
+- g_dir_close (dp);
++ g_dir_close (dp);
++ }
+ }
+
++ g_strfreev (dirs);
+ return modules;
+ }
+
+diff --git a/thunarx/thunarx-provider-module.c b/thunarx/thunarx-provider-module.c
+index 023ad2ae..5ddf38b2 100644
+--- a/thunarx/thunarx-provider-module.c
++++ b/thunarx/thunarx-provider-module.c
+@@ -175,37 +175,53 @@ thunarx_provider_module_load (GTypeModule *type_module)
+ {
+ ThunarxProviderModule *module = THUNARX_PROVIDER_MODULE (type_module);
+ gchar *path;
++ gchar *dirs_string;
++ gchar **dirs;
++ gboolean found;
+
+- /* load the module using the runtime link editor */
+- path = g_build_filename (THUNARX_DIRECTORY, type_module->name, NULL);
+- module->library = g_module_open (path, G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL);
+- g_free (path);
++ dirs_string = (gchar *) g_getenv ("THUNARX_DIRS");
++ if (!dirs_string)
++ dirs_string = THUNARX_DIRECTORY;
++ dirs = g_strsplit (dirs_string, G_SEARCHPATH_SEPARATOR_S, 0);
+
+- /* check if the load operation was successfull */
+- if (G_UNLIKELY (module->library == NULL))
+- {
+- g_printerr ("Thunar :Failed to load plugin `%s': %s\n", type_module->name, g_module_error ());
+- return FALSE;
+- }
++ found = FALSE;
+
+- /* verify that all required public symbols are present in the plugin's symbol table */
+- if (!g_module_symbol (module->library, "thunar_extension_shutdown", (gpointer) &module->shutdown)
+- || !g_module_symbol (module->library, "thunar_extension_initialize", (gpointer) &module->initialize)
+- || !g_module_symbol (module->library, "thunar_extension_list_types", (gpointer) &module->list_types))
++ for (int i = 0; !found && dirs[i] != NULL; i++)
+ {
+- g_printerr ("Thunar :Plugin `%s' lacks required symbols.\n", type_module->name);
+- g_module_close (module->library);
+- return FALSE;
++ /* load the module using the runtime link editor */
++ path = g_build_filename (dirs[i], type_module->name, NULL);
++
++ module->library = g_module_open (path, G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL);
++ g_free (path);
++
++ /* check if the load operation was successfull */
++ if (G_UNLIKELY (module->library == NULL))
++ {
++ g_printerr ("Thunar :Failed to load plugin `%s' from `%s': %s\n", type_module->name, path, g_module_error ());
++ continue;
++ }
++
++ /* verify that all required public symbols are present in the plugin's symbol table */
++ if (!g_module_symbol (module->library, "thunar_extension_shutdown", (gpointer) &module->shutdown)
++ || !g_module_symbol (module->library, "thunar_extension_initialize", (gpointer) &module->initialize)
++ || !g_module_symbol (module->library, "thunar_extension_list_types", (gpointer) &module->list_types))
++ {
++ g_printerr ("Thunar :Plugin `%s' in `%s' lacks required symbols.\n", type_module->name, path);
++ g_module_close (module->library);
++ continue;
++ }
++
++ /* initialize the plugin */
++ (*module->initialize) (module);
++
++ /* ensure that the module will never be unloaded if it requests to be kept in memory */
++ if (G_UNLIKELY (module->resident))
++ g_module_make_resident (module->library);
++
++ found = TRUE;
+ }
+-
+- /* initialize the plugin */
+- (*module->initialize) (module);
+-
+- /* ensure that the module will never be unloaded if it requests to be kept in memory */
+- if (G_UNLIKELY (module->resident))
+- g_module_make_resident (module->library);
+-
+- return TRUE;
++ g_strfreev (dirs);
++ return found;
+ }
+
+
+--
+2.34.0
+
diff --git a/gnu/packages/xfce.scm b/gnu/packages/xfce.scm
index 182fe0fd8f..d3b3026d14 100644
--- a/gnu/packages/xfce.scm
+++ b/gnu/packages/xfce.scm
@@ -16,6 +16,7 @@
;;; Copyright © 2020, 2021, 2022 Michael Rohleder <mike@rohleder.de>
;;; Copyright © 2021 Brendan Tildesley <mail@brendan.scot>
;;; Copyright © 2021 André A. Gomes <andremegafone@gmail.com>
+;;; Copyright © 2022 Feng Shu <tumashu@163.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -747,7 +748,12 @@ (define-public thunar
"thunar-" version ".tar.bz2"))
(sha256
(base32
- "14lwi4ax0wj77980kkfhdf18b97339b17y8qc8gl2365mgswh1gi"))))
+ "14lwi4ax0wj77980kkfhdf18b97339b17y8qc8gl2365mgswh1gi"))
+ (patches
+ (search-patches
+ ;; NOTE: This patch is backported from thunar.git, it should
+ ;; be removed when update to thunar-4.18.
+ "thunar-search-paths.patch"))))
(build-system gnu-build-system)
(native-inputs
(list pkg-config intltool))
@@ -762,6 +768,10 @@ (define-public thunar
pcre
xfce4-panel
startup-notification))
+ (native-search-paths
+ (list (search-path-specification
+ (variable "THUNARX_DIRS")
+ (files (list "lib/thunarx-3")))))
(home-page "https://www.xfce.org/")
(synopsis "Xfce file manager")
(description
--
2.34.0
T
T
tumashu wrote on 29 Mar 2022 15:04
[patch v2 4/5] gnu: Add thunar-vcs-plugin.
(address . 54525@debbugs.gnu.org)(name . Feng Shu)(address . tumashu@163.com)
20220329130402.26022-4-tumashu@163.com
From: Feng Shu <tumashu@163.com>

* gnu/packages/xfce.scm (thunar-vcs-plugin): New variable.
---
gnu/packages/xfce.scm | 39 +++++++++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)

Toggle diff (66 lines)
diff --git a/gnu/packages/xfce.scm b/gnu/packages/xfce.scm
index 44d34cab8f..182fe0fd8f 100644
--- a/gnu/packages/xfce.scm
+++ b/gnu/packages/xfce.scm
@@ -35,6 +35,7 @@
(define-module (gnu packages xfce)
#:use-module (gnu artwork)
#:use-module (gnu packages)
+ #:use-module (gnu packages apr)
#:use-module (gnu packages base)
#:use-module (gnu packages calendar)
#:use-module (gnu packages cdrom)
@@ -63,6 +64,8 @@ (define-module (gnu packages xfce)
#:use-module (gnu packages python-xyz)
#:use-module (gnu packages pulseaudio)
#:use-module (gnu packages search)
+ #:use-module (gnu packages textutils)
+ #:use-module (gnu packages version-control)
#:use-module (gnu packages web)
#:use-module (gnu packages wm)
#:use-module (gnu packages xml)
@@ -858,6 +861,42 @@ (define-public thunar-media-tags-plugin
tags-based file renaming from inside Thunar Bulk Renamer.")
(license gpl2+)))
+(define-public thunar-vcs-plugin
+ (package
+ (name "thunar-vcs-plugin")
+ (version "0.2.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append "https://archive.xfce.org/src/thunar-plugins/"
+ name "/" (version-major+minor version)
+ "/" name "-" version ".tar.bz2"))
+ (sha256
+ (base32 "1f2d1dwfyi6xv3qkd8l8xh0vhz8wh0601cyigjzn426lqga1d29n"))))
+ (build-system gnu-build-system)
+ (arguments
+ (list #:configure-flags
+ #~(list (string-append "CPPFLAGS=-I"
+ #$(this-package-input "apr-util")
+ "/include/apr-1"))))
+ (native-inputs (list pkg-config intltool utf8proc))
+ (inputs
+ (list exo
+ gtk+
+ thunar
+ libxfce4util
+ apr
+ apr-util
+ subversion
+ git))
+ (home-page "https://www.xfce.org/")
+ (synopsis "VCS plugin for Thunar file manager")
+ (description
+ "Thunar VCS Plugin (formerly known as Thunar SVN Plugin) gives SVN and
+GIT integration to Thunar, it adds Subversion and GIT actions to the context
+menu.")
+ (license gpl2+)))
+
(define-public xfwm4
(package
(name "xfwm4")
--
2.34.0
F
F
Feng Shu wrote on 3 Apr 2022 01:40
Re: bug#54525: [patchs] Let thunar support plugin search patchs and add some thunar plugins.
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 54525@debbugs.gnu.org)
87v8vrt5ow.fsf@163.com
Ludovic Courtès <ludo@gnu.org> writes:

Toggle quote (11 lines)
> Hi,
>
> tumashu@163.com skribis:
>
>> From: Feng Shu <tumashu@163.com>
>>
>> * gnu/packages/xfce.scm (thunar)[native-search-paths]: new field.
>> [source]: Add thunar-search-paths.patch.
>
> Please add the patch to gnu/local.mk.

Added.

Toggle quote (20 lines)
>
>> +++ b/gnu/packages/patches/thunar-search-paths.patch
>> @@ -0,0 +1,211 @@
>> +From 848f1dfb2d2f404efa5371817285236d33b32a5c Mon Sep 17 00:00:00 2001
>> +From: tumashu <tumashu@163.com>
>> +Date: Tue, 22 Mar 2022 20:16:19 +0000
>> +Subject: [PATCH] Look for thunar plugins at $THUNARX_DIRS (Issue #748)
>> +
>> +THUNARX_DIRS is a list of directories where thunar plugins are looked
>> +for. It is needed for distributions like NixOS/GuixOS that do not
>> +install all plugins in the same directory. In NixOS/GuixOS each
>> +package is installed in a self contained directory.
>> +
>> +MR !197
>
> There is no such thing as “GuixOS”, it’s called “Guix System”. :-)
>
> Is this going to be included upstream? If yes, could you add the URL of
> the upstream discussion or merge request?

Yes, have merged to master.

Toggle quote (8 lines)
>
> (If it’s not included upstream, I would suggest “THUNARX_PLUGIN_PATH” or
> “THUNARX_PLUGIN_DIRECTORIES” for the environment variable name.)
>
> Apart from that, this patch and the previous ones LGTM.
>
> Could you send a v2 based on that?

Sent.

Toggle quote (4 lines)
>
> Thanks,
> Ludo’.

--
F
F
Feng Shu wrote on 6 Apr 2022 00:48
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 54525@debbugs.gnu.org)
87ilrn87un.fsf@163.com
Ludovic Courtès <ludo@gnu.org> writes:


I have found a bug in thunar search path patch, so these patches should
not merged at the moment, sorry.

Toggle quote (40 lines)
> Hi,
>
> tumashu@163.com skribis:
>
>> From: Feng Shu <tumashu@163.com>
>>
>> * gnu/packages/xfce.scm (thunar)[native-search-paths]: new field.
>> [source]: Add thunar-search-paths.patch.
>
> Please add the patch to gnu/local.mk.
>
>> +++ b/gnu/packages/patches/thunar-search-paths.patch
>> @@ -0,0 +1,211 @@
>> +From 848f1dfb2d2f404efa5371817285236d33b32a5c Mon Sep 17 00:00:00 2001
>> +From: tumashu <tumashu@163.com>
>> +Date: Tue, 22 Mar 2022 20:16:19 +0000
>> +Subject: [PATCH] Look for thunar plugins at $THUNARX_DIRS (Issue #748)
>> +
>> +THUNARX_DIRS is a list of directories where thunar plugins are looked
>> +for. It is needed for distributions like NixOS/GuixOS that do not
>> +install all plugins in the same directory. In NixOS/GuixOS each
>> +package is installed in a self contained directory.
>> +
>> +MR !197
>
> There is no such thing as “GuixOS”, it’s called “Guix System”. :-)
>
> Is this going to be included upstream? If yes, could you add the URL of
> the upstream discussion or merge request?
>
> (If it’s not included upstream, I would suggest “THUNARX_PLUGIN_PATH” or
> “THUNARX_PLUGIN_DIRECTORIES” for the environment variable name.)
>
> Apart from that, this patch and the previous ones LGTM.
>
> Could you send a v2 based on that?
>
> Thanks,
> Ludo’.

--
F
F
Feng Shu wrote on 27 Apr 2022 06:20
[patchs] Let thunar support plugin search patchs and add some thunar plugins.
(address . 54525@debbugs.gnu.org)
87ee1jqhrh.fsf@163.com
Toggle quote (3 lines)
> I have found a bug in thunar search path patch, so these patches should
> not merged at the moment, sorry.

The issue has been fixed in thunar.git, but It will create three patchs,
So maybe waiting thunar-4.18 is a simple way?


--
?
(name . Feng Shu)(address . tumashu@163.com)(address . 54525-done@debbugs.gnu.org)
87jztj30gz.fsf@envs.net
Feng Shu <tumashu@163.com> writes:

Toggle quote (6 lines)
>> I have found a bug in thunar search path patch, so these patches should
>> not merged at the moment, sorry.
>
> The issue has been fixed in thunar.git, but It will create three patchs,
> So maybe waiting thunar-4.18 is a simple way?

Already landed, forget to close...

Thanks.
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 54525@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 54525
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch