From cec18fd969e1e46c72b53f0b07374ed0e9d0c871 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Wed, 26 Jan 2022 15:44:44 +1000
Subject: Move loaders.cache to settings dir


diff --git a/gdk-pixbuf/gdk-pixbuf-io.c b/gdk-pixbuf/gdk-pixbuf-io.c
index 40eb920..5e4f3fd 100644
--- a/gdk-pixbuf/gdk-pixbuf-io.c
+++ b/gdk-pixbuf/gdk-pixbuf-io.c
@@ -351,6 +351,11 @@ get_libdir (void)
 
 #endif  /* GDK_PIXBUF_RELOCATABLE */
 
+#ifdef __HAIKU__
+#undef GDK_PIXBUF_LIBDIR
+#define GDK_PIXBUF_LIBDIR "/system/settings"
+#endif
+
 /* In case we have a relative module path in the loaders cache
  * prepend the toplevel dir */
 static gchar *
@@ -373,8 +378,11 @@ gdk_pixbuf_get_module_file (void)
   gchar *result = g_strdup (g_getenv ("GDK_PIXBUF_MODULE_FILE"));
 
   if (!result)
+#ifdef __HAIKU__
+          result = g_build_filename ("/system/settings", "gdk-pixbuf-2.0", "loaders.cache");
+#else
           result = g_build_filename (GDK_PIXBUF_LIBDIR, "gdk-pixbuf-2.0", GDK_PIXBUF_BINARY_VERSION, "loaders.cache", NULL);
-
+#endif
   return result;
 }
 
diff --git a/gdk-pixbuf/queryloaders.c b/gdk-pixbuf/queryloaders.c
index ddcae7b..39ca339 100644
--- a/gdk-pixbuf/queryloaders.c
+++ b/gdk-pixbuf/queryloaders.c
@@ -304,7 +304,11 @@ gdk_pixbuf_get_module_file (void)
         gchar *result = g_strdup (g_getenv ("GDK_PIXBUF_MODULE_FILE"));
 
         if (!result)
+#ifdef __HAIKU__
+                result = g_build_filename ("/system/settings", "gdk-pixbuf-2.0", "loaders.cache");
+#else
                 result = g_build_filename (GDK_PIXBUF_LIBDIR, "gdk-pixbuf-2.0", GDK_PIXBUF_BINARY_VERSION, "loaders.cache", NULL);
+#endif
 
         return result;
 }
-- 
2.30.2

