linux_xanmod: 5.11.14 -> 5.11.15
[NixPkgs.git] / pkgs / development / libraries / kissfft / default.nix
blobfe52adfa20d7012fb4c462bef9ebf914909899b3
1 { lib, stdenv
2 , fetchFromGitHub
3 , fetchpatch
4 }:
6 stdenv.mkDerivation rec {
7   pname = "kissfft";
8   version = "131";
10   src = fetchFromGitHub {
11     owner = "mborgerding";
12     repo = pname;
13     rev = "v${version}";
14     sha256 = "0axmqav2rclw02mix55cch9xl5py540ac15xbmq7xq6n3k492ng2";
15   };
17   patches = [
18     # Allow installation into our prefix
19     # Fix installation on Darwin
20     # Create necessary directories
21     # Make datatype configurable
22     (fetchpatch {
23       url = "https://github.com/mborgerding/kissfft/pull/38.patch";
24       sha256 = "0cp1awl7lr2vqmcwm9lfjs4b4dv9da8mg4hfd821r5ryadpyijj6";
25     })
26     # Install headers as well
27     (fetchpatch {
28       url = "https://github.com/mborgerding/kissfft/commit/71df949992d2dbbe15ce707cf56c3fa1e43b1080.patch";
29       sha256 = "13h4kzsj388mxxv6napp4gx2ymavz9xk646mnyp1i852dijpmapm";
30     })
31   ];
33   postPatch = ''
34     substituteInPlace Makefile \
35       --replace "gcc" "${stdenv.cc.targetPrefix}cc" \
36       --replace "ar" "${stdenv.cc.targetPrefix}ar"
37   '';
38   makeFlags = [
39     "PREFIX=${placeholder "out"}"
40     "DATATYPE=double"
41   ];
43   meta = with lib; {
44     description = "A mixed-radix Fast Fourier Transform based up on the KISS principle";
45     homepage = "https://github.com/mborgerding/kissfft";
46     license = licenses.bsd3;
47     maintainers = [ maintainers.goibhniu ];
48     platforms = platforms.all;
49   };