nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 chromaprint,
4 fetchFromGitHub,
5 python3Packages,
6}:
7python3Packages.buildPythonPackage rec {
8 version = "0.2.2";
9 pname = "audiomatch";
10 pyproject = true;
11 src = fetchFromGitHub {
12 owner = "unmade";
13 repo = "audiomatch";
14 tag = version;
15 hash = "sha256-I7gTP2lwg4EDNmI+tVmI721/nEDShb7q21tD9tRbskY=";
16 };
17
18 postPatch = ''
19 substituteInPlace pyproject.toml \
20 --replace-fail 'poetry>=0.12,<1.0' "poetry-core" \
21 --replace-fail 'poetry.masonry.api' 'poetry.core.masonry.api'
22
23 substituteInPlace src/audiomatch/fingerprints.py \
24 --replace-fail 'fpcalc' '${lib.getExe chromaprint}'
25 '';
26
27 build-system = [
28 python3Packages.poetry-core
29 python3Packages.distutils
30 ];
31
32 nativeCheckInputs = [
33 python3Packages.pytestCheckHook
34 ];
35
36 meta = {
37 homepage = "https://github.com/unmade/audiomatch";
38 description = "A small command-line tool to find similar audio files";
39 changelog = "https://github.com/unmade/audiomatch/releases/tag/${version}";
40 license = lib.licenses.mit;
41 platforms = lib.platforms.all;
42 mainProgram = "audiomatch";
43 maintainers = with lib.maintainers; [ leha44581 ];
44 };
45}