1{ stdenv, fetchurl, fetchpatch }:
2
3stdenv.mkDerivation rec {
4 name = "libfpx-1.3.1-7";
5
6 src = fetchurl {
7 url = "mirror://imagemagick/delegates/${name}.tar.xz";
8 sha256 = "1s28mwb06w6dj0zl6ashpj8m1qiyadawzl7cvbw7dmj1w39ipghh";
9 };
10
11 # Darwin gets misdetected as Windows without this
12 NIX_CFLAGS_COMPILE = if stdenv.isDarwin then "-D__unix" else null;
13
14 patches = [
15 (fetchpatch {
16 url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/media-libs/libfpx/files/libfpx-1.3.1_p6-gcc6.patch?id=f28a947813dbc0a1fd1a8d4a712d58a64c48ca01";
17 sha256 = "032y8110zgnkdhkdq3745zk53am1x34d912rai8q70k3sskyq22p";
18 })
19 ];
20
21 # This dead code causes a duplicate symbol error in Clang so just remove it
22 postPatch = if stdenv.cc.isClang then ''
23 substituteInPlace jpeg/ejpeg.h --replace "int No_JPEG_Header_Flag" ""
24 '' else null;
25
26 meta = with stdenv.lib; {
27 homepage = http://www.imagemagick.org;
28 description = "A library for manipulating FlashPIX images";
29 license = "Flashpix";
30 platforms = platforms.all;
31 maintainers = with maintainers; [ wkennington ];
32 };
33}