sxiv: update to 1.3-git and fix runtime behaviour

The fix involves using imlib2 built with giflib instead of a libungif.
Initially I split imlib2 into two but other distros seem to build imlib2
with giflib already and everything still builds with giflib version so I
migrated imlib2 to giflib all together.

Closes #4622
This commit is contained in:
Mateusz Kowalczyk
2014-11-03 23:03:51 +00:00
parent 7c605db462
commit de96fb7cc7
5 changed files with 83 additions and 41 deletions
@@ -1,4 +1,4 @@
{ stdenv, fetchurl, x11, libjpeg, libtiff, libungif, libpng, bzip2, pkgconfig }:
{ stdenv, fetchurl, x11, libjpeg, libtiff, giflib, libpng, bzip2, pkgconfig }:
stdenv.mkDerivation rec {
name = "imlib2-1.4.6";
@@ -8,10 +8,14 @@ stdenv.mkDerivation rec {
sha256 = "0x1j0ylpclkp8cfpwfpkjywqz124bqskyxbw8pvwzkv2gmrbwldg";
};
buildInputs = [ x11 libjpeg libtiff libungif libpng bzip2 ];
buildInputs = [ x11 libjpeg libtiff giflib libpng bzip2 ];
nativeBuildInputs = [ pkgconfig ];
# From
# https://github.com/PhantomX/slackbuilds/blob/master/imlib2/patches/imlib2-giflib51.patch
patches = [ ./giflib51.patch ];
preConfigure = ''
substituteInPlace imlib2-config.in \
--replace "@my_libs@" ""
@@ -0,0 +1,64 @@
diff -ruN imlib2-1.4.6.orig/src/modules/loaders/loader_gif.c imlib2-1.4.6/src/modules/loaders/loader_gif.c
--- imlib2-1.4.6.orig/src/modules/loaders/loader_gif.c 2013-12-21 10:16:10.000000000 +0000
+++ imlib2-1.4.6/src/modules/loaders/loader_gif.c 2014-05-27 09:52:35.857291512 +0000
@@ -36,7 +36,7 @@
#endif
if (fd < 0)
return 0;
- gif = DGifOpenFileHandle(fd);
+ gif = DGifOpenFileHandle(fd, NULL);
if (!gif)
{
close(fd);
@@ -60,13 +60,13 @@
h = gif->Image.Height;
if (!IMAGE_DIMENSIONS_OK(w, h))
{
- DGifCloseFile(gif);
+ DGifCloseFile(gif, NULL);
return 0;
}
rows = malloc(h * sizeof(GifRowType *));
if (!rows)
{
- DGifCloseFile(gif);
+ DGifCloseFile(gif, NULL);
return 0;
}
for (i = 0; i < h; i++)
@@ -78,7 +78,7 @@
rows[i] = malloc(w * sizeof(GifPixelType));
if (!rows[i])
{
- DGifCloseFile(gif);
+ DGifCloseFile(gif, NULL);
for (i = 0; i < h; i++)
{
if (rows[i])
@@ -150,7 +150,7 @@
im->data = (DATA32 *) malloc(sizeof(DATA32) * w * h);
if (!im->data)
{
- DGifCloseFile(gif);
+ DGifCloseFile(gif, NULL);
free(rows);
return 0;
}
@@ -181,7 +181,7 @@
last_per = (int)per;
if (!(progress(im, (int)per, 0, last_y, w, i)))
{
- DGifCloseFile(gif);
+ DGifCloseFile(gif, NULL);
for (i = 0; i < h; i++)
{
free(rows[i]);
@@ -198,7 +198,7 @@
{
progress(im, 100, 0, last_y, w, h);
}
- DGifCloseFile(gif);
+ DGifCloseFile(gif, NULL);
for (i = 0; i < h; i++)
{
free(rows[i]);