about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/audio/flac2all/default.nix
blob: 4a6132d39af33af16ae6752cb22ab15934963462 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{ python3Packages, fetchPypi, lib, flac, lame, opusTools, vorbis-tools, ffmpeg }:

python3Packages.buildPythonApplication rec {
  pname = "flac2all";
  version = "5.1";

  src = fetchPypi {
    inherit pname version;
    sha256 = "OBjlr7cbSx2WOIfZUNwHy5Hpb2Fmh3vmZdc70JiWsiI=";
  };

  # Not sure why this is needed, but setup.py expects this to be set
  postPatch = ''
    echo ${version} > ./flac2all_pkg/version
  '';

  propagatedBuildInputs = [
    python3Packages.pyzmq
  ];

  postInstall = ''
    wrapProgram $out/bin/flac2all \
      --set PATH ${lib.makeBinPath [
        # Hard requirements
        flac
        lame
        # Optional deps depending on encoding types
        opusTools
        vorbis-tools
        ffmpeg
      ]}
  '';

  # Has no standard tests, so we verify a few imports instead.
  doCheck = false;
  pythonImportsCheck = [ "flac2all_pkg.vorbis" "flac2all_pkg.mp3" ];

  meta = with lib; {
    description = "Multi process, clustered, FLAC to multi codec audio converter with tagging support";
    homepage = "https://github.com/ZivaVatra/flac2all";
    license = licenses.gpl3;
    # TODO: This has only been tested on Linux, but may work on Mac too.
    platforms = platforms.linux;
  };
}