summary refs log tree commit diff
path: root/pkgs/development/libraries/fmod/4.24.16.nix
blob: 191db2f6f6ddb6b4e396343d82b40c5a7a78c273 (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
{ stdenv, fetchurl }:

assert (stdenv.system == "x86_64-linux") || (stdenv.system == "i686-linux");
let
  bits = stdenv.lib.optionalString (stdenv.system == "x86_64-linux") "64";

  libPath = stdenv.lib.makeLibraryPath
    [ stdenv.cc.libc stdenv.cc.cc ] + ":${stdenv.cc.cc.lib}/lib64";
  patchLib = x: "patchelf --set-rpath ${libPath} ${x}";

  src =
    (if (bits == "64") then
      fetchurl {
        url = "http://zandronum.com/essentials/fmod/fmodapi42416linux64.tar.gz";
        sha256 = "0hkwlzchzzgd7fanqznbv5bs53z2qy8iiv9l2y77l4sg1jwmlm6y";
      }
    else
      fetchurl {
        url = "http://zandronum.com/essentials/fmod/fmodapi42416linux.tar.gz";
        sha256 = "13diw3ax2slkr99mwyjyc62b8awc30k0z08cvkpk2p3i1j6f85m5";
      }
    );
in
stdenv.mkDerivation rec {
  inherit src;

  name    = "fmod-${version}";
  version = "4.24.16";

  dontStrip = true;
  dontPatchELF = true;

  makeFlags = [ "DESTLIBDIR=$(out)/lib" "DESTHDRDIR=$(out)/include" ];

  buildPhase = "true";

  preInstall = ''
    mkdir -p $out/lib
  '';

  postInstall = ''
    mv $out/lib/libfmodex${bits}-${version}.so $out/lib/libfmodex.so
    mv $out/lib/libfmodexp${bits}-${version}.so $out/lib/libfmodexp.so
  '';

  meta = with stdenv.lib; {
    description = "Programming library and toolkit for the creation and playback of interactive audio";
    homepage    = "http://www.fmod.org/";
    license     = licenses.unfreeRedistributable;
    platforms   = platforms.linux;
    maintainers = [ stdenv.lib.maintainers.lassulus ];
  };
}