about summary refs log tree commit diff
path: root/pkgs/applications/audio/praat/default.nix
blob: 797e9bd0e5f1b6285576ef48768f0890a19b51c8 (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
{
  alsa-lib
, fetchFromGitHub
, gtk3
, lib
, libpulseaudio
, pkg-config
, stdenv
, wrapGAppsHook3
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "praat";
  version = "6.4.07";

  src = fetchFromGitHub {
    owner = "praat";
    repo = "praat";
    rev = "v${finalAttrs.version}";
    hash = "sha256-r36znpkyI6/UPtOm1ZjedOadRG1BiIscRV9qRLf/A5Q=";
  };

  nativeBuildInputs = [
    pkg-config
    wrapGAppsHook3
  ];

  buildInputs = [
    alsa-lib
    gtk3
    libpulseaudio
  ];

  makeFlags = [
    "AR=${stdenv.cc.targetPrefix}ar"
  ];

  configurePhase = ''
    runHook preConfigure

    cp makefiles/makefile.defs.linux.pulse makefile.defs

    runHook postConfigure
  '';

  installPhase = ''
    runHook preInstall

    install -Dt $out/bin praat
    install -Dm444 main/praat.desktop -t $out/share/applications
    install -Dm444 main/praat-32.ico $out/share/icons/hicolor/32x32/apps/praat.ico
    install -Dm444 main/praat-256.ico $out/share/icons/hicolor/256x256/apps/praat.ico
    install -Dm444 main/praat-480.png $out/share/icons/hicolor/480x480/apps/praat.png
    install -Dm444 main/praat-480.svg $out/share/icons/hicolor/scalable/apps/praat.svg

    runHook postInstall
  '';

  enableParallelBuilding = true;

  meta = {
    description = "Doing phonetics by computer";
    mainProgram = "praat";
    homepage = "https://www.fon.hum.uva.nl/praat/";
    license = lib.licenses.gpl2Plus; # Has some 3rd-party code in it though
    maintainers = with lib.maintainers; [ orivej ];
    platforms = lib.platforms.linux;
  };
})