1 { lib, stdenv, fetchurl, fetchpatch, autoreconfHook, giflib, libjpeg, libpng, libX11, zlib
2 , static ? stdenv.hostPlatform.isStatic
3 , withX ? !stdenv.isDarwin }:
6 pname = "libAfterImage";
10 name = "libAfterImage-1.20.tar.bz2";
12 "https://sourceforge.net/projects/afterstep/files/libAfterImage/1.20/libAfterImage-1.20.tar.bz2/download"
13 "ftp://ftp.afterstep.org/stable/libAfterImage/libAfterImage-1.20.tar.bz2"
15 sha256 = "0n74rxidwig3yhr6fzxsk7y19n1nq1f296lzrvgj5pfiyi9k48vf";
19 # add back --with-gif option
21 name = "libafterimage-gif.patch";
22 url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/media-libs/libafterimage/files/libafterimage-gif.patch?id=4aa4fca00611b0b3a4007870da43cc5fd63f76c4";
23 sha256 = "16pa94wlqpd7h6mzs4f0qm794yk1xczrwsgf93kdd3g0zbjq3rnr";
26 # fix build with newer giflib
28 name = "libafterimage-giflib5-v2.patch";
29 url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/media-libs/libafterimage/files/libafterimage-giflib5-v2.patch?id=4aa4fca00611b0b3a4007870da43cc5fd63f76c4";
30 sha256 = "0qwydqy9bm73cg5n3vm97aj4jfi70p7fxqmfbi54vi78z593brln";
34 # fix build with newer libpng
36 name = "libafterimage-libpng15.patch";
37 url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/media-libs/libafterimage/files/libafterimage-libpng15.patch?id=4aa4fca00611b0b3a4007870da43cc5fd63f76c4";
38 sha256 = "1qyvf7786hayasfnnilfbri3p99cfz5wjpbli3gdqj2cvk6mpydv";
41 # fix an ldconfig problem
43 name = "libafterimage-makefile.patch";
44 url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/media-libs/libafterimage/files/libafterimage-makefile.in.patch?id=4aa4fca00611b0b3a4007870da43cc5fd63f76c4";
45 sha256 = "1n6fniz6dldms615046yhc4mlg9gb53y4yfia8wfz6szgq5zicj4";
48 # Fix build failure against binutils-2.36:
49 # https://sourceforge.net/p/afterstep/bugs/5/
51 name = "binutils-2.36.patch";
52 url = "https://sourceforge.net/p/afterstep/bugs/5/attachment/libafterimage-binutils-2.36-support.patch";
53 sha256 = "1cfgm2ffwlsmhvvfmrxlglddaigr99k88d5xqva9pkl3mmzy3jym";
54 # workaround '-p0' patchflags below.
58 # fix https://github.com/root-project/root/issues/10990
60 url = "https://github.com/root-project/root/pull/11243/commits/e177a477b0be05ef139094be1e96a99ece06350a.diff";
61 hash = "sha256-2DQmJGHmATHawl3dk9dExncVe1sXzJQyy4PPwShoLTY=";
65 patchFlags = [ "-p0" ];
67 nativeBuildInputs = [ autoreconfHook ];
68 buildInputs = [ giflib libjpeg libpng zlib ] ++ lib.optional withX libX11;
71 rm -rf {libjpeg,libpng,libungif,zlib}/
72 substituteInPlace Makefile.in \
73 --replace "include .depend" ""
74 '' + lib.optionalString stdenv.isDarwin ''
75 substituteInPlace Makefile.in \
76 --replace "-soname," "-install_name,$out/lib/"
81 "--disable-mmx-optimization"
82 "--${if static then "enable" else "disable"}-staticlibs"
83 "--${if !static then "enable" else "disable"}-sharedlibs"
84 "--${if withX then "with" else "without"}-x"
87 env = lib.optionalAttrs stdenv.cc.isClang {
88 NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration";
92 homepage = "http://www.afterstep.org/afterimage/";
93 description = "A generic image manipulation library";
94 platforms = platforms.unix;
95 maintainers = [ maintainers.veprbl ];
96 license = licenses.lgpl21;