summary refs log tree commit diff
path: root/pkgs/applications/audio/pd-plugins/helmholtz/default.nix
blob: be5a385d3088fca1044f52b9ce58a16739eedd40 (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
{ stdenv, fetchurl, unzip, puredata }:

stdenv.mkDerivation {
  name = "helmholtz";

  src = fetchurl {
    url = "https://www.katjaas.nl/helmholtz/helmholtz~.zip";
    name = "helmholtz.zip";
    curlOpts = "--user-agent ''";
    sha256 = "0h1fj7lmvq9j6rmw33rb8k0byxb898bi2xhcwkqalb84avhywgvs";
  };

  buildInputs = [ unzip puredata ];

  unpackPhase = ''
    unzip $src
    mv helmholtz~/src/helmholtz\~.cpp .
    mv helmholtz~/src/Helmholtz.cpp .
    mv helmholtz~/src/include/ .
    mv helmholtz~/src/Makefile .
    rm -rf helmholtz~/src/
    rm helmholtz~/helmholtz~.pd_darwin
    rm helmholtz~/helmholtz~.pd_linux
    rm helmholtz~/helmholtz~.dll
    rm -rf __MACOSX
  '';

  patchPhase = ''
    mkdir -p $out/helmholtz~
    sed -i "s@current: pd_darwin@current: pd_linux@g" Makefile
    sed -i "s@-Wl@@g" Makefile
    sed -i "s@\$(NAME).pd_linux \.\./\$(NAME).pd_linux@helmholtz~.pd_linux $out/helmholtz~/@g" Makefile
  '';

  installPhase = ''
    cp -r helmholtz~/ $out/
  '';

  meta = {
    description = "Time domain pitch tracker for Pure Data";
    homepage = "http://www.katjaas.nl/helmholtz/helmholtz.html";
    license = stdenv.lib.licenses.bsd3;
    maintainers = [ stdenv.lib.maintainers.magnetophon ];
    platforms = stdenv.lib.platforms.linux;
  };
}