evcc: 0.131.4 -> 0.131.5
[NixPkgs.git] / pkgs / by-name / ch / chromaprint / package.nix
blob539e6333419da56cd1cea070fb8574f582cf6ecd
1 { lib
2 , stdenv
3 , fetchurl
4 , fetchpatch
5 , fetchpatch2
6 , cmake
7 , ninja
8 , ffmpeg
9 , darwin
10 , zlib
13 stdenv.mkDerivation rec {
14   pname = "chromaprint";
15   version = "1.5.1";
17   src = fetchurl {
18     url = "https://github.com/acoustid/chromaprint/releases/download/v${version}/${pname}-${version}.tar.gz";
19     sha256 = "sha256-oarY+juLGLeNN1Wzdn+v+au2ckLgG0eOyaZOGQ8zXhw=";
20   };
22   patches = [
23     # Use FFmpeg 5.x
24     # https://github.com/acoustid/chromaprint/pull/120
25     (fetchpatch {
26       url = "https://github.com/acoustid/chromaprint/commit/8ccad6937177b1b92e40ab8f4447ea27bac009a7.patch";
27       hash = "sha256-yO2iWmU9s2p0uJfwIdmk3jZ5HXBIQZ/NyOqG+Y5EHdg=";
28       excludes = [ "package/build.sh" ];
29     })
30     # ffmpeg5 fix for issue #122
31     # https://github.com/acoustid/chromaprint/pull/125
32     (fetchpatch {
33       url = "https://github.com/acoustid/chromaprint/commit/aa67c95b9e486884a6d3ee8b0c91207d8c2b0551.patch";
34       hash = "sha256-dLY8FBzBqJehAofE924ayZK0HA/aKiuFhEFxL7dg6rY=";
35     })
36     # Fix for FFmpeg 7
37     (fetchpatch2 {
38       url = "https://gitlab.archlinux.org/archlinux/packaging/packages/chromaprint/-/raw/74ae4c7faea2114f2d70a57755f714e348476d28/ffmpeg-7.patch";
39       hash = "sha256-io+dzhDNlz+2hWhNfsyePKLQjiUvSzbv10lHVKumTEk=";
40     })
41   ];
43   nativeBuildInputs = [ cmake ninja ];
45   buildInputs = [ ffmpeg ] ++ lib.optionals stdenv.hostPlatform.isDarwin
46     (with darwin.apple_sdk.frameworks; [ Accelerate CoreGraphics CoreVideo zlib ]);
48   cmakeFlags = [ "-DBUILD_EXAMPLES=ON" "-DBUILD_TOOLS=ON" ];
50   meta = with lib; {
51     homepage = "https://acoustid.org/chromaprint";
52     description = "AcoustID audio fingerprinting library";
53     mainProgram = "fpcalc";
54     license = licenses.lgpl21Plus;
55     platforms = platforms.unix;
56   };