btrbk: add mainProgram (#356350)
[NixPkgs.git] / pkgs / by-name / li / libfpx / package.nix
blob82785a4d0fb8b76c00a0495079c81851543e86d1
1 { lib, stdenv, fetchurl, fetchpatch }:
3 stdenv.mkDerivation rec {
4   pname = "libfpx";
5   version = "1.3.1-7";
7   src = fetchurl {
8     url = "mirror://imagemagick/delegates/${pname}-${version}.tar.xz";
9     sha256 = "1s28mwb06w6dj0zl6ashpj8m1qiyadawzl7cvbw7dmj1w39ipghh";
10   };
12   # Darwin gets misdetected as Windows without this
13   env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-D__unix";
15   patches = [
16     (fetchpatch {
17       url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/media-libs/libfpx/files/libfpx-1.3.1_p6-gcc6.patch?id=f28a947813dbc0a1fd1a8d4a712d58a64c48ca01";
18       sha256 = "032y8110zgnkdhkdq3745zk53am1x34d912rai8q70k3sskyq22p";
19     })
20     # Pull upstream fix for -fno-common:
21     #  https://github.com/ImageMagick/libfpx/pull/1
22     (fetchpatch {
23       name = "fno-common.patch";
24       url = "https://github.com/ImageMagick/libfpx/commit/c32b340581ba6c88c5092f374f655c7579b598a6.patch";
25       sha256 = "1gbc0qb2ri1mj9r66wx0yn28fsr7zhhlyz2mwbica8wh34xijgz9";
26     })
27     # fix clang build: remove register keyword
28     # remove on next update
29     (fetchpatch {
30       name = "remove-register-keyword.patch";
31       url = "https://github.com/ImageMagick/libfpx/commit/5f340b0a490450b40302cc9948c7dfac60d40041.patch";
32       hash = "sha256-6m9MFb1eWGK5cMvPmTu7uh3Pac65r2HPB8wJ8xc1O5o=";
33     })
34   ];
36   meta = with lib; {
37     homepage = "http://www.imagemagick.org";
38     description = "Library for manipulating FlashPIX images";
39     license = "Flashpix";
40     platforms = platforms.all;
41   };