2021-06-10 04:57:09 +02:00
|
|
|
{ stdenv, lib, fetchurl, alsa-lib, libpulseaudio, undmg }:
|
2016-12-17 13:31:45 +01:00
|
|
|
|
|
|
|
let
|
2021-01-15 05:31:39 +01:00
|
|
|
bits = lib.optionalString (stdenv.hostPlatform.system == "x86_64-linux") "64";
|
2021-06-10 04:57:09 +02:00
|
|
|
libPath = lib.makeLibraryPath [ stdenv.cc.cc alsa-lib libpulseaudio ];
|
2016-12-17 13:31:45 +01:00
|
|
|
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "fmod";
|
2018-03-05 15:32:10 +01:00
|
|
|
version = "4.44.64";
|
2018-05-11 06:54:38 +02:00
|
|
|
shortVersion = builtins.replaceStrings [ "." ] [ "" ] version;
|
2016-12-17 13:31:45 +01:00
|
|
|
|
2018-05-11 06:54:38 +02:00
|
|
|
src = fetchurl (if stdenv.isLinux then {
|
|
|
|
url = "https://zdoom.org/files/fmod/fmodapi${shortVersion}linux.tar.gz";
|
2018-03-05 15:32:10 +01:00
|
|
|
sha256 = "047hk92xapwwqj281f4zwl0ih821rrliya70gfj82sdfjh9lz8i1";
|
2018-05-11 06:54:38 +02:00
|
|
|
} else {
|
|
|
|
url = "https://zdoom.org/files/fmod/fmodapi${shortVersion}mac-installer.dmg";
|
|
|
|
sha256 = "1m1y4cpcwpkl8x31d3s68xzp107f343ma09w2437i2adn5y7m8ii";
|
|
|
|
});
|
|
|
|
|
|
|
|
nativeBuildInputs = [ undmg ];
|
2016-12-17 13:31:45 +01:00
|
|
|
|
|
|
|
dontStrip = true;
|
|
|
|
dontPatchELF = true;
|
|
|
|
dontBuild = true;
|
|
|
|
|
2018-05-11 06:54:38 +02:00
|
|
|
installPhase = lib.optionalString stdenv.isLinux ''
|
2018-03-05 15:32:10 +01:00
|
|
|
install -Dm755 api/lib/libfmodex${bits}-${version}.so $out/lib/libfmodex-${version}.so
|
|
|
|
ln -s libfmodex-${version}.so $out/lib/libfmodex.so
|
|
|
|
patchelf --set-rpath ${libPath} $out/lib/libfmodex.so
|
2018-05-11 06:54:38 +02:00
|
|
|
'' + lib.optionalString stdenv.isDarwin ''
|
|
|
|
install -D api/lib/libfmodex.dylib $out/lib/libfmodex.dylib
|
|
|
|
install -D api/lib/libfmodexL.dylib $out/lib/libfmodexL.dylib
|
|
|
|
'' + ''
|
2018-03-05 15:32:10 +01:00
|
|
|
cp -r api/inc $out/include
|
2016-12-17 13:31:45 +01:00
|
|
|
'';
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2016-12-17 13:31:45 +01:00
|
|
|
description = "Programming library and toolkit for the creation and playback of interactive audio";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "http://www.fmod.org/";
|
2016-12-17 13:31:45 +01:00
|
|
|
license = licenses.unfreeRedistributable;
|
2018-05-11 06:54:38 +02:00
|
|
|
platforms = [ "x86_64-linux" "i686-linux" "x86_64-darwin" ];
|
2018-03-05 15:32:10 +01:00
|
|
|
maintainers = [ maintainers.lassulus ];
|
2016-12-17 13:31:45 +01:00
|
|
|
};
|
|
|
|
}
|