@@ -1,5 +1,6 @@
1−{ lib, stdenv, fetchurl, fetchpatch, autoreconfHook, giflib, libjpeg, libpng, zlib
2−, static ? stdenv.hostPlatform.isStatic }:
1+{ lib, stdenv, fetchurl, fetchpatch, autoreconfHook, giflib, libjpeg, libpng, libX11, zlib
2+, static ? stdenv.hostPlatform.isStatic
3+, withX ? !stdenv.isDarwin }:
34
45stdenv.mkDerivation {
56 pname = "libAfterImage";
@@ -47,7 +48,7 @@ stdenv.mkDerivation {
4748 patchFlags = [ "-p0" ];
4849
4950 nativeBuildInputs = [ autoreconfHook ];
50− buildInputs = [ giflib libjpeg libpng zlib ];
51+ buildInputs = [ giflib libjpeg libpng zlib ] ++ lib.optional withX libX11;
5152
5253 preConfigure = ''
5354 rm -rf {libjpeg,libpng,libungif,zlib}/
@@ -63,7 +64,7 @@ stdenv.mkDerivation {
6364 "--disable-mmx-optimization"
6465 "--${if static then "enable" else "disable"}-staticlibs"
6566 "--${if !static then "enable" else "disable"}-sharedlibs"
66− ];
67+ ] ++ lib.optional withX "--with-x";
6768
6869 meta = with lib; {
6970 homepage = "http://www.afterstep.org/afterimage/";