about summary refs log tree commit diff
path: root/pkgs/applications/audio/proteus/default.nix
blob: ab2bdae4ef0fc004dd0b94ff9234c7bda092b10c (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
{ lib, stdenv, fetchFromGitHub, autoPatchelfHook, cmake, pkg-config
, alsa-lib, freetype, libjack2
, libX11, libXext, libXcursor, libXinerama, libXrandr, libXrender
}:

stdenv.mkDerivation rec {
  pname = "proteus";
  version = "1.2";

  src = fetchFromGitHub {
    owner = "GuitarML";
    repo = "Proteus";
    rev = "v${version}";
    fetchSubmodules = true;
    hash = "sha256-WhJh+Sx64JYxQQ1LXpDUwXeodFU1EZ0TmMhn+6w0hQg=";
  };

  nativeBuildInputs = [ autoPatchelfHook cmake pkg-config ];
  buildInputs = [
    alsa-lib freetype libjack2
    libX11 libXext libXcursor libXinerama libXrandr libXrender
  ];
  # JUCE loads most dependencies at runtime:
  runtimeDependencies = map lib.getLib buildInputs;

  env.NIX_CFLAGS_COMPILE = toString [
    # Support JACK output in the standalone application:
    "-DJUCE_JACK"
    # Accommodate -flto:
    "-ffat-lto-objects"
  ];

  # The default "make install" only installs JUCE, which should not be installed, and does not install proteus.
  installPhase = ''
    runHook preInstall

    mkdir -p $out/lib
    cp -rT Proteus_artefacts/*/Standalone $out/bin
    cp -rT Proteus_artefacts/*/LV2 $out/lib/lv2
    cp -rT Proteus_artefacts/*/VST3 $out/lib/vst3

    runHook postInstall
  '';

  meta = with lib; {
    description = "Guitar amp and pedal capture plugin using neural networks";
    homepage = "https://github.com/GuitarML/Proteus";
    license = licenses.gpl3;
    platforms = platforms.linux;
    maintainers = with maintainers; [ orivej ];
    mainProgram = "Proteus";
  };
}