From 0d72fab2fed90107d72ea3ef6258680442bc4f8f Mon Sep 17 00:00:00 2001
From: Michele Calgaro <michele.calgaro@yahoo.it>
Date: Thu, 24 Sep 2026 19:08:13 +0900
Subject: ARCH, FREEBSD: switch from imlib1 to imlib2.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
---
 arch/DockerBuildEnvironment/Dockerfile             |   2 +-
 arch/tde-base/tde-tdegraphics/PKGBUILD             |   2 +-
 arch/tde-deps/imlib/.SRCINFO                       |  31 -
 arch/tde-deps/imlib/CAN-2004-1026.patch            | 510 --------------
 arch/tde-deps/imlib/PKGBUILD                       |  48 --
 arch/tde-deps/imlib/aclocal-fixes.patch            |  20 -
 arch/tde-deps/imlib/debian-bug448360.patch         |  92 ---
 arch/tde-deps/imlib/imlib-1.9.15-libpng15.patch    | 142 ----
 arch/tde-deps/imlib/imlib-giflib51.patch           | 126 ----
 arch/tde-deps/imlib/imlib-gtk.patch                |  14 -
 freebsd/core/tdegraphics/Makefile                  |   2 +-
 freebsd/dependencies/Makefile                      |   1 -
 freebsd/dependencies/imlib/Makefile                |  48 --
 freebsd/dependencies/imlib/distinfo                |   3 -
 freebsd/dependencies/imlib/files/patch-445914.diff |  46 --
 freebsd/dependencies/imlib/files/patch-448360.diff |  95 ---
 .../imlib/files/patch-PrintGifError.diff           |  24 -
 .../imlib/files/patch-bpp16-CVE-2007-3568.diff     |  16 -
 .../imlib/files/patch-check-gnu-basename.diff      |  46 --
 .../files/patch-disable-gtk-configure-check.diff   |  19 -
 .../files/patch-fix-potential-buffer-overflow.diff |  19 -
 .../imlib/files/patch-gdk-makefile.diff            |  30 -
 .../imlib/files/patch-giflib-ungif.diff            |  24 -
 .../dependencies/imlib/files/patch-giflib5.1.diff  |  50 --
 .../dependencies/imlib/files/patch-giflib5.diff    |  30 -
 .../dependencies/imlib/files/patch-gmodule.diff    | 734 ---------------------
 .../imlib/files/patch-imlib-config.diff            |  28 -
 .../dependencies/imlib/files/patch-imlib-m4.diff   |  32 -
 .../imlib/files/patch-link-against-x11.diff        |  16 -
 freebsd/dependencies/imlib/files/patch-png1.5.diff |  80 ---
 freebsd/dependencies/imlib/files/patch-png1.6.diff |  36 -
 .../files/patch-remove-register-instruction.diff   |  11 -
 .../patch-search-system-include-for-xshm.diff      |  14 -
 freebsd/dependencies/imlib/pkg-descr               |   4 -
 freebsd/dependencies/imlib/pkg-plist               |  16 -
 freebsd/metapackages/meta-tde/Makefile             |   1 -
 36 files changed, 3 insertions(+), 2409 deletions(-)
 delete mode 100644 arch/tde-deps/imlib/.SRCINFO
 delete mode 100644 arch/tde-deps/imlib/CAN-2004-1026.patch
 delete mode 100644 arch/tde-deps/imlib/PKGBUILD
 delete mode 100644 arch/tde-deps/imlib/aclocal-fixes.patch
 delete mode 100644 arch/tde-deps/imlib/debian-bug448360.patch
 delete mode 100644 arch/tde-deps/imlib/imlib-1.9.15-libpng15.patch
 delete mode 100644 arch/tde-deps/imlib/imlib-giflib51.patch
 delete mode 100644 arch/tde-deps/imlib/imlib-gtk.patch
 delete mode 100644 freebsd/dependencies/imlib/Makefile
 delete mode 100644 freebsd/dependencies/imlib/distinfo
 delete mode 100644 freebsd/dependencies/imlib/files/patch-445914.diff
 delete mode 100644 freebsd/dependencies/imlib/files/patch-448360.diff
 delete mode 100644 freebsd/dependencies/imlib/files/patch-PrintGifError.diff
 delete mode 100644 freebsd/dependencies/imlib/files/patch-bpp16-CVE-2007-3568.diff
 delete mode 100644 freebsd/dependencies/imlib/files/patch-check-gnu-basename.diff
 delete mode 100644 freebsd/dependencies/imlib/files/patch-disable-gtk-configure-check.diff
 delete mode 100644 freebsd/dependencies/imlib/files/patch-fix-potential-buffer-overflow.diff
 delete mode 100644 freebsd/dependencies/imlib/files/patch-gdk-makefile.diff
 delete mode 100644 freebsd/dependencies/imlib/files/patch-giflib-ungif.diff
 delete mode 100644 freebsd/dependencies/imlib/files/patch-giflib5.1.diff
 delete mode 100644 freebsd/dependencies/imlib/files/patch-giflib5.diff
 delete mode 100644 freebsd/dependencies/imlib/files/patch-gmodule.diff
 delete mode 100644 freebsd/dependencies/imlib/files/patch-imlib-config.diff
 delete mode 100644 freebsd/dependencies/imlib/files/patch-imlib-m4.diff
 delete mode 100644 freebsd/dependencies/imlib/files/patch-link-against-x11.diff
 delete mode 100644 freebsd/dependencies/imlib/files/patch-png1.5.diff
 delete mode 100644 freebsd/dependencies/imlib/files/patch-png1.6.diff
 delete mode 100644 freebsd/dependencies/imlib/files/patch-remove-register-instruction.diff
 delete mode 100644 freebsd/dependencies/imlib/files/patch-search-system-include-for-xshm.diff
 delete mode 100644 freebsd/dependencies/imlib/pkg-descr
 delete mode 100644 freebsd/dependencies/imlib/pkg-plist

diff --git a/arch/DockerBuildEnvironment/Dockerfile b/arch/DockerBuildEnvironment/Dockerfile
index d657a60b0..f892693ef 100644
--- a/arch/DockerBuildEnvironment/Dockerfile
+++ b/arch/DockerBuildEnvironment/Dockerfile
@@ -7,7 +7,7 @@ RUN echo "Server = http://repo.nasutek.com/arch/contrib/docker-dev/" >> /etc/pac
 RUN pacman -Syyu --noconfirm
 RUN pacman-db-upgrade
 
-RUN pacman -S --noconfirm base-devel sudo grep wget xscreensaver libxss libgphoto2 fribidi sane xmms2 alsa-plugins alsa-tools alsa-utils audiofile glib2 libmad libogg libvorbis pulseaudio-alsa avahi nss-mdns dbus libraw1394 libxtst lm_sensors ttf-dejavu ttf-freefont xorg-server xorg-xinit openssl-1.0 aspell hspell jasper libcups libidn libutempter libxcomposite libxslt openexr pcre xorg-iceauth xorg-xmessage xorg-xprop xorg-xset xorg-xsetroot glu taglib gtk3 dbus-glib speex wireless_tools wpa_supplicant boost boost-libs gnokii curl libraw pkgconfig autoconf imake cmake python2 imlib automake libtool libxkbfile smbclient rpcsvc-proto xorg-bdftopcf libiodbc libxi mariadb unixodbc libmng xorg-xrandr libxft flex subversion mplayer exiv2 doxygen
+RUN pacman -S --noconfirm base-devel sudo grep wget xscreensaver libxss libgphoto2 fribidi sane xmms2 alsa-plugins alsa-tools alsa-utils audiofile glib2 libmad libogg libvorbis pulseaudio-alsa avahi nss-mdns dbus libraw1394 libxtst lm_sensors ttf-dejavu ttf-freefont xorg-server xorg-xinit openssl-1.0 aspell hspell jasper libcups libidn libutempter libxcomposite libxslt openexr pcre xorg-iceauth xorg-xmessage xorg-xprop xorg-xset xorg-xsetroot glu taglib gtk3 dbus-glib speex wireless_tools wpa_supplicant boost boost-libs gnokii curl libraw pkgconfig autoconf imake cmake python2 imlib2 automake libtool libxkbfile smbclient rpcsvc-proto xorg-bdftopcf libiodbc libxi mariadb unixodbc libmng xorg-xrandr libxft flex subversion mplayer exiv2 doxygen
 RUN pacman -S --noconfirm htdig lcms postgresql-9.6
 
 RUN echo "%wheel ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
diff --git a/arch/tde-base/tde-tdegraphics/PKGBUILD b/arch/tde-base/tde-tdegraphics/PKGBUILD
index 31f786d92..45c5ed836 100644
--- a/arch/tde-base/tde-tdegraphics/PKGBUILD
+++ b/arch/tde-base/tde-tdegraphics/PKGBUILD
@@ -13,7 +13,7 @@ arch=('i686' 'x86_64' 'aarch64' 'armv7h' 'powerpc64le')
 url="https://scm.trinitydesktop.org/scm/git/${_mod}"
 license=('GPL')
 groups=('tde-base')
-depends=('tde-tdelibs' 'fribidi' 'imlib' 'libgphoto2' 'libpaper' 'poppler' 'sane')
+depends=('tde-tdelibs' 'fribidi' 'imlib2' 'libgphoto2' 'libpaper' 'poppler' 'sane')
 makedepends=('tde-cmake-trinity')
 provides=("${_mod}")
 conflicts=("trinity-${_mod}" "trinity-${_kdemod}")
