about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/audio/in-formant/default.nix
blob: 89e7e876af8ea30765105adeb610cac450992110 (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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
{ stdenv
, cmake
, lib
, fetchFromGitHub
, wrapQtAppsHook
, qtbase
, qtcharts
, fftw
, libtorch-bin
, portaudio
, eigen
, xorg
, pkg-config
, autoPatchelfHook
, soxr
, freetype
, libsamplerate
, armadillo
, tomlplusplus
}:

stdenv.mkDerivation rec {
  pname = "in-formant";
  version = "unstable-2022-09-15";

  src = fetchFromGitHub {
    owner = "in-formant";
    repo = "in-formant";
    rev = "e0606feecff70f0fd4226ff8f116e46817dd7462";
    hash = "sha256-/4eKny9M2e8Lb9LOiKBj9QLE00CAaD+2ZAwn48lnvKQ=";
    fetchSubmodules = true;
  };

  patches = [
    # Ignore the freetype sources bundled as a submodule:
    # /nix/store/…-harfbuzz-7.0.0/lib/libharfbuzz.so.0: undefined reference to `FT_Get_Transform'
    ./0001-Avoid-using-vendored-dependencies-we-have-in-nixpkgs.patch
  ];

  nativeBuildInputs = [ cmake pkg-config wrapQtAppsHook autoPatchelfHook ];

  buildInputs = [
    qtbase
    qtcharts
    fftw
    libtorch-bin
    portaudio
    eigen
    xorg.libxcb
    soxr
    libsamplerate
    armadillo
    tomlplusplus
  ];

  installPhase = ''
    mkdir -p $out/bin
    cp in-formant $out/bin
    install -Dm444 $src/dist-res/in-formant.desktop -t $out/share/applications
    install -Dm444 $src/dist-res/in-formant.png -t $out/share/icons/hicolor/512x512/apps
  '';

  meta = with lib; {
    description = "A real-time pitch and formant tracking software";
    mainProgram = "in-formant";
    homepage = "https://github.com/in-formant/in-formant";
    license = licenses.asl20;
    # currently broken on i686-linux and aarch64-linux due to other nixpkgs dependencies
    platforms = [ "x86_64-linux" ];
    maintainers = with maintainers; [ ckie ];
  };
}