summary refs log tree commit diff
path: root/pkgs/applications/audio/reaper/default.nix
blob: 6d6b228eeadd6204f4b3a583cdf49871225fa82e (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
73
74
75
76
77
78
79
80
81
{ stdenv, fetchurl, autoPatchelfHook, makeWrapper
, alsaLib, xorg
, fetchFromGitHub, pkgconfig, gnome3
, gnome2, gdk_pixbuf, cairo, glib, freetype
, libpulseaudio
}:

let
  libSwell = stdenv.mkDerivation {
    name = "libSwell";

    src = fetchFromGitHub {
      owner = "justinfrankel";
      repo = "WDL";
      rev = "e87f5bdee7327b63398366fde6ec0a3f08bf600d";
      sha256 = "147idjqc6nc23w9krl8a9w571k5jx190z3id6ir6cr8zsx0lakdb";
    };

    nativeBuildInputs = [ pkgconfig ];
    buildInputs = [ gnome3.gtk ];

    buildPhase = ''
      cd WDL/swell
      make
    '';

    installPhase = ''
      mv libSwell.so $out
    '';
  };

in stdenv.mkDerivation rec {
  name = "reaper-${version}";
  version = "5.93";

  src = fetchurl {
    url = "https://www.reaper.fm/files/${stdenv.lib.versions.major version}.x/reaper${builtins.replaceStrings ["."] [""] version}_linux_x86_64.tar.xz";
    sha256 = "17ciysyqp4by0yy08avk7z16inrmfwrmzh5l1r6fdni0y4ax65iq";
  };

  nativeBuildInputs = [ autoPatchelfHook makeWrapper ];

  buildInputs = [
    alsaLib
    stdenv.cc.cc.lib

    xorg.libX11
    xorg.libXi

    gnome3.gtk
    gdk_pixbuf
    gnome2.pango
    cairo
    glib
    freetype
  ];

  dontBuild = true;

  installPhase = ''
    ./install-reaper.sh --install $out/opt
    rm $out/opt/REAPER/uninstall-reaper.sh

    cp ${libSwell.out} $out/opt/REAPER/libSwell.so

    wrapProgram $out/opt/REAPER/reaper5 \
      --prefix LD_LIBRARY_PATH : ${libpulseaudio}/lib

    mkdir $out/bin
    ln -s $out/opt/REAPER/reaper5 $out/bin/
    ln -s $out/opt/REAPER/reamote-server $out/bin/
  '';

  meta = with stdenv.lib; {
    description = "Digital audio workstation";
    homepage = https://www.reaper.fm/;
    license = licenses.unfree;
    platforms = [ "x86_64-linux" ];
    maintainers = with maintainers; [ jfrankenau ];
  };
}