diff --git a/arch/tde-deps/imlib/.SRCINFO b/arch/tde-deps/imlib/.SRCINFO
deleted file mode 100644
index 3a7e771bb..000000000
--- a/arch/tde-deps/imlib/.SRCINFO
+++ /dev/null
@@ -1,31 +0,0 @@
-pkgbase = imlib
-	pkgdesc = General image handling library for X11 and Gtk
-	pkgver = 1.9.15
-	pkgrel = 18
-	url = http://freshmeat.net/projects/imlib/
-	arch = x86_64
-	arch = aarch64
-	arch = armv7h
-	arch = powerpc64le
-	license = GPL
-	makedepends = libxt
-	depends = giflib
-	depends = libpng
-	depends = libtiff
-	depends = libxext
-	source = https://ftp.gnome.org/pub/GNOME/sources/imlib/1.9/imlib-1.9.15.tar.bz2
-	source = debian-bug448360.patch
-	source = CAN-2004-1026.patch
-	source = aclocal-fixes.patch
-	source = imlib-1.9.15-libpng15.patch
-	source = imlib-giflib51.patch
-	source = imlib-gtk.patch
-	sha512sums = f50d9141b3c54b44921aa09c0a5ea848aefaa904efdd6da132dace42604671f8dbd3e4b71a596f054f0db4525ba2002864b5e5b21f8805cf1b5514b661ac254a
-	sha512sums = 0c805568c54149239a3106293e7a4f5abe127abebc1a851cda87958fede996d6c0415fe1b47a7f023f2deb2e3460204d5aae4fce5787e402a026d46c2e7e662c
-	sha512sums = a75537267e9e276920fbc0360cd4832f727c6c9857401889bdb1466f3088c98e5ea2ef84a94a5873a3c12dda0b9aed36a5e2039fece87e51154a3b773d97aa5c
-	sha512sums = ca4d2a047ee07f25bb462c8b34fc8298ef9a31b39f83309598a696973534e144f8f02a130bb764737dfbd329073e64abe4f8a673d66731822fece4969d7ab02a
-	sha512sums = e7a6d48ef04fbcfcab998e6968130796ab3da1fd9def14ab2ccc713e0956f1f2be3f3a8f680ded5f00cb7ac9ea31d2f94de04aaa039ec5b03cece71f36f14294
-	sha512sums = 91a62ed701974b953c2bc4f6b530ea7614b2195906110fcdc45bb200acacea0c54d431c3eafdcd2b33877606ef6b23bd34d051f99f90e5505d8e725b78278c89
-	sha512sums = fb05c545e8c8e3eaf6a6cc390c0c9211c37074f7bd6805529254d9c61d56ceb9b2e3877d276f46ac0b195ae796e52c5baad11781ef91272c955529396bdf6de7
-
-pkgname = imlib
diff --git a/arch/tde-deps/imlib/CAN-2004-1026.patch b/arch/tde-deps/imlib/CAN-2004-1026.patch
deleted file mode 100644
index c820270d4..000000000
--- a/arch/tde-deps/imlib/CAN-2004-1026.patch
+++ /dev/null
@@ -1,510 +0,0 @@
-diff -urN imlib-1.9.13.orig/Imlib/load.c imlib-1.9.13/Imlib/load.c
---- imlib-1.9.13.orig/Imlib/load.c	Wed Mar 13 19:06:29 2002
-+++ imlib-1.9.13/Imlib/load.c	Thu Sep 16 17:21:01 2004
-@@ -4,6 +4,8 @@
- #include "Imlib_private.h"
- #include <setjmp.h>
- 
-+#define G_MAXINT ((int) 0x7fffffff)
-+
- /*      Split the ID - damages input    */
- 
- static char        *
-@@ -41,13 +43,17 @@
- 
- /*
-  *     Make sure we don't wrap on our memory allocations
-+ *     we check G_MAXINT/4 because rend.c malloc's w * h * bpp
-+ *     + 3 is safety margin
-  */
- 
- void * _imlib_malloc_image(unsigned int w, unsigned int h)
- {
--       if( w > 32767 || h > 32767)
--               return NULL;
--       return malloc(w * h * 3);
-+       if (w <= 0 || w > 32767 ||
-+           h <= 0 || h > 32767 ||
-+           h >= (G_MAXINT/4 - 1) / w)
-+                return NULL;
-+       return malloc(w * h * 3 + 3);
- }
- 
- #ifdef HAVE_LIBJPEG
-@@ -360,7 +366,9 @@
-   npix = ww * hh;
-   *w = (int)ww;
-   *h = (int)hh;
--  if(ww > 32767 || hh > 32767)
-+  if (ww <= 0 || ww > 32767 ||
-+      hh <= 0 || hh > 32767 ||
-+      hh >= (G_MAXINT/sizeof(uint32)) / ww)
-     {
-        TIFFClose(tif);
-        return NULL;
-@@ -463,7 +471,7 @@
- 	    }
- 	  *w = gif->Image.Width;
- 	  *h = gif->Image.Height;
--	  if (*h > 32767 || *w > 32767)
-+	  if (*h <= 0 || *h > 32767 || *w <= 0 || *w > 32767)
- 	    {
- 	       return NULL;
- 	    }
-@@ -965,7 +973,12 @@
-   comment = 0;
-   quote = 0;
-   context = 0;
-+  memset(lookup, 0, sizeof(lookup));
-+
-   line = malloc(lsz);
-+  if (!line)
-+    return NULL;
-+
-   while (!done)
-     {
-       pc = c;
-@@ -994,25 +1007,25 @@
- 		{
- 		  /* Header */
- 		  sscanf(line, "%i %i %i %i", w, h, &ncolors, &cpp);
--                  if (ncolors > 32766)
-+                  if (ncolors <= 0 || ncolors > 32766)
- 		    {
- 		      fprintf(stderr, "IMLIB ERROR: XPM files wth colors > 32766 not supported\n");
- 		      free(line);
- 		      return NULL;
- 		    }
--		  if (cpp > 5)
-+		  if (cpp <= 0 || cpp > 5)
- 		    {
- 		      fprintf(stderr, "IMLIB ERROR: XPM files with characters per pixel > 5 not supported\n");
- 		      free(line);
- 		      return NULL;
- 		    }
--		  if (*w > 32767)
-+		  if (*w <= 0 || *w > 32767)
- 		    {
- 		      fprintf(stderr, "IMLIB ERROR: Image width > 32767 pixels for file\n");
- 		      free(line);
- 		      return NULL;
- 		    }
--		  if (*h > 32767)
-+		  if (*h <= 0 || *h > 32767)
- 		    {
- 		      fprintf(stderr, "IMLIB ERROR: Image height > 32767 pixels for file\n");
- 		      free(line);
-@@ -1045,11 +1058,13 @@
- 		    {
- 		      int                 slen;
- 		      int                 hascolor, iscolor;
-+		      int                 space;
- 
- 		      iscolor = 0;
- 		      hascolor = 0;
- 		      tok[0] = 0;
- 		      col[0] = 0;
-+		      space = sizeof(col) - 1;
- 		      s[0] = 0;
- 		      len = strlen(line);
- 		      strncpy(cmap[j].str, line, cpp);
-@@ -1072,10 +1087,10 @@
- 				{
- 				  if (k >= len)
- 				    {
--				      if (col[0])
--					strcat(col, " ");
--                                      if (strlen(col) + strlen(s) < sizeof(col))
--					strcat(col, s);
-+				      if (col[0] && space > 0)
-+					strcat(col, " "), space -= 1;
-+                                      if (slen <= space)
-+					strcat(col, s), space -= slen;
- 				    }
- 				  if (col[0])
- 				    {
-@@ -1105,14 +1120,17 @@
- 					    }
- 					}
- 				    }
--				  strcpy(tok, s);
-+				  if (slen < sizeof(tok));
-+				    strcpy(tok, s);
- 				  col[0] = 0;
-+				  space = sizeof(col) - 1;
- 				}
- 			      else
- 				{
--				  if (col[0])
--				    strcat(col, " ");
--				  strcat(col, s);
-+				  if (col[0] && space > 0)
-+				    strcat(col, " "), space -=1;
-+				  if (slen <= space)
-+				    strcat(col, s), space -= slen;
- 				}
- 			    }
- 			}
-@@ -1341,12 +1359,12 @@
- 	  sscanf(s, "%i %i", w, h);
- 	  a = *w;
- 	  b = *h;
--	  if (a > 32767)
-+	  if (a <= 0 || a > 32767)
- 	    {
- 	      fprintf(stderr, "IMLIB ERROR: Image width > 32767 pixels for file\n");
- 	      return NULL;
- 	    }
--	  if (b > 32767)
-+	  if (b <= 0 || b > 32767)
- 	    {
- 	      fprintf(stderr, "IMLIB ERROR: Image height > 32767 pixels for file\n");
- 	      return NULL;
-diff -urN imlib-1.9.13.orig/Imlib/utils.c imlib-1.9.13/Imlib/utils.c
---- imlib-1.9.13.orig/Imlib/utils.c	Mon Mar  4 17:45:28 2002
-+++ imlib-1.9.13/Imlib/utils.c	Thu Sep 16 17:21:15 2004
-@@ -1496,36 +1496,56 @@
-   context = 0;
-   ptr = NULL;
-   end = NULL;
-+  memset(lookup, 0, sizeof(lookup));
- 
-   while (!done)
-     {
-       line = data[count++];
-+      if (!line)
-+	break;
-+      line = strdup(line);
-+      if (!line)
-+	break;
-+      len = strlen(line);
-+      for (i = 0; i < len; ++i)
-+	{
-+	  c = line[i];
-+	  if (c < 32)
-+	    line[i] = 32;
-+	  else if (c > 127)
-+	    line[i] = 127;
-+	}
-+
-       if (context == 0)
- 	{
- 	  /* Header */
- 	  sscanf(line, "%i %i %i %i", &w, &h, &ncolors, &cpp);
--	  if (ncolors > 32766)
-+	  if (ncolors <= 0 || ncolors > 32766)
- 	    {
- 	      fprintf(stderr, "IMLIB ERROR: XPM data wth colors > 32766 not supported\n");
- 	      free(im);
-+	      free(line);
- 	      return NULL;
- 	    }
--	  if (cpp > 5)
-+	  if (cpp <= 0 || cpp > 5)
- 	    {
- 	      fprintf(stderr, "IMLIB ERROR: XPM data with characters per pixel > 5 not supported\n");
- 	      free(im);
-+	      free(line);
- 	      return NULL;
- 	    }
--	  if (w > 32767)
-+	  if (w <= 0 || w > 32767)
- 	    {
- 	      fprintf(stderr, "IMLIB ERROR: Image width > 32767 pixels for data\n");
- 	      free(im);
-+	      free(line);
- 	      return NULL;
- 	    }
--	  if (h > 32767)
-+	  if (h <= 0 || h > 32767)
- 	    {
- 	      fprintf(stderr, "IMLIB ERROR: Image height > 32767 pixels for data\n");
- 	      free(im);
-+	      free(line);
- 	      return NULL;
- 	    }
- 	  cmap = malloc(sizeof(struct _cmap) * ncolors);
-@@ -1533,6 +1553,7 @@
- 	  if (!cmap)
- 	    {
- 	      free(im);
-+	      free(line);
- 	      return NULL;
- 	    }
- 	  im->rgb_width = w;
-@@ -1542,6 +1563,7 @@
- 	    {
- 	      free(cmap);
- 	      free(im);
-+	      free(line);
- 	      return NULL;
- 	    }
- 	  im->alpha_data = NULL;
-@@ -1817,6 +1839,7 @@
- 	}
-       if ((ptr) && ((ptr - im->rgb_data) >= w * h * 3))
- 	done = 1;
-+      free(line);
-     }
-   if (!transp)
-     {
-diff -urN imlib-1.9.13.orig/gdk_imlib/io-gif.c imlib-1.9.13/gdk_imlib/io-gif.c
---- imlib-1.9.13.orig/gdk_imlib/io-gif.c	Mon Mar  4 17:26:51 2002
-+++ imlib-1.9.13/gdk_imlib/io-gif.c	Thu Sep 16 16:11:31 2004
-@@ -55,7 +55,7 @@
- 	    }
- 	  *w = gif->Image.Width;
- 	  *h = gif->Image.Height;
--	  if(*h > 32767 || *w > 32767)
-+	  if(*h <= 0 || *h > 32767 || *w <= 0 || *w > 32767)
- 	    {
- 	      return NULL;
- 	    }
-diff -urN imlib-1.9.13.orig/gdk_imlib/io-ppm.c imlib-1.9.13/gdk_imlib/io-ppm.c
---- imlib-1.9.13.orig/gdk_imlib/io-ppm.c	Mon Mar  4 17:26:51 2002
-+++ imlib-1.9.13/gdk_imlib/io-ppm.c	Thu Sep 16 16:13:13 2004
-@@ -53,12 +53,12 @@
- 	  sscanf(s, "%i %i", w, h);
- 	  a = *w;
- 	  b = *h;
--	  if (a > 32767)
-+	  if (a <= 0 || a > 32767)
- 	    {
- 	      fprintf(stderr, "gdk_imlib ERROR: Image width > 32767 pixels for file\n");
- 	      return NULL;
- 	    }
--	  if (b > 32767)
-+	  if (b <= 0 || b > 32767)
- 	    {
- 	      fprintf(stderr, "gdk_imlib ERROR: Image height > 32767 pixels for file\n");
- 	      return NULL;
-diff -urN imlib-1.9.13.orig/gdk_imlib/io-tiff.c imlib-1.9.13/gdk_imlib/io-tiff.c
---- imlib-1.9.13.orig/gdk_imlib/io-tiff.c	Mon Mar  4 17:26:51 2002
-+++ imlib-1.9.13/gdk_imlib/io-tiff.c	Thu Sep 16 16:13:57 2004
-@@ -36,7 +36,9 @@
-   npix = ww * hh;
-   *w = (int)ww;
-   *h = (int)hh;
--  if(ww > 32767 || hh > 32767)
-+  if (ww <= 0 || ww > 32767 ||
-+      hh <= 0 || hh > 32767 ||
-+      hh >= (G_MAXINT/sizeof(uint32)) / ww)
-     {
-       TIFFClose(tif);
-       return NULL;
-diff -urN imlib-1.9.13.orig/gdk_imlib/io-xpm.c imlib-1.9.13/gdk_imlib/io-xpm.c
---- imlib-1.9.13.orig/gdk_imlib/io-xpm.c	Mon Mar  4 17:26:51 2002
-+++ imlib-1.9.13/gdk_imlib/io-xpm.c	Thu Sep 16 17:08:24 2004
-@@ -40,8 +40,12 @@
-   context = 0;
-   i = j = 0;
-   cmap = NULL;
-+  memset(lookup, 0, sizeof(lookup));
- 
-   line = malloc(lsz);
-+  if (!line)
-+    return NULL;
-+
-   while (!done)
-     {
-       pc = c;
-@@ -70,25 +74,25 @@
- 		{
- 		  /* Header */
- 		  sscanf(line, "%i %i %i %i", w, h, &ncolors, &cpp);
--		  if (ncolors > 32766)
-+		  if (ncolors <= 0 || ncolors > 32766)
- 		    {
- 		      fprintf(stderr, "gdk_imlib ERROR: XPM files wth colors > 32766 not supported\n");
- 		      free(line);
- 		      return NULL;
- 		    }
--		  if (cpp > 5)
-+		  if (cpp <= 0 || cpp > 5)
- 		    {
- 		      fprintf(stderr, "gdk_imlib ERROR: XPM files with characters per pixel > 5 not supported\n");
- 		      free(line);
- 		      return NULL;
- 		    }
--		  if (*w > 32767)
-+		  if (*w <= 0 || *w > 32767)
- 		    {
- 		      fprintf(stderr, "gdk_imlib ERROR: Image width > 32767 pixels for file\n");
- 		      free(line);
- 		      return NULL;
- 		    }
--		  if (*h > 32767)
-+		  if (*h <= 0 || *h > 32767)
- 		    {
- 		      fprintf(stderr, "gdk_imlib ERROR: Image height > 32767 pixels for file\n");
- 		      free(line);
-@@ -120,11 +124,13 @@
- 		    {
- 		      int                 slen;
- 		      int                 hascolor, iscolor;
-+		      int                 space;
- 
- 		      hascolor = 0;
- 		      iscolor = 0;
- 		      tok[0] = 0;
- 		      col[0] = 0;
-+		      space = sizeof(col) - 1;
- 		      s[0] = 0;
- 		      len = strlen(line);
- 		      strncpy(cmap[j].str, line, cpp);
-@@ -147,10 +153,10 @@
- 				{
- 				  if (k >= len)
- 				    {
--				      if (col[0])
--					strcat(col, " ");
--				      if (strlen(col) + strlen(s) < sizeof(col))
--					strcat(col, s);
-+				      if (col[0] && space > 0)
-+					strncat(col, " ", space), space -= 1;
-+				      if (slen <= space)
-+					strcat(col, s), space -= slen;
- 				    }
- 				  if (col[0])
- 				    {
-@@ -180,14 +186,17 @@
- 					    }
- 					}
- 				    }
--				  strcpy(tok, s);
-+				  if (slen < sizeof(tok))
-+				    strcpy(tok, s);
- 				  col[0] = 0;
-+				  space = sizeof(col) - 1;
- 				}
- 			      else
- 				{
--				  if (col[0])
--				    strcat(col, " ");
--				  strcat(col, s);
-+				  if (col[0] && space > 0)
-+				    strcat(col, " "), space -= 1;
-+				  if (slen <= space)
-+				    strcat(col, s), space -= slen;
- 				}
- 			    }
- 			}
-diff -urN imlib-1.9.13.orig/gdk_imlib/misc.c imlib-1.9.13/gdk_imlib/misc.c
---- imlib-1.9.13.orig/gdk_imlib/misc.c	Mon Mar  4 17:26:51 2002
-+++ imlib-1.9.13/gdk_imlib/misc.c	Thu Sep 16 16:35:32 2004
-@@ -1355,11 +1355,16 @@
- 
- /*
-  *	Make sure we don't wrap on our memory allocations
-+ *	we check G_MAX_INT/4 because rend.c malloc's w * h * bpp
-+ *	+ 3 is safety margin
-  */
- 
- void *_gdk_malloc_image(unsigned int w, unsigned int h)
- {
--	if( w > 32767 || h > 32767)
-+	if (w <= 0 || w > 32767 ||
-+	    h <= 0 || h > 32767 ||
-+	    h >= (G_MAXINT/4 - 1) / w)
- 		return NULL;
--	return malloc(w * h * 3);
-+	return malloc(w * h * 3 + 3);
- }
-+
-diff -urN imlib-1.9.13.orig/gdk_imlib/utils.c imlib-1.9.13/gdk_imlib/utils.c
---- imlib-1.9.13.orig/gdk_imlib/utils.c	Mon Mar  4 17:26:51 2002
-+++ imlib-1.9.13/gdk_imlib/utils.c	Thu Sep 16 17:28:35 2004
-@@ -1236,36 +1236,56 @@
-   context = 0;
-   ptr = NULL;
-   end = NULL;
-+  memset(lookup, 0, sizeof(lookup));
- 
-   while (!done)
-     {
-       line = data[count++];
-+      if (!line)
-+	break;
-+      line = strdup(line);
-+      if (!line)
-+	break;
-+      len = strlen(line);
-+      for (i = 0; i < len; ++i)
-+        {
-+	  c = line[i];
-+	  if (c < 32)
-+	    line[i] = 32;
-+	  else if (c > 127)
-+	    line[i] = 127;
-+	}
-+
-       if (context == 0)
- 	{
- 	  /* Header */
- 	  sscanf(line, "%i %i %i %i", &w, &h, &ncolors, &cpp);
--	  if (ncolors > 32766)
-+	  if (ncolors <= 0 || ncolors > 32766)
- 	    {
- 	      fprintf(stderr, "gdk_imlib ERROR: XPM data wth colors > 32766 not supported\n");
- 	      free(im);
-+	      free(line);
- 	      return NULL;
- 	    }
--	  if (cpp > 5)
-+	  if (cpp <= 0 || cpp > 5)
- 	    {
- 	      fprintf(stderr, "gdk_imlib ERROR: XPM data with characters per pixel > 5 not supported\n");
- 	      free(im);
-+	      free(line);
- 	      return NULL;
- 	    }
--	  if (w > 32767)
-+	  if (w <= 0 || w > 32767)
- 	    {
- 	      fprintf(stderr, "gdk_imlib ERROR: Image width > 32767 pixels for data\n");
- 	      free(im);
-+	      free(line);
- 	      return NULL;
- 	    }
--	  if (h > 32767)
-+	  if (h <= 0 || h > 32767)
- 	    {
- 	      fprintf(stderr, "gdk_imlib ERROR: Image height > 32767 pixels for data\n");
- 	      free(im);
-+	      free(line);
- 	      return NULL;
- 	    }
- 	  cmap = malloc(sizeof(struct _cmap) * ncolors);
-@@ -1273,6 +1293,7 @@
- 	  if (!cmap)
- 	    {
- 	      free(im);
-+	      free(line);
- 	      return NULL;
- 	    }
- 	  im->rgb_width = w;
-@@ -1282,6 +1303,7 @@
- 	    {
- 	      free(cmap);
- 	      free(im);
-+	      free(line);
- 	      return NULL;
- 	    }
- 	  im->alpha_data = NULL;
-@@ -1355,7 +1377,7 @@
- 				  strcpy(col + colptr, " ");
- 				  colptr++;
- 				}
--			      if (colptr + ls <= sizeof(col))
-+			      if (colptr + ls < sizeof(col))
- 				{
- 				  strcpy(col + colptr, s);
- 				  colptr += ls;
-@@ -1558,6 +1580,7 @@
- 	}
-       if ((ptr) && ((ptr - im->rgb_data) >= w * h * 3))
- 	done = 1;
-+      free(line);
-     }
-   if (!transp)
-     {
diff --git a/arch/tde-deps/imlib/PKGBUILD b/arch/tde-deps/imlib/PKGBUILD
deleted file mode 100644
index 7e00c8ae3..000000000
--- a/arch/tde-deps/imlib/PKGBUILD
+++ /dev/null
@@ -1,48 +0,0 @@
-# Maintainer: Eric Bélanger <eric@archlinux.org>
-
-pkgname=imlib
-pkgver=1.9.15
-pkgrel=18
-pkgdesc="General image handling library for X11 and Gtk"
-arch=('x86_64' 'aarch64' 'armv7h' 'powerpc64le')
-url="http://freshmeat.net/projects/imlib/"
-license=('GPL')
-depends=('giflib' 'libpng' 'libtiff' 'libxext')
-makedepends=('libxt')
-source=(https://ftp.gnome.org/pub/GNOME/sources/imlib/1.9/${pkgname}-${pkgver}.tar.bz2
-        debian-bug448360.patch CAN-2004-1026.patch aclocal-fixes.patch 
-        imlib-1.9.15-libpng15.patch imlib-giflib51.patch imlib-gtk.patch)
-sha512sums=('f50d9141b3c54b44921aa09c0a5ea848aefaa904efdd6da132dace42604671f8dbd3e4b71a596f054f0db4525ba2002864b5e5b21f8805cf1b5514b661ac254a'
-            '0c805568c54149239a3106293e7a4f5abe127abebc1a851cda87958fede996d6c0415fe1b47a7f023f2deb2e3460204d5aae4fce5787e402a026d46c2e7e662c'
-            'a75537267e9e276920fbc0360cd4832f727c6c9857401889bdb1466f3088c98e5ea2ef84a94a5873a3c12dda0b9aed36a5e2039fece87e51154a3b773d97aa5c'
-            'ca4d2a047ee07f25bb462c8b34fc8298ef9a31b39f83309598a696973534e144f8f02a130bb764737dfbd329073e64abe4f8a673d66731822fece4969d7ab02a'
-            'e7a6d48ef04fbcfcab998e6968130796ab3da1fd9def14ab2ccc713e0956f1f2be3f3a8f680ded5f00cb7ac9ea31d2f94de04aaa039ec5b03cece71f36f14294'
-            '91a62ed701974b953c2bc4f6b530ea7614b2195906110fcdc45bb200acacea0c54d431c3eafdcd2b33877606ef6b23bd34d051f99f90e5505d8e725b78278c89'
-            'fb05c545e8c8e3eaf6a6cc390c0c9211c37074f7bd6805529254d9c61d56ceb9b2e3877d276f46ac0b195ae796e52c5baad11781ef91272c955529396bdf6de7')
-
-prepare() {
-  cd ${pkgname}-${pkgver}
-  patch -p1 -i "${srcdir}/debian-bug448360.patch"
-  patch -p1 -i "${srcdir}/CAN-2004-1026.patch"
-  patch -p0 -i "${srcdir}/aclocal-fixes.patch"
-  patch -p0 -i "${srcdir}/imlib-1.9.15-libpng15.patch"
-  patch -p1 -i "${srcdir}/imlib-giflib51.patch"
-  patch -p1 -i "${srcdir}/imlib-gtk.patch"
-  sed '/AC_PATH_XTRA/d' -i configure.in
-  mv configure.in configure.ac
-  libtoolize --force
-  cp /usr/bin/libtool .
-}
-
-build() {
-  cd ${pkgname}-${pkgver}
-  autoreconf --force --install
-  ./configure --prefix=/usr --sysconfdir=/etc --mandir=/usr/share/man --enable-shm --disable-static
-  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
-  make
-}
-
-package() {
-  cd ${pkgname}-${pkgver}
-  make DESTDIR="${pkgdir}" install
-}
diff --git a/arch/tde-deps/imlib/aclocal-fixes.patch b/arch/tde-deps/imlib/aclocal-fixes.patch
deleted file mode 100644
index 04ef737e7..000000000
--- a/arch/tde-deps/imlib/aclocal-fixes.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- imlib.m4.orig	2006-03-05 12:41:14.000000000 +0000
-+++ imlib.m4	2006-03-05 12:44:15.000000000 +0000
-@@ -6,7 +6,7 @@
- dnl AM_PATH_IMLIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
- dnl Test for IMLIB, and define IMLIB_CFLAGS and IMLIB_LIBS
- dnl
--AC_DEFUN(AM_PATH_IMLIB,
-+AC_DEFUN([AM_PATH_IMLIB],
- [dnl 
- dnl Get the cflags and libraries from the imlib-config script
- dnl
-@@ -164,7 +164,7 @@
- ])
- 
- # Check for gdk-imlib
--AC_DEFUN(AM_PATH_GDK_IMLIB,
-+AC_DEFUN([AM_PATH_GDK_IMLIB],
- [dnl 
- dnl Get the cflags and libraries from the imlib-config script
- dnl
diff --git a/arch/tde-deps/imlib/debian-bug448360.patch b/arch/tde-deps/imlib/debian-bug448360.patch
deleted file mode 100644
index f1c0ef111..000000000
--- a/arch/tde-deps/imlib/debian-bug448360.patch
+++ /dev/null
@@ -1,92 +0,0 @@
-diff -up -ru imlib-1.9.15.orig/gdk_imlib/misc.c imlib-1.9.15/gdk_imlib/misc.c
---- imlib-1.9.15.orig/gdk_imlib/misc.c	2002-03-04 18:06:32.000000000 +0100
-+++ imlib-1.9.15/gdk_imlib/misc.c	2007-10-28 14:00:04.000000000 +0100
-@@ -674,6 +674,10 @@ gdk_imlib_init_params(GdkImlibInitParams
-   visual = gdk_rgb_get_visual();
-   id->x.visual = GDK_VISUAL_XVISUAL(visual);	/* the visual type */
-   id->x.depth = visual->depth;	/* the depth of the screen in bpp */
-+
-+  id->x.shm = 0;
-+  id->x.shmp = 0;
-+  id->max_shm = 0;
- #ifdef HAVE_SHM
-   if (XShmQueryExtension(id->x.disp))
-     {
-@@ -689,17 +693,14 @@ gdk_imlib_init_params(GdkImlibInitParams
- 	      id->x.last_xim = NULL;
- 	      id->x.last_sxim = NULL;
- 	      id->max_shm = 0x7fffffff;
--	      if (XShmPixmapFormat(id->x.disp) == ZPixmap)
-+	      if ((XShmPixmapFormat(id->x.disp) == ZPixmap) &&
-+		  (pm == True))
- 		id->x.shmp = 1;
- 	    }
- 	}
-     }
--  else
- #endif
--    {
--      id->x.shm = 0;
--      id->x.shmp = 0;
--    }
-+
-   id->cache.on_image = 0;
-   id->cache.size_image = 0;
-   id->cache.num_image = 0;
-@@ -935,8 +936,8 @@ gdk_imlib_init_params(GdkImlibInitParams
- 	}
-       if (p->flags & PARAMS_SHAREDPIXMAPS)
- 	{
--	  if (id->x.shm)
--	    id->x.shmp = p->sharedpixmaps;
-+	  if (!p->sharedpixmaps)
-+	    id->x.shmp = 0;
- 	}
-       if (p->flags & PARAMS_PALETTEOVERRIDE)
- 	override = p->paletteoverride;
-diff -up -ru imlib-1.9.15.orig/Imlib/misc.c imlib-1.9.15/Imlib/misc.c
---- imlib-1.9.15.orig/Imlib/misc.c	2004-09-21 02:22:59.000000000 +0200
-+++ imlib-1.9.15/Imlib/misc.c	2007-10-28 14:00:23.000000000 +0100
-@@ -675,6 +675,10 @@ Imlib_init_with_params(Display * disp, I
-   id->x.root = DefaultRootWindow(disp);		/* the root window id */
-   id->x.visual = DefaultVisual(disp, id->x.screen);	/* the visual type */
-   id->x.depth = DefaultDepth(disp, id->x.screen);	/* the depth of the screen in bpp */
-+
-+  id->x.shm = 0;
-+  id->x.shmp = 0;
-+  id->max_shm = 0;
- #ifdef HAVE_SHM
-   if (XShmQueryExtension(id->x.disp))
-     {
-@@ -690,17 +694,14 @@ Imlib_init_with_params(Display * disp, I
- 	      id->x.last_xim = NULL;
- 	      id->x.last_sxim = NULL;
- 	      id->max_shm = 0x7fffffff;
--	      if (XShmPixmapFormat(id->x.disp) == ZPixmap)
-+	      if ((XShmPixmapFormat(id->x.disp) == ZPixmap &&
-+		   (pm == True)))
- 		id->x.shmp = 1;
- 	    }
- 	}
-     }
--  else
- #endif
--    {
--      id->x.shm = 0;
--      id->x.shmp = 0;
--    }
-+
-   id->cache.on_image = 0;
-   id->cache.size_image = 0;
-   id->cache.num_image = 0;
-@@ -952,8 +953,8 @@ Imlib_init_with_params(Display * disp, I
- 	}
-       if (p->flags & PARAMS_SHAREDPIXMAPS)
- 	{
--	  if (id->x.shm)
--	    id->x.shmp = p->sharedpixmaps;
-+	  if (!p->sharedpixmaps)
-+	    id->x.shmp = 0;
- 	}
-       if (p->flags & PARAMS_PALETTEOVERRIDE)
- 	override = p->paletteoverride;
diff --git a/arch/tde-deps/imlib/imlib-1.9.15-libpng15.patch b/arch/tde-deps/imlib/imlib-1.9.15-libpng15.patch
deleted file mode 100644
index 7837cd488..000000000
--- a/arch/tde-deps/imlib/imlib-1.9.15-libpng15.patch
+++ /dev/null
@@ -1,142 +0,0 @@
---- gdk_imlib/io-png.c
-+++ gdk_imlib/io-png.c
-@@ -40,13 +40,13 @@
-       return NULL;
-     }
- 
--  if (setjmp(png_ptr->jmpbuf))
-+  if (setjmp(png_jmpbuf(png_ptr)))
-     {
-       png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
-       return NULL;
-     }
- 
--  if (info_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
-+  if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_RGB_ALPHA)
-     {
-       png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
-       return NULL;
-@@ -275,13 +275,13 @@
-       return NULL;
-     }
-   
--  if (setjmp(png_ptr->jmpbuf))
-+  if (setjmp(png_jmpbuf(png_ptr)))
-     {
-       png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
-       return NULL;
-     }
-   
--  if (info_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
-+  if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_RGB_ALPHA)
-     {
-       png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
-       return NULL;
-@@ -301,6 +301,9 @@
-   /* Setup Translators */
-   if (color_type == PNG_COLOR_TYPE_PALETTE)
-     png_set_expand(png_ptr);
-+  if (color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8)
-+    png_set_expand(png_ptr);
-+
-   png_set_strip_16(png_ptr);
-   png_set_packing(png_ptr);
-   if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS))
-@@ -440,13 +443,13 @@
- 		return NULL;
- 	}
- 	
--	if (setjmp(png_ptr->jmpbuf))
-+	if (setjmp(png_jmpbuf(png_ptr)))
- 	{
- 		png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
- 		return NULL;
- 	}
- 	
--	if (info_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
-+	if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_RGB_ALPHA)
- 	{
- 		png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
- 		return NULL;
-@@ -635,7 +638,7 @@
- 	      png_destroy_write_struct(&png_ptr, (png_infopp) NULL);
- 	      return 0;
- 	    }
--	  if (setjmp(png_ptr->jmpbuf))
-+	  if (setjmp(png_jmpbuf(png_ptr)))
- 	    {
- 	      fclose(f);
- 	      png_destroy_write_struct(&png_ptr, (png_infopp) NULL);
---- Imlib/load.c
-+++ Imlib/load.c
-@@ -197,12 +197,12 @@
-       png_destroy_read_struct(&png_ptr, NULL, NULL);
-       return NULL;
-     }
--  if (setjmp(png_ptr->jmpbuf))
-+  if (setjmp(png_jmpbuf(png_ptr)))
-     {
-       png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
-       return NULL;
-     }
--  if (info_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
-+  if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_RGB_ALPHA)
-     {
-       png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
-       return NULL;
-@@ -260,7 +260,8 @@
-   png_read_image(png_ptr, lines);
-   png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
-   ptr = data;
--  if (color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
-+  if (color_type == PNG_COLOR_TYPE_GRAY
-+      || color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
-     {
-       for (y = 0; y < *h; y++)
- 	{
-@@ -285,6 +286,7 @@
- 	    }
- 	}
-     }
-+#if 0
-   else if (color_type == PNG_COLOR_TYPE_GRAY)
-     {
-       for (y = 0; y < *h; y++)
-@@ -300,6 +302,7 @@
- 	    }
- 	}
-     }
-+#endif
-   else
-     {
-       for (y = 0; y < *h; y++)
---- Imlib/save.c
-+++ Imlib/save.c
-@@ -342,7 +342,7 @@
- 	      png_destroy_write_struct(&png_ptr, (png_infopp) NULL);
- 	      return 0;
- 	    }
--	  if (setjmp(png_ptr->jmpbuf))
-+	  if (setjmp(png_jmpbuf(png_ptr)))
- 	    {
- 	      fclose(f);
- 	      png_destroy_write_struct(&png_ptr, (png_infopp) NULL);
---- Imlib/utils.c
-+++ Imlib/utils.c
-@@ -1981,14 +1981,13 @@
-       png_destroy_read_struct(&png_ptr, NULL, NULL);
-       return NULL;
-     }
--  
--  if (setjmp(png_ptr->jmpbuf))
-+  if (setjmp(png_jmpbuf(png_ptr)))  
-     {
-       png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
-       return NULL;
-     }
-   
--  if (info_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
-+  if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_RGB_ALPHA)
-     {
-       png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
-       return NULL;
diff --git a/arch/tde-deps/imlib/imlib-giflib51.patch b/arch/tde-deps/imlib/imlib-giflib51.patch
deleted file mode 100644
index ae0cf7043..000000000
--- a/arch/tde-deps/imlib/imlib-giflib51.patch
+++ /dev/null
@@ -1,126 +0,0 @@
-diff -ruN imlib-1.9.15.orig/gdk_imlib/io-gif.c imlib-1.9.15/gdk_imlib/io-gif.c
---- imlib-1.9.15.orig/gdk_imlib/io-gif.c	2014-05-27 09:38:13.210527763 +0000
-+++ imlib-1.9.15/gdk_imlib/io-gif.c	2014-05-27 09:43:55.435910398 +0000
-@@ -30,7 +30,7 @@
-   fd = fileno(f);
-   /* Apparently rewind(f) isn't sufficient */
-   lseek(fd, (long) 0, 0);
--  gif = DGifOpenFileHandle(fd);
-+  gif = DGifOpenFileHandle(fd, NULL);
- 
-   transp = -1;
-   data = NULL;
-@@ -43,14 +43,14 @@
-     {
-       if (DGifGetRecordType(gif, &rec) == GIF_ERROR)
- 	{
--	  PrintGifError();
-+	  fprintf(stderr, "giflib error: %s\n", GifErrorString(gif->Error));
- 	  rec = TERMINATE_RECORD_TYPE;
- 	}
-       if ((rec == IMAGE_DESC_RECORD_TYPE) && (!done))
- 	{
- 	  if (DGifGetImageDesc(gif) == GIF_ERROR)
- 	    {
--	      PrintGifError();
-+	      fprintf(stderr, "giflib error: %s\n", GifErrorString(gif->Error));
- 	      rec = TERMINATE_RECORD_TYPE;
- 	    }
- 	  *w = gif->Image.Width;
-@@ -62,13 +62,13 @@
- 	  rows = malloc(*h * sizeof(GifRowType *));
- 	  if (!rows)
- 	    {
--	      DGifCloseFile(gif);
-+	      DGifCloseFile(gif, NULL);
- 	      return NULL;
- 	    }
- 	  data = _gdk_malloc_image(*w, *h);
- 	  if (!data)
- 	    {
--	      DGifCloseFile(gif);
-+	      DGifCloseFile(gif, NULL);
- 	      free(rows);
- 	      return NULL;
- 	    }
-@@ -79,7 +79,7 @@
- 	      rows[i] = malloc(*w * sizeof(GifPixelType));
- 	      if (!rows[i])
- 		{
--		  DGifCloseFile(gif);
-+		  DGifCloseFile(gif, NULL);
- 		  for (i = 0; i < *h; i++)
- 		    if (rows[i])
- 		      free(rows[i]);
-@@ -168,7 +168,7 @@
- 	    }
- 	}
-     }
--  DGifCloseFile(gif);
-+  DGifCloseFile(gif, NULL);
-   for (i = 0; i < *h; i++)
-     free(rows[i]);
-   free(rows);
-diff -ruN imlib-1.9.15.orig/Imlib/load.c imlib-1.9.15/Imlib/load.c
---- imlib-1.9.15.orig/Imlib/load.c	2014-05-27 09:38:13.220527723 +0000
-+++ imlib-1.9.15/Imlib/load.c	2014-05-27 09:45:25.775576104 +0000
-@@ -454,7 +454,7 @@
-   fd = fileno(f);
-   /* Apparently rewind(f) isn't sufficient */
-   lseek(fd, (long) 0, 0);
--  gif = DGifOpenFileHandle(fd);
-+  gif = DGifOpenFileHandle(fd, NULL);
- 
-   if (!gif)
-     return NULL;
-@@ -462,14 +462,14 @@
-     {
-       if (DGifGetRecordType(gif, &rec) == GIF_ERROR)
- 	{
--	  PrintGifError();
-+          fprintf(stderr, "Imlib ERROR: JPEG uses line buffers > 16. Cannot load.\n");
- 	  rec = TERMINATE_RECORD_TYPE;
- 	}
-       if ((rec == IMAGE_DESC_RECORD_TYPE) && (!done))
- 	{
- 	  if (DGifGetImageDesc(gif) == GIF_ERROR)
- 	    {
--	      PrintGifError();
-+              fprintf(stderr, "Imlib ERROR: JPEG uses line buffers > 16. Cannot load.\n");
- 	      rec = TERMINATE_RECORD_TYPE;
- 	    }
- 	  *w = gif->Image.Width;
-@@ -481,13 +481,13 @@
- 	  rows = malloc(*h * sizeof(GifRowType *));
- 	  if (!rows)
- 	    {
--	      DGifCloseFile(gif);
-+	      DGifCloseFile(gif, NULL);
- 	      return NULL;
- 	    }
- 	  data = _imlib_malloc_image(*w, *h);
- 	  if (!data)
- 	    {
--	      DGifCloseFile(gif);
-+	      DGifCloseFile(gif, NULL);
- 	      free(rows);
- 	      return NULL;
- 	    }
-@@ -498,7 +498,7 @@
- 	      rows[i] = malloc(*w * sizeof(GifPixelType));
- 	      if (!rows[i])
- 		{
--		  DGifCloseFile(gif);
-+		  DGifCloseFile(gif, NULL);
- 		  for (i = 0; i < *h; i++)
- 		    if (rows[i])
- 		      free(rows[i]);
-@@ -587,7 +587,7 @@
- 	    }
- 	}
-     }
--  DGifCloseFile(gif);
-+  DGifCloseFile(gif, NULL);
-   for (i = 0; i < *h; i++)
-     free(rows[i]);
-   free(rows);
diff --git a/arch/tde-deps/imlib/imlib-gtk.patch b/arch/tde-deps/imlib/imlib-gtk.patch
deleted file mode 100644
index c6e4fb618..000000000
--- a/arch/tde-deps/imlib/imlib-gtk.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- a/configure.in	2014-04-12 17:46:28.459612102 +0200
-+++ b/configure.in	2014-04-12 17:46:33.926347877 +0200
-@@ -17,11 +17,6 @@
- dnl incase it is broken for example.
- AC_ARG_ENABLE(shm, [  --enable-shm            support shared memory if available [default=yes]], echo $enable_shm, enable_shm="yes")
- 
--AM_PATH_GTK(1.2.1,[
--  GDK_IMLIB="gdk_imlib utils"],[
--  GDK_IMLIB="" 
--  AC_MSG_WARN([*** gdk_imlib will not be built ***])])
--
- AC_MSG_CHECKING(whether to build gmodulized imlib)
- 
- AC_ARG_ENABLE(modules, [  --disable-modules       Disables dynamic module loading],[
diff --git a/freebsd/core/tdegraphics/Makefile b/freebsd/core/tdegraphics/Makefile
index 6848387cd..33e29cc04 100644
--- a/freebsd/core/tdegraphics/Makefile
+++ b/freebsd/core/tdegraphics/Makefile
@@ -25,7 +25,7 @@ BUILD_DEPENDS+=	${TDE_PREFIX}/lib/libartsc.so:audio/arts-trinity \
 
 LIB_DEPENDS+=	libtqt.so:x11-toolkits/libtqtinterface \
 		libart_lgpl_2.so:graphics/libart_lgpl-trinity \
-		libImlib.so:graphics/imlib \
+		libImlib2.so:graphics/imlib2 \
 
 LIB_DEPENDS+=\
 		libexif.so:graphics/libexif \
diff --git a/freebsd/dependencies/Makefile b/freebsd/dependencies/Makefile
index d43d4f4d9..b2aff3f9a 100644
--- a/freebsd/dependencies/Makefile
+++ b/freebsd/dependencies/Makefile
@@ -19,7 +19,6 @@
     SUBDIR += dbus-tqt
     SUBDIR += dbus-1-tqt
     SUBDIR += polkit-tqt
-    SUBDIR += imlib
     SUBDIR += libart-lgpl
     SUBDIR += libcaldav
     SUBDIR += libcarddav
diff --git a/freebsd/dependencies/imlib/Makefile b/freebsd/dependencies/imlib/Makefile
deleted file mode 100644
index 1436e4da5..000000000
--- a/freebsd/dependencies/imlib/Makefile
+++ /dev/null
@@ -1,48 +0,0 @@
-# -*-mode: makefile-*-
-# Created by: slavek.banko@axis.cz
-# $FreeBSD$
-#
-# TDE port map: dependencies/imlib
-
-PORTSDIR?=/usr/ports
-.include <${PORTSDIR}/Mk/bsd.trinity.mk>
-
-PORTNAME=		imlib
-COMMENT=		A graphic library for enlightenment package
-MASTER_SITE_SUBDIR=	i/${PORTNAME}
-PORTVERSION=		1.9.15
-PORTREVISION=		18
-CATEGORIES=		graphics
-MASTER_SITES=		${MASTER_SITE_TDE_DEPS}
-DISTNAME=		${PORTNAME}_${PORTVERSION}
-DISTSRC=		${PORTNAME}-${PORTVERSION}
-DIST_SUBDIR=		TDE/dependencies
-PREFIX=			${LOCALBASE}
-
-
-LIB_DEPENDS+=	\
-		libpng.so:graphics/png \
-		libtiff.so:graphics/tiff \
-		libgif.so:graphics/giflib
-
-# Use gmake for automake build
-USES=		gmake
-USES+=		autoreconf libtool
-USE_XORG=	sm xext x11
-GNU_CONFIGURE=	yes
-USE_LDCONFIG=	yes
-CONFIGURE_ARGS=	--sysconfdir=${PREFIX}/etc/imlib --disable-modules
-CONFIGURE_ENV=	LIBS="-L${LOCALBASE}/lib"
-CPPFLAGS+=	-I${LOCALBASE}/include -I${LOCALBASE}/include/libpng15
-
-MAN1=		imlib-config.1 imlib_config.1
-
-pre-configure:
-	@${REINPLACE_CMD} -e "s|glib-config|${GLIB_CONFIG}|" ${WRKSRC}/configure
-	@${REINPLACE_CMD} -e "s|@SUPPORT_LIBS@|-L${LOCALBASE}/lib @SUPPORT_LIBS@|" ${WRKSRC}/imlib-config.in
-
-post-configure:
-	@${FIND} ${WRKSRC} -name "Makefile" -type f | ${XARGS} ${REINPLACE_CMD} -e \
-		's|[(]libdir[)]/pkgconfig|(prefix)/libdata/pkgconfig|g'
-
-.include <bsd.port.mk>
diff --git a/freebsd/dependencies/imlib/distinfo b/freebsd/dependencies/imlib/distinfo
deleted file mode 100644
index 1568357fa..000000000
--- a/freebsd/dependencies/imlib/distinfo
+++ /dev/null
@@ -1,3 +0,0 @@
-TIMESTAMP = 1495991805
-SHA256 (TDE/dependencies/imlib_1.9.15.orig.tar.xz) = 8e5df78cfbb6b5c16466cd2fe411bda30064ada2c69704f989b81f1ceb00e47a
-SIZE (TDE/dependencies/imlib_1.9.15.orig.tar.xz) = 605220
diff --git a/freebsd/dependencies/imlib/files/patch-445914.diff b/freebsd/dependencies/imlib/files/patch-445914.diff
deleted file mode 100644
index 31608378d..000000000
--- a/freebsd/dependencies/imlib/files/patch-445914.diff
+++ /dev/null
@@ -1,46 +0,0 @@
-
-Fixes #445914.
-
- -- Chris Lamb <chris@chris-lamb.co.uk>  Sun, 18 May 2008 02:11:57 +0100
-
---- imlib-1.9.15.orig/gdk_imlib/misc.c
-+++ imlib-1.9.15/gdk_imlib/misc.c
-@@ -455,6 +455,8 @@
- 	      if (xvir[i].depth > max)
- 		max = xvir[i].depth;
- 	    }
-+	  if (max > 24)
-+	    max = 24;
- 	  if (max > 8)
- 	    {
- 	      id->x.depth = max;
-@@ -1004,6 +1006,8 @@
- 	      if (xvir[i].depth > max)
- 		max = xvir[i].depth;
- 	    }
-+	  if (max > 24)
-+	    max = 24;
- 	  if (max > 8)
- 	    {
- 	      id->x.depth = max;
---- imlib-1.9.15.orig/Imlib/misc.c
-+++ imlib-1.9.15/Imlib/misc.c
-@@ -423,6 +423,8 @@
- 	      if (xvir[i].depth > max)
- 		max = xvir[i].depth;
- 	    }
-+	  if (max > 24)
-+	    max = 24;
- 	  if (max > 8)
- 	    {
- 	      id->x.depth = max;
-@@ -1026,6 +1028,8 @@
- 	      if (xvir[i].depth > max)
- 		max = xvir[i].depth;
- 	    }
-+	  if (max > 24)
-+	    max = 24;
- 	  if (max > 8)
- 	    {
- 	      id->x.depth = max;
-
diff --git a/freebsd/dependencies/imlib/files/patch-448360.diff b/freebsd/dependencies/imlib/files/patch-448360.diff
deleted file mode 100644
index 4873aa689..000000000
--- a/freebsd/dependencies/imlib/files/patch-448360.diff
+++ /dev/null
@@ -1,95 +0,0 @@
-
-Fixes #448360.
-
- -- Chris Lamb <chris@chris-lamb.co.uk>  Sun, 18 May 2008 02:11:57 +0100
-
---- imlib-1.9.15.orig/gdk_imlib/misc.c	2008-05-18 01:47:54.000000000 +0100
-+++ imlib-1.9.15/gdk_imlib/misc.c	2008-05-18 02:14:13.000000000 +0100
-@@ -676,6 +674,10 @@
-   visual = gdk_rgb_get_visual();
-   id->x.visual = GDK_VISUAL_XVISUAL(visual);	/* the visual type */
-   id->x.depth = visual->depth;	/* the depth of the screen in bpp */
-+
-+  id->x.shm = 0;
-+  id->x.shmp = 0;
-+  id->max_shm = 0;
- #ifdef HAVE_SHM
-   if (XShmQueryExtension(id->x.disp))
-     {
-@@ -691,17 +693,14 @@
- 	      id->x.last_xim = NULL;
- 	      id->x.last_sxim = NULL;
- 	      id->max_shm = 0x7fffffff;
--	      if (XShmPixmapFormat(id->x.disp) == ZPixmap)
-+	      if ((XShmPixmapFormat(id->x.disp) == ZPixmap) &&
-+		  (pm == True))
- 		id->x.shmp = 1;
- 	    }
- 	}
-     }
--  else
- #endif
--    {
--      id->x.shm = 0;
--      id->x.shmp = 0;
--    }
-+
-   id->cache.on_image = 0;
-   id->cache.size_image = 0;
-   id->cache.num_image = 0;
-@@ -937,8 +936,8 @@
- 	}
-       if (p->flags & PARAMS_SHAREDPIXMAPS)
- 	{
--	  if (id->x.shm)
--	    id->x.shmp = p->sharedpixmaps;
-+	  if (!p->sharedpixmaps)
-+	    id->x.shmp = 0;
- 	}
-       if (p->flags & PARAMS_PALETTEOVERRIDE)
- 	override = p->paletteoverride;
---- imlib-1.9.15.orig/Imlib/misc.c	2008-05-18 01:47:54.000000000 +0100
-+++ imlib-1.9.15/Imlib/misc.c	2008-05-18 02:14:13.000000000 +0100
-@@ -677,6 +675,10 @@
-   id->x.root = DefaultRootWindow(disp);		/* the root window id */
-   id->x.visual = DefaultVisual(disp, id->x.screen);	/* the visual type */
-   id->x.depth = DefaultDepth(disp, id->x.screen);	/* the depth of the screen in bpp */
-+
-+  id->x.shm = 0;
-+  id->x.shmp = 0;
-+  id->max_shm = 0;
- #ifdef HAVE_SHM
-   if (XShmQueryExtension(id->x.disp))
-     {
-@@ -692,17 +694,14 @@
- 	      id->x.last_xim = NULL;
- 	      id->x.last_sxim = NULL;
- 	      id->max_shm = 0x7fffffff;
--	      if (XShmPixmapFormat(id->x.disp) == ZPixmap)
-+	      if ((XShmPixmapFormat(id->x.disp) == ZPixmap &&
-+		   (pm == True)))
- 		id->x.shmp = 1;
- 	    }
- 	}
-     }
--  else
- #endif
--    {
--      id->x.shm = 0;
--      id->x.shmp = 0;
--    }
-+
-   id->cache.on_image = 0;
-   id->cache.size_image = 0;
-   id->cache.num_image = 0;
-@@ -954,8 +953,8 @@
- 	}
-       if (p->flags & PARAMS_SHAREDPIXMAPS)
- 	{
--	  if (id->x.shm)
--	    id->x.shmp = p->sharedpixmaps;
-+	  if (!p->sharedpixmaps)
-+	    id->x.shmp = 0;
- 	}
-       if (p->flags & PARAMS_PALETTEOVERRIDE)
- 	override = p->paletteoverride;
diff --git a/freebsd/dependencies/imlib/files/patch-PrintGifError.diff b/freebsd/dependencies/imlib/files/patch-PrintGifError.diff
deleted file mode 100644
index 6437515d6..000000000
--- a/freebsd/dependencies/imlib/files/patch-PrintGifError.diff
+++ /dev/null
@@ -1,24 +0,0 @@
---- a/Imlib/load.c	2012-06-16 20:19:27.000000000 +0200
-+++ b/Imlib/load.c	2012-06-16 20:19:56.000000000 +0200
-@@ -420,6 +420,21 @@
- #endif /* HAVE_LIBTIFF */
- 
- #ifdef HAVE_LIBGIF
-+
-+#if defined(GIFLIB_MAJOR) && defined(GIFLIB_MINOR) && ((GIFLIB_MAJOR == 4 && GIFLIB_MINOR >= 2) || GIFLIB_MAJOR > 4)
-+static void PrintGifError(void) {
-+#if GIFLIB_MAJOR >= 5
-+	fprintf(stderr, "GIF-LIB error (exact reporting not implemented)\n");
-+#else
-+	const char * errorString = GifErrorString();
-+	if (errorString)
-+		fprintf(stderr, "GIF-LIB error: %s\n", errorString);
-+	else
-+		fprintf(stderr, "GIF-LIB undefined error: %d\n", GifError());
-+#endif
-+}
-+#endif
-+
- unsigned char      *
- _LoadGIF(ImlibData * id, FILE *f, int *w, int *h, int *t)
- {
diff --git a/freebsd/dependencies/imlib/files/patch-bpp16-CVE-2007-3568.diff b/freebsd/dependencies/imlib/files/patch-bpp16-CVE-2007-3568.diff
deleted file mode 100644
index 83e28cec6..000000000
--- a/freebsd/dependencies/imlib/files/patch-bpp16-CVE-2007-3568.diff
+++ /dev/null
@@ -1,16 +0,0 @@
-
-Fixes #437708.
-
- -- Chris Lamb <chris@chris-lamb.co.uk>  Sun, 18 May 2008 02:11:57 +0100
-
---- imlib/Imlib/load.c.orig	2007-08-13 23:06:20.000000000 -0300
-+++ imlib/Imlib/load.c	2007-08-13 23:06:51.000000000 -0300
-@@ -645,7 +645,7 @@
-   planes = (int)word;
-   fread(&word, 2, 1, file);
-   bpp = (int)word;
--  if (bpp != 1 && bpp != 4 && bpp != 8 && bpp && 16 && bpp != 24 && bpp != 32)
-+  if (bpp != 1 && bpp != 4 && bpp != 8 && bpp != 16 && bpp != 24 && bpp != 32)
-     {
-       fprintf(stderr, "IMLIB ERROR: unknown bitdepth in file\n");
-       return NULL;
diff --git a/freebsd/dependencies/imlib/files/patch-check-gnu-basename.diff b/freebsd/dependencies/imlib/files/patch-check-gnu-basename.diff
deleted file mode 100644
index c636bac01..000000000
--- a/freebsd/dependencies/imlib/files/patch-check-gnu-basename.diff
+++ /dev/null
@@ -1,46 +0,0 @@
-Index: imlib-1.9.15/Imlib/colors.c
-===================================================================
---- imlib-1.9.15.orig/Imlib/colors.c
-+++ imlib-1.9.15/Imlib/colors.c
-@@ -3,8 +3,10 @@
- #include "Imlib.h"
- #include "Imlib_private.h"
- 
--#ifndef HAVE_BASENAME
-+#if defined(HAVE_GNU_BASENAME)
- #include <string.h>
-+#elif defined(HAVE_BASENAME)
-+#include <libgen.h>
- #endif
- 
- #ifdef __EMX__
-Index: imlib-1.9.15/config.h.in
-===================================================================
---- imlib-1.9.15.orig/config.h.in
-+++ imlib-1.9.15/config.h.in
-@@ -19,6 +19,9 @@
- /* Define to 1 if you have the <dlfcn.h> header file. */
- #undef HAVE_DLFCN_H
- 
-+/* Defined if we hare GNU version of basename */
-+#undef HAVE_GNU_BASENAME
-+
- /* Define to 1 if you have the <inttypes.h> header file. */
- #undef HAVE_INTTYPES_H
- 
-Index: imlib-1.9.15/configure.in
-===================================================================
---- imlib-1.9.15.orig/configure.in
-+++ imlib-1.9.15/configure.in
-@@ -101,6 +101,11 @@ AC_TYPE_SIGNAL
- AC_CHECK_FUNCS(vsnprintf)
- AC_CHECK_FUNCS(snprintf)
- AC_CHECK_FUNCS(basename)
-+AC_CHECK_DECL([basename(char*)], AC_DEFINE(HAVE_GNU_BASENAME, 1, [Defined if we hare GNU version of basename]), [], [
-+#define _GNU_SOURCE
-+#include <string.h>
-+])
-+
- 
- AC_CHECK_FUNCS(blumfrub)
- AC_CHECK_FUNCS(buckets_of_erogenous_nym)
diff --git a/freebsd/dependencies/imlib/files/patch-disable-gtk-configure-check.diff b/freebsd/dependencies/imlib/files/patch-disable-gtk-configure-check.diff
deleted file mode 100644
index fdb5e3957..000000000
--- a/freebsd/dependencies/imlib/files/patch-disable-gtk-configure-check.diff
+++ /dev/null
@@ -1,19 +0,0 @@
-Index: b/configure.in
-===================================================================
---- a/configure.in
-+++ b/configure.in
-@@ -17,10 +17,10 @@
- dnl incase it is broken for example.
- AC_ARG_ENABLE(shm, [  --enable-shm            support shared memory if available [default=yes]], echo $enable_shm, enable_shm="yes")
- 
--AM_PATH_GTK(1.2.1,[
--  GDK_IMLIB="gdk_imlib utils"],[
--  GDK_IMLIB="" 
--  AC_MSG_WARN([*** gdk_imlib will not be built ***])])
-+dnl AM_PATH_GTK(1.2.1,[
-+dnl   GDK_IMLIB="gdk_imlib utils"],[
-+dnl   GDK_IMLIB="" 
-+dnl   AC_MSG_WARN([*** gdk_imlib will not be built ***])])
- 
- AC_MSG_CHECKING(whether to build gmodulized imlib)
- 
diff --git a/freebsd/dependencies/imlib/files/patch-fix-potential-buffer-overflow.diff b/freebsd/dependencies/imlib/files/patch-fix-potential-buffer-overflow.diff
deleted file mode 100644
index 406aead10..000000000
--- a/freebsd/dependencies/imlib/files/patch-fix-potential-buffer-overflow.diff
+++ /dev/null
@@ -1,19 +0,0 @@
-Index: b/Imlib/load.c
-===================================================================
---- a/Imlib/load.c
-+++ b/Imlib/load.c
-@@ -1974,11 +1974,11 @@
-       if (iden[0])
- 	{
- #ifndef __EMX__
--	  strncat(fil, ":", sizeof(fil) - strlen(fil));
-+	  strncat(fil, ":", sizeof(fil) - strlen(fil) - 1);
- #else
--	  strncat(fil, ";", sizeof(fil) - strlen(fil));
-+	  strncat(fil, ";", sizeof(fil) - strlen(fil) - 1);
- #endif
--	  strncat(fil, iden, sizeof(fil) - strlen(fil));
-+	  strncat(fil, iden, sizeof(fil) - strlen(fil) - 1);
- 	}
-     }
-   im->mod.gamma = id->mod.gamma;
diff --git a/freebsd/dependencies/imlib/files/patch-gdk-makefile.diff b/freebsd/dependencies/imlib/files/patch-gdk-makefile.diff
deleted file mode 100644
index 11bf6271f..000000000
--- a/freebsd/dependencies/imlib/files/patch-gdk-makefile.diff
+++ /dev/null
@@ -1,30 +0,0 @@
---- imlib-1.9.15.orig/gdk_imlib/Makefile.am
-+++ imlib-1.9.15/gdk_imlib/Makefile.am
-@@ -15,7 +15,7 @@
- libimlib_jpeg_la_LIBADD  = $(JPEGLIBS) libgdk_imlib.la
- 
- libimlib_png_la_SOURCES = io-png.c
--libimlib_png_la_LDFLAGS = $(common_ldflags)
-+libimlib_png_la_LDFLAGS = $(common_ldflags) -lglib
- libimlib_png_la_LIBADD  = $(PNGLIBS) libgdk_imlib.la
- 
- libimlib_tiff_la_SOURCES = io-tiff.c
-@@ -31,7 +31,7 @@
- libimlib_bmp_la_LIBADD = libgdk_imlib.la
- 
- libimlib_xpm_la_SOURCES = io-xpm.c
--libimlib_xpm_la_LDFLAGS = $(common_ldflags)
-+libimlib_xpm_la_LDFLAGS = $(common_ldflags) -lX11
- libimlib_xpm_la_LIBADD = libgdk_imlib.la
- 
- libimlib_ppm_la_SOURCES = io-ppm.c
-@@ -86,7 +86,7 @@
- 	modules.c
- 
- 
--libgdk_imlib_la_LDFLAGS = -version-info 10:15:9
-+libgdk_imlib_la_LDFLAGS = -version-info 10:15:8
- libgdk_imlib_la_LIBADD = $(GX_LIBS)
- 
- 
-
diff --git a/freebsd/dependencies/imlib/files/patch-giflib-ungif.diff b/freebsd/dependencies/imlib/files/patch-giflib-ungif.diff
deleted file mode 100644
index e0b49557f..000000000
--- a/freebsd/dependencies/imlib/files/patch-giflib-ungif.diff
+++ /dev/null
@@ -1,24 +0,0 @@
-Index: b/configure.in
-===================================================================
---- a/configure.in
-+++ b/configure.in
-@@ -250,12 +250,13 @@
- 
- 
- AC_CHECK_HEADER(gif_lib.h,
--  [AC_CHECK_LIB(ungif, DGifOpenFileName,
--    [GIFLIBS="-lungif"
--     SUPPORT_LIBS="$SUPPORT_LIBS -lungif"; AC_DEFINE(HAVE_LIBGIF, 1, [ ])],
--    [AC_CHECK_LIB(gif, DGifOpenFileName,
--      [GIFLIBS="-lgif"
--      SUPPORT_LIBS="$SUPPORT_LIBS -lgif"
-+  [AC_CHECK_LIB(gif, DGifOpenFileName,
-+    [GIFLIBS="-lgif"
-+     SUPPORT_LIBS="$SUPPORT_LIBS -lgif"
-+     AC_DEFINE(HAVE_LIBGIF, 1, [ ])],
-+    [AC_CHECK_LIB(ungif, DGifOpenFileName,
-+      [GIFLIBS="-lungif"
-+       SUPPORT_LIBS="$SUPPORT_LIBS -lungif"
-        AC_DEFINE(HAVE_LIBGIF, 1, [ ])],
-       [AC_MSG_ERROR(*** GIF library file not found ***)], 
-       $GX_LIBS)],
diff --git a/freebsd/dependencies/imlib/files/patch-giflib5.1.diff b/freebsd/dependencies/imlib/files/patch-giflib5.1.diff
deleted file mode 100644
index fddd984fc..000000000
--- a/freebsd/dependencies/imlib/files/patch-giflib5.1.diff
+++ /dev/null
@@ -1,50 +0,0 @@
-Index: imlib-1.9.15/Imlib/load.c
-===================================================================
---- imlib-1.9.15.orig/Imlib/load.c
-+++ imlib-1.9.15/Imlib/load.c
-@@ -489,13 +489,21 @@ _LoadGIF(ImlibData * id, FILE *f, int *w
- 	  rows = malloc(*h * sizeof(GifRowType *));
- 	  if (!rows)
- 	    {
-+#if GIFLIB_MAJOR > 5 || (GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1)
-+	      DGifCloseFile(gif, NULL);
-+#else
- 	      DGifCloseFile(gif);
-+#endif
- 	      return NULL;
- 	    }
- 	  data = _imlib_malloc_image(*w, *h);
- 	  if (!data)
- 	    {
-+#if GIFLIB_MAJOR > 5 || (GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1)
-+	      DGifCloseFile(gif, NULL);
-+#else
- 	      DGifCloseFile(gif);
-+#endif
- 	      free(rows);
- 	      return NULL;
- 	    }
-@@ -506,7 +514,11 @@ _LoadGIF(ImlibData * id, FILE *f, int *w
- 	      rows[i] = malloc(*w * sizeof(GifPixelType));
- 	      if (!rows[i])
- 		{
-+#if GIFLIB_MAJOR > 5 || (GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1)
-+		  DGifCloseFile(gif, NULL);
-+#else
- 		  DGifCloseFile(gif);
-+#endif
- 		  for (i = 0; i < *h; i++)
- 		    if (rows[i])
- 		      free(rows[i]);
-@@ -595,7 +607,11 @@ _LoadGIF(ImlibData * id, FILE *f, int *w
- 	    }
- 	}
-     }
-+#if GIFLIB_MAJOR > 5 || (GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1)
-+  DGifCloseFile(gif, NULL);
-+#else
-   DGifCloseFile(gif);
-+#endif
-   for (i = 0; i < *h; i++)
-     free(rows[i]);
-   free(rows);
diff --git a/freebsd/dependencies/imlib/files/patch-giflib5.diff b/freebsd/dependencies/imlib/files/patch-giflib5.diff
deleted file mode 100644
index 2249a5202..000000000
--- a/freebsd/dependencies/imlib/files/patch-giflib5.diff
+++ /dev/null
@@ -1,30 +0,0 @@
-diff -ru a/Imlib/load.c b/Imlib/load.c
---- a/Imlib/load.c	2015-06-21 03:21:07.000000000 +0200
-+++ b/Imlib/load.c	2015-06-21 03:16:28.000000000 +0200
-@@ -443,7 +443,11 @@
-   fd = fileno(f);
-   /* Apparently rewind(f) isn't sufficient */
-   lseek(fd, (long) 0, 0);
-+#if GIFLIB_MAJOR >= 5
-+  gif = DGifOpenFileHandle(fd, NULL);
-+#else
-   gif = DGifOpenFileHandle(fd);
-+#endif
- 
-   if (!gif)
-     return NULL;
-diff -ru a/gdk_imlib/io-gif.c b/gdk_imlib/io-gif.c
---- a/gdk_imlib/io-gif.c	2002-03-04 18:06:29.000000000 +0100
-+++ b/gdk_imlib/io-gif.c	2015-06-21 03:15:40.000000000 +0200
-@@ -30,7 +30,11 @@
-   fd = fileno(f);
-   /* Apparently rewind(f) isn't sufficient */
-   lseek(fd, (long) 0, 0);
-+#if GIFLIB_MAJOR >= 5
-+  gif = DGifOpenFileHandle(fd, NULL);
-+#else
-   gif = DGifOpenFileHandle(fd);
-+#endif
- 
-   transp = -1;
-   data = NULL;
diff --git a/freebsd/dependencies/imlib/files/patch-gmodule.diff b/freebsd/dependencies/imlib/files/patch-gmodule.diff
deleted file mode 100644
index 6aed03bc7..000000000
--- a/freebsd/dependencies/imlib/files/patch-gmodule.diff
+++ /dev/null
@@ -1,734 +0,0 @@
---- imlib-1.9.15.orig/gdk_imlib/local-hack-gmodule/gmodule-dl.c
-+++ imlib-1.9.15/gdk_imlib/local-hack-gmodule/gmodule-dl.c
-@@ -0,0 +1,158 @@
-+/* GMODULE - GLIB wrapper code for dynamic module loading
-+ * Copyright (C) 1998, 2000 Tim Janik
-+ *
-+ * This library is free software; you can redistribute it and/or
-+ * modify it under the terms of the GNU Library General Public
-+ * License as published by the Free Software Foundation; either
-+ * version 2 of the License, or (at your option) any later version.
-+ *
-+ * This library is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the GNU
-+ * Library General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Library General Public
-+ * License along with this library; if not, write to the
-+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-+ * Boston, MA 02111-1307, USA.
-+ */
-+
-+/*
-+ * Modified by the GLib Team and others 1997-1999.  See the AUTHORS
-+ * file for a list of people on the GLib Team.  See the ChangeLog
-+ * files for a list of changes.  These files are distributed with
-+ * GLib at ftp://ftp.gtk.org/pub/gtk/. 
-+ */
-+
-+/* 
-+ * MT safe
-+ */
-+
-+#include <dlfcn.h>
-+
-+/* Perl includes <nlist.h> and <link.h> instead of <dlfcn.h> on some systmes? */
-+
-+
-+/* dlerror() is not implemented on all systems
-+ */
-+#ifndef	LOCAL_HACK_G_MODULE_HAVE_DLERROR
-+#  ifdef __NetBSD__
-+#    define dlerror()	g_strerror (errno)
-+#  else /* !__NetBSD__ */
-+/* could we rely on errno's state here? */
-+#    define dlerror()	"unknown dl-error"
-+#  endif /* !__NetBSD__ */
-+#endif	/* LOCAL_HACK_G_MODULE_HAVE_DLERROR */
-+
-+/* some flags are missing on some systems, so we provide
-+ * harmless defaults.
-+ * The Perl sources say, RTLD_LAZY needs to be defined as (1),
-+ * at least for Solaris 1.
-+ *
-+ * Mandatory:
-+ * RTLD_LAZY   - resolve undefined symbols as code from the dynamic library
-+ *		 is executed.
-+ * RTLD_NOW    - resolve all undefined symbols before dlopen returns, and fail
-+ *		 if this cannot be done.
-+ * Optionally:
-+ * RTLD_GLOBAL - the external symbols defined in the library will be made
-+ *		 available to subsequently loaded libraries.
-+ */
-+#ifndef	RTLD_LAZY
-+#define	RTLD_LAZY	1
-+#endif	/* RTLD_LAZY */
-+#ifndef	RTLD_NOW
-+#define	RTLD_NOW	0
-+#endif	/* RTLD_NOW */
-+/* some systems (OSF1 V5.0) have broken RTLD_GLOBAL linkage */
-+#ifdef LOCAL_HACK_G_MODULE_BROKEN_RTLD_GLOBAL
-+#undef  RTLD_GLOBAL
-+#endif /* LOCAL_HACK_G_MODULE_BROKEN_RTLD_GLOBAL */
-+#ifndef	RTLD_GLOBAL
-+#define	RTLD_GLOBAL	0
-+#endif	/* RTLD_GLOBAL */
-+
-+
-+/* --- functions --- */
-+static gchar*
-+fetch_dlerror (void)
-+{
-+  gchar *msg = dlerror ();
-+
-+  /* make sure we always return an error message != NULL */
-+
-+  return msg ? msg : "unknown dl-error";
-+}
-+
-+static gpointer
-+_local_hack_g_module_open (const gchar *file_name,
-+		gboolean     bind_lazy)
-+{
-+  gpointer handle;
-+  
-+  handle = dlopen (file_name, (bind_lazy ? RTLD_LAZY : RTLD_NOW));
-+  if (!handle)
-+    local_hack_g_module_set_error (fetch_dlerror ());
-+  
-+  return handle;
-+}
-+
-+static gpointer
-+_local_hack_g_module_self (void)
-+{
-+  gpointer handle;
-+  
-+  /* to query symbols from the program itself, special link options
-+   * are required on some systems.
-+   */
-+  
-+  handle = dlopen (NULL, RTLD_LAZY);
-+  if (!handle)
-+    local_hack_g_module_set_error (fetch_dlerror ());
-+  
-+  return handle;
-+}
-+
-+static void
-+_local_hack_g_module_close (gpointer handle,
-+		 gboolean is_unref)
-+{
-+  /* are there any systems out there that have dlopen()/dlclose()
-+   * without a reference count implementation?
-+   */
-+  is_unref |= 1;
-+  
-+  if (is_unref)
-+    {
-+      if (dlclose (handle) != 0)
-+	local_hack_g_module_set_error (fetch_dlerror ());
-+    }
-+}
-+
-+static gpointer
-+_local_hack_g_module_symbol (gpointer     handle,
-+		  const gchar *symbol_name)
-+{
-+  gpointer p;
-+  
-+  p = dlsym (handle, symbol_name);
-+  if (!p)
-+    local_hack_g_module_set_error (fetch_dlerror ());
-+  
-+  return p;
-+}
-+
-+static gchar*
-+_local_hack_g_module_build_path (const gchar *directory,
-+		      const gchar *module_name)
-+{
-+  if (directory && *directory) {
-+    if (strncmp (module_name, "lib", 3) == 0)
-+      return g_strconcat (directory, "/", module_name, NULL);
-+    else
-+      return g_strconcat (directory, "/lib", module_name, ".so", NULL);
-+  } else if (strncmp (module_name, "lib", 3) == 0)
-+    return g_strdup (module_name);
-+  else
-+    return g_strconcat ("lib", module_name, ".so", NULL);
-+}
---- imlib-1.9.15.orig/gdk_imlib/local-hack-gmodule/gmodule-local.h
-+++ imlib-1.9.15/gdk_imlib/local-hack-gmodule/gmodule-local.h
-@@ -0,0 +1,100 @@
-+/* GMODULE - GLIB wrapper code for dynamic module loading
-+ * Copyright (C) 1998 Tim Janik
-+ *
-+ * This library is free software; you can redistribute it and/or
-+ * modify it under the terms of the GNU Library General Public
-+ * License as published by the Free Software Foundation; either
-+ * version 2 of the License, or (at your option) any later version.
-+ *
-+ * This library is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the GNU
-+ * Library General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Library General Public
-+ * License along with this library; if not, write to the
-+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-+ * Boston, MA 02111-1307, USA.
-+ */
-+
-+/*
-+ * Modified by the GLib Team and others 1997-1999.  See the AUTHORS
-+ * file for a list of people on the GLib Team.  See the ChangeLog
-+ * files for a list of changes.  These files are distributed with
-+ * GLib at ftp://ftp.gtk.org/pub/gtk/. 
-+ */
-+
-+#ifndef __GMODULE_H__
-+#define __GMODULE_H__
-+
-+#include <glib.h>
-+
-+#ifdef __cplusplus
-+extern "C" {
-+#endif /* __cplusplus */
-+
-+/* exporting and importing functions, this is special cased
-+ * to feature Windows dll stubs.
-+ */
-+#define	LOCAL_HACK_G_MODULE_IMPORT		extern
-+#ifdef NATIVE_WIN32
-+#  define	LOCAL_HACK_G_MODULE_EXPORT		__declspec(dllexport)
-+#else /* !NATIVE_WIN32 */
-+#  define	LOCAL_HACK_G_MODULE_EXPORT
-+#endif /* !NATIVE_WIN32 */
-+
-+typedef enum
-+{
-+  LOCAL_HACK_G_MODULE_BIND_LAZY	= 1 << 0,
-+  LOCAL_HACK_G_MODULE_BIND_MASK	= 0x01
-+} LocalHackGModuleFlags;
-+
-+typedef	struct _LocalHackGModule			 LocalHackGModule;
-+typedef const gchar* (*LocalHackGModuleCheckInit) (LocalHackGModule	*module);
-+typedef void	     (*LocalHackGModuleUnload)	 (LocalHackGModule	*module);
-+
-+/* return TRUE if dynamic module loading is supported */
-+gboolean	local_hack_g_module_supported	   (void);
-+
-+/* open a module `file_name' and return handle, which is NULL on error */
-+LocalHackGModule*	local_hack_g_module_open		   (const gchar		*file_name,
-+					    LocalHackGModuleFlags	 flags);
-+
-+/* close a previously opened module, returns TRUE on success */
-+gboolean	local_hack_g_module_close		   (LocalHackGModule		*module);
-+
-+/* make a module resident so local_hack_g_module_close on it will be ignored */
-+void		local_hack_g_module_make_resident	   (LocalHackGModule		*module);
-+
-+/* query the last module error as a string */
-+gchar*		local_hack_g_module_error		   (void);
-+
-+/* retrive a symbol pointer from `module', returns TRUE on success */
-+gboolean	local_hack_g_module_symbol		   (LocalHackGModule		*module,
-+					    const gchar		*symbol_name,
-+					    gpointer		*symbol);
-+
-+/* retrive the file name from an existing module */
-+gchar*		local_hack_g_module_name		   (LocalHackGModule		*module);
-+
-+
-+/* Build the actual file name containing a module. `directory' is the
-+ * directory where the module file is supposed to be, or NULL or empty
-+ * in which case it should either be in the current directory or, on
-+ * some operating systems, in some standard place, for instance on the
-+ * PATH. Hence, to be absoultely sure to get the correct module,
-+ * always pass in a directory. The file name consists of the directory,
-+ * if supplied, and `module_name' suitably decorated accoring to
-+ * the operating system's conventions (for instance lib*.so or *.dll).
-+ *
-+ * No checks are made that the file exists, or is of correct type.
-+ */
-+gchar*		local_hack_g_module_build_path	  (const gchar		*directory,
-+					   const gchar		*module_name);
-+
-+#ifdef __cplusplus
-+}
-+#endif /* __cplusplus */
-+
-+
-+#endif /* __GMODULE_H__ */
---- imlib-1.9.15.orig/gdk_imlib/local-hack-gmodule/gmoduleconf.h
-+++ imlib-1.9.15/gdk_imlib/local-hack-gmodule/gmoduleconf.h
-@@ -0,0 +1,45 @@
-+/* GMODULE - GLIB wrapper code for dynamic module loading
-+ * Copyright (C) 1998 Tim Janik
-+ *
-+ * This library is free software; you can redistribute it and/or
-+ * modify it under the terms of the GNU Library General Public
-+ * License as published by the Free Software Foundation; either
-+ * version 2 of the License, or (at your option) any later version.
-+ *
-+ * This library is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+ * Library General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Library General Public
-+ * License along with this library; if not, write to the
-+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-+ * Boston, MA 02111-1307, USA.
-+ */
-+#ifndef __LOCAL_HACK_G_MODULE_CONF_H__
-+#define __LOCAL_HACK_G_MODULE_CONF_H__
-+
-+
-+#ifdef __cplusplus
-+extern "C" {
-+#endif /* __cplusplus */
-+
-+
-+#define	LOCAL_HACK_G_MODULE_IMPL_NONE	0
-+#define	LOCAL_HACK_G_MODULE_IMPL_DL	1
-+#define	LOCAL_HACK_G_MODULE_IMPL_DLD	2
-+#define	LOCAL_HACK_G_MODULE_IMPL_WIN32	3
-+
-+#define	LOCAL_HACK_G_MODULE_IMPL		LOCAL_HACK_G_MODULE_IMPL_DL
-+#undef	LOCAL_HACK_G_MODULE_HAVE_DLERROR
-+#if	(1)
-+#define	LOCAL_HACK_G_MODULE_HAVE_DLERROR
-+#endif
-+
-+
-+#ifdef __cplusplus
-+}
-+#endif /* __cplusplus */
-+
-+
-+#endif /* __LOCAL_HACK_G_MODULE_CONF_H__ */
---- imlib-1.9.15.orig/gdk_imlib/local-hack-gmodule/gmodule-local.c
-+++ imlib-1.9.15/gdk_imlib/local-hack-gmodule/gmodule-local.c
-@@ -0,0 +1,418 @@
-+/* GMODULE - GLIB wrapper code for dynamic module loading
-+ * Copyright (C) 1998 Tim Janik
-+ *
-+ * This library is free software; you can redistribute it and/or
-+ * modify it under the terms of the GNU Library General Public
-+ * License as published by the Free Software Foundation; either
-+ * version 2 of the License, or (at your option) any later version.
-+ *
-+ * This library is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the GNU
-+ * Library General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Library General Public
-+ * License along with this library; if not, write to the
-+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-+ * Boston, MA 02111-1307, USA.
-+ */
-+
-+/*
-+ * Modified by the GLib Team and others 1997-1999.  See the AUTHORS
-+ * file for a list of people on the GLib Team.  See the ChangeLog
-+ * files for a list of changes.  These files are distributed with
-+ * GLib at ftp://ftp.gtk.org/pub/gtk/. 
-+ */
-+
-+/* 
-+ * MT safe
-+ */
-+
-+#include	"gmodule-local.h"
-+#include	"gmoduleconf.h"
-+#include	<errno.h>
-+#include	<string.h>
-+
-+
-+/* We maintain a list of modules, so we can reference count them.
-+ * That's needed because some platforms don't support refernce counts on
-+ * modules e.g. the shl_* implementation of HP-UX
-+ * (http://www.stat.umn.edu/~luke/xls/projects/dlbasics/dlbasics.html).
-+ * Also, the module for the program itself is kept seperatedly for
-+ * faster access and because it has special semantics.
-+ */
-+
-+
-+/* --- structures --- */
-+struct _LocalHackGModule
-+{
-+  gchar	*file_name;
-+  gpointer handle;
-+  guint ref_count : 31;
-+  guint is_resident : 1;
-+  LocalHackGModuleUnload unload;
-+  LocalHackGModule *next;
-+};
-+
-+
-+/* --- prototypes --- */
-+static gpointer		_local_hack_g_module_open		(const gchar	*file_name,
-+						 gboolean	 bind_lazy);
-+static void		_local_hack_g_module_close		(gpointer	 handle,
-+						 gboolean	 is_unref);
-+static gpointer		_local_hack_g_module_self		(void);
-+static gpointer		_local_hack_g_module_symbol	(gpointer	 handle,
-+						 const gchar	*symbol_name);
-+static gchar*		_local_hack_g_module_build_path	(const gchar	*directory,
-+						 const gchar	*module_name);
-+static inline void	local_hack_g_module_set_error	(const gchar	*error);
-+static inline LocalHackGModule*	local_hack_g_module_find_by_handle (gpointer	 handle);
-+static inline LocalHackGModule*	local_hack_g_module_find_by_name	(const gchar	*name);
-+
-+
-+/* --- variables --- */
-+G_LOCK_DEFINE_STATIC (LocalHackGModule);
-+static LocalHackGModule	     *modules = NULL;
-+static LocalHackGModule	     *main_module = NULL;
-+static GStaticPrivate module_error_private = G_STATIC_PRIVATE_INIT;
-+
-+
-+/* --- inline functions --- */
-+static inline LocalHackGModule*
-+local_hack_g_module_find_by_handle (gpointer handle)
-+{
-+  LocalHackGModule *module;
-+  LocalHackGModule *retval = NULL;
-+  
-+  G_LOCK (LocalHackGModule);
-+  if (main_module && main_module->handle == handle)
-+    retval = main_module;
-+  else
-+    for (module = modules; module; module = module->next)
-+      if (handle == module->handle)
-+	{
-+	  retval = module;
-+	  break;
-+	}
-+  G_UNLOCK (LocalHackGModule);
-+
-+  return retval;
-+}
-+
-+static inline LocalHackGModule*
-+local_hack_g_module_find_by_name (const gchar *name)
-+{
-+  LocalHackGModule *module;
-+  LocalHackGModule *retval = NULL;
-+  
-+  G_LOCK (LocalHackGModule);
-+  for (module = modules; module; module = module->next)
-+    if (strcmp (name, module->file_name) == 0)
-+	{
-+	  retval = module;
-+	  break;
-+	}
-+  G_UNLOCK (LocalHackGModule);
-+
-+  return retval;
-+}
-+
-+static inline void
-+local_hack_g_module_set_error (const gchar *error)
-+{
-+  g_static_private_set (&module_error_private, g_strdup (error), g_free);
-+  errno = 0;
-+}
-+
-+
-+/* --- include platform specifc code --- */
-+#define	SUPPORT_OR_RETURN(rv)	{ local_hack_g_module_set_error (NULL); }
-+#if	(LOCAL_HACK_G_MODULE_IMPL == LOCAL_HACK_G_MODULE_IMPL_DL)
-+#include "gmodule-dl.c"
-+#elif	(LOCAL_HACK_G_MODULE_IMPL == LOCAL_HACK_G_MODULE_IMPL_DLD)
-+#include "gmodule-dld.c"
-+#elif	(LOCAL_HACK_G_MODULE_IMPL == LOCAL_HACK_G_MODULE_IMPL_WIN32)
-+#include "gmodule-win32.c"
-+#else
-+#undef	SUPPORT_OR_RETURN
-+#define	SUPPORT_OR_RETURN(rv)	{ local_hack_g_module_set_error ("dynamic modules are " \
-+                                              "not supported by this system"); return rv; }
-+static gpointer
-+_local_hack_g_module_open (const gchar	*file_name,
-+		gboolean	 bind_lazy)
-+{
-+  return NULL;
-+}
-+static void
-+_local_hack_g_module_close	(gpointer	 handle,
-+		 gboolean	 is_unref)
-+{
-+}
-+static gpointer
-+_local_hack_g_module_self (void)
-+{
-+  return NULL;
-+}
-+static gpointer
-+_local_hack_g_module_symbol (gpointer	 handle,
-+		  const gchar	*symbol_name)
-+{
-+  return NULL;
-+}
-+static gchar*
-+_local_hack_g_module_build_path (const gchar *directory,
-+		      const gchar *module_name)
-+{
-+  return NULL;
-+}
-+#endif	/* no implementation */
-+
-+#if defined (NATIVE_WIN32) && defined (__LCC__)
-+int __stdcall 
-+LibMain (void         *hinstDll,
-+	 unsigned long dwReason,
-+	 void         *reserved)
-+{
-+  return 1;
-+}
-+#endif /* NATIVE_WIN32 && __LCC__ */
-+
-+
-+/* --- functions --- */
-+gboolean
-+local_hack_g_module_supported (void)
-+{
-+  SUPPORT_OR_RETURN (FALSE);
-+  
-+  return TRUE;
-+}
-+
-+LocalHackGModule*
-+local_hack_g_module_open (const gchar    *file_name,
-+	       LocalHackGModuleFlags    flags)
-+{
-+  LocalHackGModule *module;
-+  gpointer handle;
-+  
-+  SUPPORT_OR_RETURN (NULL);
-+  
-+  if (!file_name)
-+    {      
-+      G_LOCK (LocalHackGModule);
-+      if (!main_module)
-+	{
-+	  handle = _local_hack_g_module_self ();
-+	  if (handle)
-+	    {
-+	      main_module = g_new (LocalHackGModule, 1);
-+	      main_module->file_name = NULL;
-+	      main_module->handle = handle;
-+	      main_module->ref_count = 1;
-+	      main_module->is_resident = TRUE;
-+	      main_module->unload = NULL;
-+	      main_module->next = NULL;
-+	    }
-+	}
-+      G_UNLOCK (LocalHackGModule);
-+
-+      return main_module;
-+    }
-+  
-+  /* we first search the module list by name */
-+  module = local_hack_g_module_find_by_name (file_name);
-+  if (module)
-+    {
-+      module->ref_count++;
-+      
-+      return module;
-+    }
-+  
-+  /* open the module */
-+  handle = _local_hack_g_module_open (file_name, (flags & LOCAL_HACK_G_MODULE_BIND_LAZY) != 0);
-+  if (handle)
-+    {
-+      gchar *saved_error;
-+      LocalHackGModuleCheckInit check_init;
-+      const gchar *check_failed = NULL;
-+      
-+      /* search the module list by handle, since file names are not unique */
-+      module = local_hack_g_module_find_by_handle (handle);
-+      if (module)
-+	{
-+	  _local_hack_g_module_close (module->handle, TRUE);
-+	  module->ref_count++;
-+	  local_hack_g_module_set_error (NULL);
-+	  
-+	  return module;
-+	}
-+      
-+      saved_error = g_strdup (local_hack_g_module_error ());
-+      local_hack_g_module_set_error (NULL);
-+      
-+      module = g_new (LocalHackGModule, 1);
-+      module->file_name = g_strdup (file_name);
-+      module->handle = handle;
-+      module->ref_count = 1;
-+      module->is_resident = FALSE;
-+      module->unload = NULL;
-+      G_LOCK (LocalHackGModule);
-+      module->next = modules;
-+      modules = module;
-+      G_UNLOCK (LocalHackGModule);
-+      
-+      /* check initialization */
-+      if (local_hack_g_module_symbol (module, "local_hack_g_module_check_init", (gpointer) &check_init))
-+	check_failed = check_init (module);
-+      
-+      /* we don't call unload() if the initialization check failed. */
-+      if (!check_failed)
-+	local_hack_g_module_symbol (module, "local_hack_g_module_unload", (gpointer) &module->unload);
-+      
-+      if (check_failed)
-+	{
-+	  gchar *error;
-+
-+	  error = g_strconcat ("LocalHackGModule initialization check failed: ", check_failed, NULL);
-+	  local_hack_g_module_close (module);
-+	  module = NULL;
-+	  local_hack_g_module_set_error (error);
-+	  g_free (error);
-+	}
-+      else
-+	local_hack_g_module_set_error (saved_error);
-+
-+      g_free (saved_error);
-+    }
-+  
-+  return module;
-+}
-+
-+gboolean
-+local_hack_g_module_close (LocalHackGModule	       *module)
-+{
-+  SUPPORT_OR_RETURN (FALSE);
-+  
-+  g_return_val_if_fail (module != NULL, FALSE);
-+  g_return_val_if_fail (module->ref_count > 0, FALSE);
-+  
-+  module->ref_count--;
-+  
-+  if (!module->ref_count && !module->is_resident && module->unload)
-+    {
-+      LocalHackGModuleUnload unload;
-+
-+      unload = module->unload;
-+      module->unload = NULL;
-+      unload (module);
-+    }
-+
-+  if (!module->ref_count && !module->is_resident)
-+    {
-+      LocalHackGModule *last;
-+      LocalHackGModule *node;
-+      
-+      last = NULL;
-+      
-+      G_LOCK (LocalHackGModule);
-+      node = modules;
-+      while (node)
-+	{
-+	  if (node == module)
-+	    {
-+	      if (last)
-+		last->next = node->next;
-+	      else
-+		modules = node->next;
-+	      break;
-+	    }
-+	  last = node;
-+	  node = last->next;
-+	}
-+      module->next = NULL;
-+      G_UNLOCK (LocalHackGModule);
-+      
-+      _local_hack_g_module_close (module->handle, FALSE);
-+      g_free (module->file_name);
-+      
-+      g_free (module);
-+    }
-+  
-+  return local_hack_g_module_error() == NULL;
-+}
-+
-+void
-+local_hack_g_module_make_resident (LocalHackGModule *module)
-+{
-+  g_return_if_fail (module != NULL);
-+
-+  module->is_resident = TRUE;
-+}
-+
-+gchar*
-+local_hack_g_module_error (void)
-+{
-+  return g_static_private_get (&module_error_private);
-+}
-+
-+gboolean
-+local_hack_g_module_symbol (LocalHackGModule	*module,
-+		 const gchar	*symbol_name,
-+		 gpointer	*symbol)
-+{
-+  gchar *module_error;
-+
-+  if (symbol)
-+    *symbol = NULL;
-+  SUPPORT_OR_RETURN (FALSE);
-+  
-+  g_return_val_if_fail (module != NULL, FALSE);
-+  g_return_val_if_fail (symbol_name != NULL, FALSE);
-+  g_return_val_if_fail (symbol != NULL, FALSE);
-+  
-+#ifdef	LOCAL_HACK_G_MODULE_NEED_USCORE
-+  {
-+    gchar *name;
-+
-+    name = g_strconcat ("_", symbol_name, NULL);
-+    *symbol = _local_hack_g_module_symbol (module->handle, name);
-+    g_free (name);
-+  }
-+#else	/* !LOCAL_HACK_G_MODULE_NEED_USCORE */
-+  *symbol = _local_hack_g_module_symbol (module->handle, symbol_name);
-+#endif	/* !LOCAL_HACK_G_MODULE_NEED_USCORE */
-+  
-+  module_error = local_hack_g_module_error ();
-+  if (module_error)
-+    {
-+      gchar *error;
-+
-+      error = g_strconcat ("`", symbol_name, "': ", module_error, NULL);
-+      local_hack_g_module_set_error (error);
-+      g_free (error);
-+      *symbol = NULL;
-+
-+      return FALSE;
-+    }
-+  
-+  return TRUE;
-+}
-+
-+gchar*
-+local_hack_g_module_name (LocalHackGModule *module)
-+{
-+  g_return_val_if_fail (module != NULL, NULL);
-+  
-+  if (module == main_module)
-+    return "main";
-+  
-+  return module->file_name;
-+}
-+
-+gchar*
-+local_hack_g_module_build_path (const gchar *directory,
-+		     const gchar *module_name)
-+{
-+  g_return_val_if_fail (module_name != NULL, NULL);
-+  
-+  return _local_hack_g_module_build_path (directory, module_name);
-+}
-
diff --git a/freebsd/dependencies/imlib/files/patch-imlib-config.diff b/freebsd/dependencies/imlib/files/patch-imlib-config.diff
deleted file mode 100644
index ad1a076d0..000000000
--- a/freebsd/dependencies/imlib/files/patch-imlib-config.diff
+++ /dev/null
@@ -1,28 +0,0 @@
---- imlib-1.9.15.orig/imlib-config.in
-+++ imlib-1.9.15/imlib-config.in
-@@ -49,21 +49,21 @@
-       if test @includedir@ != /usr/include ; then
-         includes=-I@includedir@
-       fi
--      echo $includes @X_CFLAGS@ 
-+      echo $includes
-       ;;
-     --cflags-gdk)
-       if test @includedir@ != /usr/include ; then
-         includes=-I@includedir@
-       fi
--      echo `@GTK_CONFIG@ --cflags` $includes @X_CFLAGS@
-+      echo `@GTK_CONFIG@ --cflags` $includes
-       ;;
-     --libs)
-       libdirs=-L@libdir@
--      echo $libdirs -lImlib @LDFLAGS@ $gx_libs @X_LIBS@ @X_PRE_LIBS@ -lXext -lX11 @X_EXTRA_LIBS@
-+      echo $libdirs -lImlib 
-       ;;
-     --libs-gdk)
-       libdirs=-L@libdir@
--      echo $libdirs -lgdk_imlib$gdk_gx_libs `@GTK_CONFIG@ --libs` $gdk_libs
-+      echo $libdirs -lgdk_imlib
-       ;;
-     *)
-       echo "${usage}" 1>&2
diff --git a/freebsd/dependencies/imlib/files/patch-imlib-m4.diff b/freebsd/dependencies/imlib/files/patch-imlib-m4.diff
deleted file mode 100644
index d40a3a6c5..000000000
--- a/freebsd/dependencies/imlib/files/patch-imlib-m4.diff
+++ /dev/null
@@ -1,32 +0,0 @@
---- imlib-1.9.15.orig/imlib.m4
-+++ imlib-1.9.15/imlib.m4
-@@ -6,7 +6,7 @@
- dnl AM_PATH_IMLIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
- dnl Test for IMLIB, and define IMLIB_CFLAGS and IMLIB_LIBS
- dnl
--AC_DEFUN(AM_PATH_IMLIB,
-+AC_DEFUN([AM_PATH_IMLIB],
- [dnl 
- dnl Get the cflags and libraries from the imlib-config script
- dnl
-@@ -164,7 +164,7 @@
- ])
- 
- # Check for gdk-imlib
--AC_DEFUN(AM_PATH_GDK_IMLIB,
-+AC_DEFUN([AM_PATH_GDK_IMLIB],
- [dnl 
- dnl Get the cflags and libraries from the imlib-config script
- dnl
-@@ -291,8 +291,8 @@
-           LIBS="$ac_save_LIBS"
-        fi
-      fi
--     IMLIB_CFLAGS=""
--     IMLIB_LIBS=""
-+     GDK_IMLIB_CFLAGS=""
-+     GDK_IMLIB_LIBS=""
-      ifelse([$3], , :, [$3])
-   fi
-   AC_SUBST(GDK_IMLIB_CFLAGS)
-
diff --git a/freebsd/dependencies/imlib/files/patch-link-against-x11.diff b/freebsd/dependencies/imlib/files/patch-link-against-x11.diff
deleted file mode 100644
index 25cdac17c..000000000
--- a/freebsd/dependencies/imlib/files/patch-link-against-x11.diff
+++ /dev/null
@@ -1,16 +0,0 @@
---- imlib-1.9.15.orig/Imlib/Makefile.am
-+++ imlib-1.9.15/Imlib/Makefile.am
-@@ -30,10 +30,10 @@
- 	save.c		\
- 	snprintf.c
- 
--libImlib_la_LDFLAGS    = -version-info 10:15:9
-+libImlib_la_LDFLAGS    = -version-info 11:0:0
- #libImlib_la_LDDADD     = $(SUPPORT_LIBS)
- libImlib_la_LIBADD     = $(SUPPORT_LIBS) $(X_PRE_LIBS) \
--			 $(X_LIBS) $(X_EXTRA_LIBS)
-+			 $(X_LIBS) $(X_EXTRA_LIBS) -lX11
- 
- DEFS =  -DSYSTEM_IMRC=\"$(sysconfdir)/imrc\" \
- 	-DSYSCONFDIR=\"$(sysconfdir)\"
-
diff --git a/freebsd/dependencies/imlib/files/patch-png1.5.diff b/freebsd/dependencies/imlib/files/patch-png1.5.diff
deleted file mode 100644
index c40192493..000000000
--- a/freebsd/dependencies/imlib/files/patch-png1.5.diff
+++ /dev/null
@@ -1,80 +0,0 @@
---- a/gdk_imlib/io-png.c	2002-03-04 18:06:29.000000000 +0100
-+++ b/gdk_imlib/io-png.c	2012-04-24 23:11:43.000000000 +0200
-@@ -40,7 +41,7 @@
-       return NULL;
-     }
- 
--  if (setjmp(png_ptr->jmpbuf))
-+  if (setjmp(png_jmpbuf(png_ptr)))
-     {
-       png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
-       return NULL;
-@@ -275,7 +276,7 @@
-       return NULL;
-     }
-   
--  if (setjmp(png_ptr->jmpbuf))
-+  if (setjmp(png_jmpbuf(png_ptr)))
-     {
-       png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
-       return NULL;
-@@ -440,7 +441,7 @@
- 		return NULL;
- 	}
- 	
--	if (setjmp(png_ptr->jmpbuf))
-+	if (setjmp(png_jmpbuf(png_ptr)))
- 	{
- 		png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
- 		return NULL;
-@@ -635,7 +636,7 @@
- 	      png_destroy_write_struct(&png_ptr, (png_infopp) NULL);
- 	      return 0;
- 	    }
--	  if (setjmp(png_ptr->jmpbuf))
-+	  if (setjmp(png_jmpbuf(png_ptr)))
- 	    {
- 	      fclose(f);
- 	      png_destroy_write_struct(&png_ptr, (png_infopp) NULL);
---- a/Imlib/load.c	2004-09-21 02:23:20.000000000 +0200
-+++ b/Imlib/load.c	2010-03-28 16:23:13.000000000 +0200
-@@ -192,7 +198,7 @@
-       png_destroy_read_struct(&png_ptr, NULL, NULL);
-       return NULL;
-     }
--  if (setjmp(png_ptr->jmpbuf))
-+  if (setjmp(png_jmpbuf(png_ptr)))
-     {
-       png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
-       return NULL;
-@@ -1619,7 +1619,7 @@
-     return 0;
-   fread(buf, 1, 8, f);
-   rewind(f);
--  return (int)png_check_sig(buf, 8);
-+  return (int)!png_sig_cmp(buf, 0, 8);
- #else
-   return 0;
- #endif
---- a/Imlib/save.c	2004-09-21 02:22:59.000000000 +0200
-+++ b/Imlib/save.c	2012-04-27 07:19:57.000000000 +0200
-@@ -342,7 +342,7 @@
- 	      png_destroy_write_struct(&png_ptr, (png_infopp) NULL);
- 	      return 0;
- 	    }
--	  if (setjmp(png_ptr->jmpbuf))
-+	  if (setjmp(png_jmpbuf(png_ptr)))
- 	    {
- 	      fclose(f);
- 	      png_destroy_write_struct(&png_ptr, (png_infopp) NULL);
---- a/Imlib/utils.c	2012-04-27 07:12:19.000000000 +0200
-+++ b/Imlib/utils.c	2012-04-27 07:15:39.000000000 +0200
-@@ -1982,7 +1983,7 @@
-       return NULL;
-     }
-   
--  if (setjmp(png_ptr->jmpbuf))
-+  if (setjmp(png_jmpbuf(png_ptr)))
-     {
-       png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
-       return NULL;
diff --git a/freebsd/dependencies/imlib/files/patch-png1.6.diff b/freebsd/dependencies/imlib/files/patch-png1.6.diff
deleted file mode 100644
index b5e2f6324..000000000
--- a/freebsd/dependencies/imlib/files/patch-png1.6.diff
+++ /dev/null
@@ -1,36 +0,0 @@
-diff -ru a/Imlib/load.c b/Imlib/load.c
---- a/Imlib/load.c	2015-06-21 03:21:07.000000000 +0200
-+++ b/Imlib/load.c	2015-06-21 03:16:28.000000000 +0200
-@@ -196,7 +196,7 @@
-       png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
-       return NULL;
-     }
--  if (info_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
-+  if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_RGB_ALPHA)
-     {
-       png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
-       return NULL;
-diff -ru a/Imlib/utils.c b/Imlib/utils.c
---- a/Imlib/utils.c	2015-06-21 03:21:07.000000000 +0200
-+++ b/Imlib/utils.c	2015-06-21 03:16:20.000000000 +0200
-@@ -1965,7 +1965,7 @@
-       return NULL;
-     }
-   
--  if (info_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
-+  if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_RGB_ALPHA)
-     {
-       png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
-       return NULL;
-diff -ru a/gdk_imlib/io-png.c b/gdk_imlib/io-png.c
---- a/gdk_imlib/io-png.c	2015-06-21 03:21:07.000000000 +0200
-+++ b/gdk_imlib/io-png.c	2015-06-21 03:16:37.000000000 +0200
-@@ -46,7 +46,7 @@
-       return NULL;
-     }
- 
--  if (info_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
-+  if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_RGB_ALPHA)
-     {
-       png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
-       return NULL;
diff --git a/freebsd/dependencies/imlib/files/patch-remove-register-instruction.diff b/freebsd/dependencies/imlib/files/patch-remove-register-instruction.diff
deleted file mode 100644
index acfded4b4..000000000
--- a/freebsd/dependencies/imlib/files/patch-remove-register-instruction.diff
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/Imlib/utils.c
-+++ b/Imlib/utils.c
-@@ -455,7 +455,7 @@ void
- Imlib_bevel_image(ImlibData *id, ImlibImage *im, ImlibBorder *bord, 
- 		  unsigned char up)
- {
--  register unsigned char *ptr;
-+  unsigned char *ptr;
-   double v;
-   int x, y, xbound, ybound;
- 
diff --git a/freebsd/dependencies/imlib/files/patch-search-system-include-for-xshm.diff b/freebsd/dependencies/imlib/files/patch-search-system-include-for-xshm.diff
deleted file mode 100644
index 47271a097..000000000
--- a/freebsd/dependencies/imlib/files/patch-search-system-include-for-xshm.diff
+++ /dev/null
@@ -1,14 +0,0 @@
---- imlib-1.9.15.orig/configure.in
-+++ imlib-1.9.15/configure.in
-@@ -197,7 +197,9 @@
-     AC_MSG_RESULT(no)
-     no_xshm=yes
-   else
--    if test -f "$x_includes/X11/extensions/XShm.h"; then
-+    if test -f "$x_includes/X11/extensions/XShm.h" || \
-+       test -f "/usr/include/X11/extensions/XShm.h" || \
-+       test -f "/usr/local/include/X11/extensions/XShm.h"; then
-       AC_MSG_RESULT(yes)
-       AC_DEFINE(HAVE_XSHM_H, 1, [ ])
-     else
-
diff --git a/freebsd/dependencies/imlib/pkg-descr b/freebsd/dependencies/imlib/pkg-descr
deleted file mode 100644
index 236661985..000000000
--- a/freebsd/dependencies/imlib/pkg-descr
+++ /dev/null
@@ -1,4 +0,0 @@
-Imlib is a general Image loading and rendering library designed to make the
-task of loading images, and obtaining X-Windows drawables a simple task, as
-well as a quick one. It also aims to provide simple manipulation routines that
-might be desired for common operations.
diff --git a/freebsd/dependencies/imlib/pkg-plist b/freebsd/dependencies/imlib/pkg-plist
deleted file mode 100644
index 148cd8fa4..000000000
--- a/freebsd/dependencies/imlib/pkg-plist
+++ /dev/null
@@ -1,16 +0,0 @@
-bin/imlib-config
-%%ETCDIR%%/im_palette-small.pal
-%%ETCDIR%%/im_palette-tiny.pal
-%%ETCDIR%%/im_palette.pal
-%%ETCDIR%%/imrc
-include/Imlib.h
-include/Imlib_private.h
-include/Imlib_types.h
-lib/libImlib.a
-lib/libImlib.so
-lib/libImlib.so.11
-lib/libImlib.so.11.0.0
-libdata/pkgconfig/imlib.pc
-libdata/pkgconfig/imlibgdk.pc
-share/aclocal/imlib.m4
-share/man/man1/imlib-config.1.gz
diff --git a/freebsd/metapackages/meta-tde/Makefile b/freebsd/metapackages/meta-tde/Makefile
index 8eab1d6f5..42faa73ab 100644
--- a/freebsd/metapackages/meta-tde/Makefile
+++ b/freebsd/metapackages/meta-tde/Makefile
@@ -38,7 +38,6 @@ RUN_DEPENDS +=	dbus-tqt>=0:devel/dbus-tqt
 RUN_DEPENDS +=	dbus-1-tqt>=0:devel/dbus-1-tqt
 RUN_DEPENDS +=	polkit-tqt>=0:sysutils/polkit-tqt
 
-RUN_DEPENDS +=	imlib>=0:graphics/imlib
 RUN_DEPENDS +=	libart_lgpl>=0:graphics/libart_lgpl-trinity
 RUN_DEPENDS +=	libcaldav>=0:devel/libcaldav
 RUN_DEPENDS +=	libcarddav>=0:devel/libcarddav
-- 
cgit v1.2.3

