summary refs log tree commit diff
path: root/pkgs/applications/audio/renoise/default.nix
blob: 704f3f01c00e24eebb2a96121e9a68aa1a7e2314 (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
{ stdenv, lib, requireFile, demo, fetchurl, libX11, libXext, libXcursor, libXrandr, libjack2, alsaLib, ... }:

stdenv.mkDerivation rec {
  name = "renoise";

  buildInputs = [ libX11 libXext libXcursor libXrandr alsaLib libjack2 ];

  src =
    if builtins.currentSystem == "x86_64-linux" then
        if demo then
        fetchurl {
            url = "http://files.renoise.com/demo/Renoise_3_0_1_Demo_x86_64.tar.bz2";
            sha256 = "1q7f94wz2dbz659kpp53a3n1qyndsk0pkb29lxdff4pc3ddqwykg";
        }
        else
        requireFile {
            url = "http://backstage.renoise.com/frontend/app/index.html#/login";
            name = "rns_3_0_1_reg_x86_64.tar.gz";
            sha256 = "1swax2jz0gswdpzz8alwjfd8rhigc2yfspj7p8wvdvylqrf7n8q7";
        }
    else if builtins.currentSystem == "i686-linux" then
        if demo then
        fetchurl {
            url = "http://files.renoise.com/demo/Renoise_3_0_1_Demo_x86.tar.bz2";
            sha256 = "0dgqvib4xh2yhgh2wajj11wsb6xiiwgfkhyz32g8vnyaij5q8f58";
        }
        else
        requireFile {
            url = "http://backstage.renoise.com/frontend/app/index.html#/login";
            name = "rns_3_0_1_reg_x86.tar.gz";
            sha256 = "1swax2jz0gswdpzz8alwjfd8rhigc2yfspj7p8wvdvylqrf7n8q7";
        }
    else throw "platform is not suppored by Renoise";

  installPhase = ''
    cp -r Resources $out

    mkdir -p $out/lib/

    mv $out/AudioPluginServer* $out/lib/

    cp renoise $out/renoise

    for path in ${toString buildInputs}; do
      ln -s $path/lib/*.so* $out/lib/
    done

    ln -s ${stdenv.cc.cc}/lib/libstdc++.so.6 $out/lib/

    mkdir $out/bin
    ln -s $out/renoise $out/bin/renoise

    patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) --set-rpath $out/lib $out/renoise
  '';

  meta = {
    description = "modern tracker-based DAW";
    homepage = http://www.renoise.com/;
    license = stdenv.lib.licenses.unfree;
  };
}