diff options
author | Raymond Gauthier <jraygauthier@gmail.com> | 2015-09-18 02:02:16 -0400 |
---|---|---|
committer | Vladimír Čunát <vcunat@gmail.com> | 2015-09-23 18:57:50 +0200 |
commit | e9f2dc883074fbba612f4e57a7bff06a8a6420e7 (patch) | |
tree | 30aa91c7485d8411a306974a4d7e85a91dcd6dac /pkgs/desktops/xfce/core | |
parent | c405f2226627f083da705f0744ab6247d0391f34 (diff) | |
download | nixpkgs-e9f2dc883074fbba612f4e57a7bff06a8a6420e7.tar nixpkgs-e9f2dc883074fbba612f4e57a7bff06a8a6420e7.tar.gz nixpkgs-e9f2dc883074fbba612f4e57a7bff06a8a6420e7.tar.bz2 nixpkgs-e9f2dc883074fbba612f4e57a7bff06a8a6420e7.tar.lz nixpkgs-e9f2dc883074fbba612f4e57a7bff06a8a6420e7.tar.xz nixpkgs-e9f2dc883074fbba612f4e57a7bff06a8a6420e7.tar.zst nixpkgs-e9f2dc883074fbba612f4e57a7bff06a8a6420e7.zip |
thunar: plugin improvements (close #9908)
Improve thunar/thunarx so that thunar's plugin directory could be overriden using a `THUNARX_MODULE_DIR` environment variable so that plugins not built along with the `thunar` package could be installed as well. This could allow one to wrap `thunar` in a `thunar-with-plugins` package where plugins are declared instead of being found (a bit in the same fashion as gstreamer plugins).
Diffstat (limited to 'pkgs/desktops/xfce/core')
-rw-r--r-- | pkgs/desktops/xfce/core/thunar.nix | 2 | ||||
-rw-r--r-- | pkgs/desktops/xfce/core/thunarx_plugins_directory.patch | 48 |
2 files changed, 50 insertions, 0 deletions
diff --git a/pkgs/desktops/xfce/core/thunar.nix b/pkgs/desktops/xfce/core/thunar.nix index 6e479454459..1ddab2b0752 100644 --- a/pkgs/desktops/xfce/core/thunar.nix +++ b/pkgs/desktops/xfce/core/thunar.nix @@ -14,6 +14,8 @@ stdenv.mkDerivation rec { }; name = "${p_name}-${ver_maj}.${ver_min}"; + patches = [ ./thunarx_plugins_directory.patch ]; + buildInputs = [ pkgconfig intltool gtk dbus_glib libstartup_notification libnotify libexif pcre udev diff --git a/pkgs/desktops/xfce/core/thunarx_plugins_directory.patch b/pkgs/desktops/xfce/core/thunarx_plugins_directory.patch new file mode 100644 index 00000000000..e1431d86b14 --- /dev/null +++ b/pkgs/desktops/xfce/core/thunarx_plugins_directory.patch @@ -0,0 +1,48 @@ +diff --git a/thunarx/thunarx-provider-factory.c b/thunarx/thunarx-provider-factory.c +index 31b8835..a3e7f4e 100644 +--- a/thunarx/thunarx-provider-factory.c ++++ b/thunarx/thunarx-provider-factory.c +@@ -141,12 +141,19 @@ static GList* + thunarx_provider_factory_load_modules (ThunarxProviderFactory *factory) + { + ThunarxProviderModule *module; ++ const gchar *thunar_dir; + const gchar *name; + GList *modules = NULL; + GList *lp; + GDir *dp; + +- dp = g_dir_open (THUNARX_DIRECTORY, 0, NULL); ++ thunar_dir = g_getenv("THUNARX_MODULE_DIR"); ++ if (NULL == thunar_dir) ++ { ++ thunar_dir = THUNARX_DIRECTORY; ++ } ++ ++ dp = g_dir_open (thunar_dir, 0, NULL); + if (G_LIKELY (dp != NULL)) + { + /* determine the types for all existing plugins */ +diff --git a/thunarx/thunarx-provider-module.c b/thunarx/thunarx-provider-module.c +index 023ad2a..6c21997 100644 +--- a/thunarx/thunarx-provider-module.c ++++ b/thunarx/thunarx-provider-module.c +@@ -174,10 +174,17 @@ static gboolean + thunarx_provider_module_load (GTypeModule *type_module) + { + ThunarxProviderModule *module = THUNARX_PROVIDER_MODULE (type_module); ++ const gchar *thunar_dir; + gchar *path; ++ ++ thunar_dir = g_getenv("THUNARX_MODULE_DIR"); ++ if (NULL == thunar_dir) ++ { ++ thunar_dir = THUNARX_DIRECTORY; ++ } + + /* load the module using the runtime link editor */ +- path = g_build_filename (THUNARX_DIRECTORY, type_module->name, NULL); ++ path = g_build_filename (thunar_dir, type_module->name, NULL); + module->library = g_module_open (path, G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL); + g_free (path); + |